Page 1 of 1

triggering device after another is ON between time

Posted: Sunday 17 November 2019 12:15
by Adso76
Hi,

How to turn on the device after another one has just been turned on but only at certain time. Whats wrong with the following statement:

if ((device.name == '.....') and (domoticz.time == 'between 22:00 and 30 minutes before sunrise')) then

Thanks.
Arek

Re: triggering device after another is ON between time

Posted: Sunday 17 November 2019 12:26
by waaren
Adso76 wrote: Sunday 17 November 2019 12:15 Whats wrong with the following statement ?

if ((device.name == '.....') and (domoticz.time == 'between 22:00 and 30 minutes before sunrise')) then
domoticz.time is a time object and cannot be compared against a rule. You will need something like

Code: Select all

    if device.name == '.....' and domoticz.time.matchesRule('between 22:00 and 30 minutes before sunrise')  then

Re: triggering device after another is ON between time  [Solved]

Posted: Monday 18 November 2019 18:23
by Adso76
Great thanks! Works!
A.