Page 1 of 1

domoticz.time.matchesRule('at 23:00-06:00')?

Posted: Sunday 02 July 2017 14:26
by xces
So last night a burglar walked through my garden, i didn't wake up until my neighbor had called the cops, who came an hour later and then knocked at my front door.

I now have this kind of dzVents script:
lux < 300 then garden lights on
lux > 300 then garden lights off

So now my garden is practically lit with 20% of light all night.

What i want to achieve is this:
when lux < 300 then the lights should go on (at 20%)
instead from 23:00 until 06:00 the lights should be off (unless there is motion but i'll add that myself)

Basically the question is; does the domoticz.time.matchesRule() work with overlapping days? e.g. this:

Code: Select all

if (lux < 300) then
   if (domoticz.time.matchesRule('at 23:00-06:00')) then
      -- light off
   else
      -- light on at 20%
   end
end

Re: domoticz.time.matchesRule('at 23:00-06:00')?

Posted: Sunday 02 July 2017 14:36
by dannybloe
Yes, this should work. I have a couple of unit-tests in the dzVents code that specifically test this.
But don't hold it against me if it doesn't ;)

Re: domoticz.time.matchesRule('at 23:00-06:00')?

Posted: Sunday 02 July 2017 14:37
by xces
Oh yes i will :) ghehe gonna test it tonight. Thanks for the reply

Re: domoticz.time.matchesRule('at 23:00-06:00')?

Posted: Sunday 02 July 2017 14:39
by dannybloe
Please.. let me know if it doesn't (or does work out). Then we'll have some debugging to do.