Rules: event script correct?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
lumajo
Normal user
Posts: 20
Joined: 03 Feb 2018, 13:19
Location: Munich

Rules: event script correct?

#1 Post by lumajo » 19 Feb 2021, 10:10

Hi
i am using ESPEeasy now since a while but I am unsure how to seolve this:
espeasy build is old: 147.

I want to set a timer value shorter during 22h and 6h in the morning. (Bathlight)
As far as I know variables like let,1,10 does not work in this old build.
how can i solve this?

Code: Select all

on led_on do
      timerset,1,600
    if %systime%<05:00:00
       timerset,1,180
   endif
   if %systime%>22:00:00
       timerset,1,180
   endif
     gpio,12,1     // Schaltet Relais
     gpio,13,0     // Schaltet LED
endon
This only sets the timer to 600 instead of 180. Unfortunately "Or" does not work in this old build.
Thanks

TD-er
Core team member
Posts: 8820
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Rules: event script correct?

#2 Post by TD-er » 19 Feb 2021, 11:08

Maybe "else" does work in that old build?

lumajo
Normal user
Posts: 20
Joined: 03 Feb 2018, 13:19
Location: Munich

Re: Rules: event script correct?

#3 Post by lumajo » 19 Feb 2021, 11:45

Yes works, but I have 2 if's means its first loop will be overwritten by the second if-else

User avatar
Ath
Normal user
Posts: 3613
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Rules: event script correct?

#4 Post by Ath » 19 Feb 2021, 11:47

What's blocking you from upgrading to a more recent build of ESPEasy? R147 is ~4 years old...
/Ton (PayPal.me)

lumajo
Normal user
Posts: 20
Joined: 03 Feb 2018, 13:19
Location: Munich

Re: Rules: event script correct?

#5 Post by lumajo » 19 Feb 2021, 18:20

Whats blocking me? Basically I am just too lazy. But actually its something I will do, things are so much easier then...:-)

no change of firmware needed: Solution:

Code: Select all

on led_on do
    if %systime% > 05:00:00
       timerset,1,600
   else
      timerset,1,180
   endif
   if %systime% > 22:00:00
       timerset,1,180
   endif

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests