Page 1 of 1

domoticz.time.hour question

Posted: Sunday 19 July 2020 22:41
by kroonp
A question from a beginner.

This works:

Code: Select all

 if (domoticz.time.hour > 11 and domoticz.time.hour < 12) then
But how can i this working?

Code: Select all

 if (domoticz.time.hour > 11:15  and domoticz.time.hour < 12:20) then
Thanks,
Peter

Re: domoticz.time.hour question

Posted: Sunday 19 July 2020 22:58
by waaren
kroonp wrote: Sunday 19 July 2020 22:41 This works:

Code: Select all

if (domoticz.time.hour > 11 and domoticz.time.hour < 12) then
It will work but it will never evaluate to true. dz.time.hour is an integer and there are no integers between 11 and 12.

But how can i this working?

Code: Select all

 if (domoticz.time.hour > 11:15  and domoticz.time.hour < 12:20) then

Code: Select all

if domoticz.time.matchesRule('at 11:15-12:19') then