Hi, I tried so much, but no good results. What I want is this (in rules):
GPIO x has to switch ON every 20 Minutes for 2 Minutes if systime >10.00 and <22:00
GPIO x has to switch ON every 1 hour for 2 Minutes if systime >22:00 and <10:00
Is anyone able to give me some hints?
Thank you
Lonzo
Time & Timer Control
Moderators: grovkillen, Stuntteam, TD-er
Re: Time & Timer Control
See here for a list of events:
https://espeasy.readthedocs.io/en/lates ... tem-events
You want probably act on Time#Initialized
In this example I set 2 timers:
timer 1: turn off and schedule timer 2 based on the system time
timer 2: turn on and schedule timer 1 to turn it off.
https://espeasy.readthedocs.io/en/lates ... tem-events
You want probably act on Time#Initialized
In this example I set 2 timers:
timer 1: turn off and schedule timer 2 based on the system time
timer 2: turn on and schedule timer 1 to turn it off.
Code: Select all
on Time#Initialized do
timerset,1,120 // Set off timer to 2 minutes
gpio,2,1 // Turn on GPIO2
endon
on Rules#Timer=1 do
// Timer to turn off the GPIO
gpio,2,0 // Turn off GPIO 2
let,1,1080 // Set variable 1 to (20 - 2) minutes in seconds
If %systime% > 10:00:00
let,1,3480 // Set variable 1 to (60 - 2) minutes in seconds
endif
If %systime% > 22:00:00
let,1,1080 // Set variable 1 to (20 - 2) minutes in seconds
endif
timerset,2,[int#1] // Set timer 2
endon
on Rules#Timer=2 do
timerset,1,120 // Set off timer to 2 minutes
gpio,2,1 // Turn on GPIO2
endon
Re: Time & Timer Control
Thank you. I will study and try it.
Lonzo
Lonzo
Re: Time & Timer Control
@TD-er: Thank you very much! It works. I had to adjust some parameters and I am happy.
Lonzo
Lonzo
Who is online
Users browsing this forum: Google [Bot] and 148 guests