I am strugling to get this rule operational. I use the latest firmware on my Nodemcu. At this moment this rule execute on time, defined in the rule but doesn't take notice on the "Holiday#State]=1" option. How can I fix that?
On Clock#Time=All,**:** do // every day at **:** hours do
If [Holiday#State]=1 and %systime%=10:27 or %systime%=10:28
GPIO,12,0
timerset,1,30
endif
endon
On Rules#Timer=1 do
GPIO,12,1
endon
Clock#time in a rule
Moderators: grovkillen, Stuntteam, TD-er
Re: Clock#time in a rule
I think the combination of 'and' and 'or' in a single condition is causing you trouble, and also the %systime% variable can not be compared like that
To be sure, you'd better code it like this:
To be sure, you'd better code it like this:
Code: Select all
On Clock#Time=All,**:** do // every day at **:** hours do
If [Holiday#State]=1 and %syssec_d%>=37620 and %syssec_d%<=37680 // 10:27 = 10*3600 + 27*60 = 37620, 10:28 = 37680
GPIO,12,0
timerset,1,30
endif
endon
On Rules#Timer=1 do
GPIO,12,1
endon
/Ton (PayPal.me)
Re: Clock#time in a rule
Thanks foor the reply but what I wanted is that I have 2 moments in time, say 13:00 and 17:00. On those moments I want to start the timer but only is the Holiday switch is active and if not active, It will not start the timer.
Re: Clock#time in a rule
Code: Select all
On Clock#Time=All,**:** do // every day at **:** hours do
If [Holiday#State]=1
if %syssec_d%=37620 or %syssec_d%=37680 // 10:27 = 10*3600 + 27*60 = 37620, 10:28 = 37680
GPIO,12,0
timerset,1,30
endif
endif
endon
On Rules#Timer=1 do
GPIO,12,1
endon
Another solution could be:
Code: Select all
On Clock#Time=All,13:00 do // every day at **:** hours do
asyncevent,checkHolidayState
endon
On Clock#Time=All,17:00 do // every day at **:** hours do
asyncevent,checkHolidayState
endon
on checkHolidayState do
If [Holiday#State]=1
GPIO,12,0
timerset,1,30
endif
endon
On Rules#Timer=1 do
GPIO,12,1
endon
/Ton (PayPal.me)
Re: Clock#time in a rule
both solutions are working so I can make a selection. Thanks for the support
Who is online
Users browsing this forum: No registered users and 39 guests