Page 1 of 1

domoticz.time.minute exist?

Posted: Sunday 26 August 2018 11:20
by TheCondor
Hi, i've an old and working script which opens gradually the blinds every morning in 3 step but i want to optimize. Considering that in the time trigger i've that:

Code: Select all

   on = {
        timer = {
            'at 22:30',
            'at 7:45',
            'at 8:45'
            },
now i need an 'if' statement build in this way:

if domoticz.time.hour is 7 AND DOMOTICZ.TIME.MINUTE IS 45 then
open blind at level 20
elseif domoticz.time.hour is 8 AND DOMOTICZ.TIME.MINUTE IS 00 then
open blind at level 40
elseif domoticz.time.hour is 8 AND DOMOTICZ.TIME.MINUTE IS 15 then
open blind at elevel 100



i've tried but domoticz.time.minute seems to not exist in dzvents, correct?
Thanks in advance.

Re: domoticz.time.minute exist?

Posted: Sunday 26 August 2018 11:38
by dannybloe
It should be

Code: Select all

domoticz.time.minutes
(plural). See the docs :-). Same as hours and seconds.

Re: domoticz.time.minute exist?

Posted: Sunday 26 August 2018 12:02
by waaren
TheCondor wrote: Sunday 26 August 2018 11:20
if domoticz.time.hour is 7 AND DOMOTICZ.TIME.MINUTE IS 45 then
open blind at level 20
elseif domoticz.time.hour is 8 AND DOMOTICZ.TIME.MINUTE IS 00 then
open blind at level 40
elseif domoticz.time.hour is 8 AND DOMOTICZ.TIME.MINUTE IS 15 then
open blind at level 100
i've tried but domoticz.time.minute seems to not exist in dzvents, correct?
Lua and dzVents are case sensitive and to check the minutes use domoticz.time.minutes (plural also for seconds but not for hour)
You can also use

Code: Select all

 if domoticz.time.matchesRule('at 7:45') then

Re: domoticz.time.minute exist?

Posted: Thursday 30 August 2018 22:29
by TheCondor
Thanks both! I used match timing forn now. That's will help to male more simple and interactive my script.