Good day, dear friends, please kindly assist with rule for my device ( aquarium controller with temp sensor and timer switch for lighting)
in tutorial rules I find following example for timer switch, but I think it can work incorrectly
On Clock#Time=All,7:30 do // every day at 7:30 hours switch on relay on gpio 13
gpio,13,0
endon
On Clock#Time=All,22:00 do // every day at 22:00 hours switch off relay on gpio 13
gpio,13,0
endon
how device will work if it will be reboot in 14:00? i think GPIO state may be changed to default in this case.
is rule " if Clock#Time >7:00 and <22:00 then gpio,13,0" ? what is correct syntax for this case?
PS is firmware allow me to display on LCD relay(gpio) status as variable?
Now i make is as displaying status of input device and it displayed as "relay1: 1 or 0" on LCD
Can it be changed to "relay1: on/off" ?
thanks.
ESPEasy timer switch
Moderators: grovkillen, Stuntteam, TD-er
Re: ESPEasy timer switch
Hi to all,
the same question ? Some help.
Thanks
the same question ? Some help.
Thanks
Re: ESPEasy timer switch
maybe try espmega, it has the feature to keep gpio states on reboot (not power off though).it also has an extended timer menu
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
Re: ESPEasy timer switch
I use this for my toilet window, maybe this is a idea for you:Brainfree wrote:Good day, dear friends, please kindly assist with rule for my device ( aquarium controller with temp sensor and timer switch for lighting)
in tutorial rules I find following example for timer switch, but I think it can work incorrectly
On Clock#Time=All,7:30 do // every day at 7:30 hours switch on relay on gpio 13
gpio,13,0
endon
On Clock#Time=All,22:00 do // every day at 22:00 hours switch off relay on gpio 13
gpio,13,0
endon
how device will work if it will be reboot in 14:00? i think GPIO state may be changed to default in this case.
is rule " if Clock#Time >7:00 and <22:00 then gpio,13,0" ? what is correct syntax for this case?
PS is firmware allow me to display on LCD relay(gpio) status as variable?
Now i make is as displaying status of input device and it displayed as "relay1: 1 or 0" on LCD
Can it be changed to "relay1: on/off" ?
thanks.
on wcraam-open do
gpio,0,0 // relay on
timerSet 1,2 // 2 seconds timer
endon
on Rules#Timer=1 do
gpio,0,1 // relay off
endon
on wcraam-dicht do
gpio,16,0 // relay on
timerSet 2,2 // 2 seconds timer
endon
on Rules#Timer=2 do
gpio,16,1 // relay off
endon
Re: ESPEasy timer switch
The clock#time event seems to work only with "=".Brainfree wrote:...
how device will work if it will be reboot in 14:00? i think GPIO state may be changed to default in this case.
is rule " if Clock#Time >7:00 and <22:00 then gpio,13,0" ? what is correct syntax for this case?
...
I solved a similar problem like this (in addition to the clock#time rules):
Code: Select all
on System#Boot do //delay 5 seconds to get the time
timerSet,1,5
endon
on Rules#Timer=1 do
if %systime% > 7:59
//do something (on)
endif
if %systime% > 19:59
//do something else (off)
endif
endon
Re: ESPEasy timer switch
Dear Paxi, many thanks for assistance,
As i undestand code will work as following (for example for 20:00)
after boot, system will check current time every 5 seconds and compare will below terms
on Rules#Timer=1 do
if %systime% > 7:59
//do something (on)
endif
// this part will check 20:00>7:00, YES, so ESP will do something (on), and will check next condition
if %systime% > 19:59
//do something else (off)
endif
// here it will check 20:00>19:59, YES, so ESP will do something (off)
endon
//end of cycle
did relay will blink every 5 seconds after 19:59 because both of terms will be complied.
As i undestand code will work as following (for example for 20:00)
after boot, system will check current time every 5 seconds and compare will below terms
on Rules#Timer=1 do
if %systime% > 7:59
//do something (on)
endif
// this part will check 20:00>7:00, YES, so ESP will do something (on), and will check next condition
if %systime% > 19:59
//do something else (off)
endif
// here it will check 20:00>19:59, YES, so ESP will do something (off)
endon
//end of cycle
did relay will blink every 5 seconds after 19:59 because both of terms will be complied.
Re: ESPEasy timer switch
No, there is no cycle - the system#boot event is only triggered once. Thus the rules#timer part runs only once, too - 5 seconds after booting is completed.
Here is a reworked code snippet that avoids the flickering:
If you set the boot state of your pin to "output low" it can be simplified to:
Here is a reworked code snippet that avoids the flickering:
Code: Select all
on System#Boot do
timerSet,1,5
endon
on Rules#Timer=1 do
if %systime% < 8:00
(off)
else
event checkdaytime
endif
endon
on checkdaytime do
if %systime% > 19:59
(off)
else
(on)
endif
endon
Code: Select all
on System#Boot do
timerSet,1,5
endon
on Rules#Timer=1 do
if %systime% > 7:59
event checkdaytime
endif
endon
on checkdaytime do
if %systime% < 20:00
(on)
endif
endon
Who is online
Users browsing this forum: Google [Bot] and 140 guests