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

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
xces
Posts: 39
Joined: Thursday 05 February 2015 9:02
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

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

Post 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
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

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

Post 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 ;)
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
xces
Posts: 39
Joined: Thursday 05 February 2015 9:02
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

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

Post by xces »

Oh yes i will :) ghehe gonna test it tonight. Thanks for the reply
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

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

Post by dannybloe »

Please.. let me know if it doesn't (or does work out). Then we'll have some debugging to do.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest