Hello gurus,
I just bought myself an electric candlestick and I want to control it with a LUX sensor and a relay. The hardware is working and ESP Easy is up and running.
I basically want a rule that turns the relay on if it's dark and off if its daylight. However, how can I make sure that the relay is also off when I'm sleeping?
I can't figure out the syntax, but I want a rule like this:
If clock is between 06:00 and 22:30 and it is dark turn the relay on
If it is daylight, turn the relay off
If clock is between 22:30 and 06:00 turn the relay off
(My device is called lux#value and the relay turns on with gpio,12,1)
Any advice?
Best regards,
/David
Rule for LUX combined with CLOCK
Moderators: grovkillen, Stuntteam, TD-er
Re: Rule for LUX combined with CLOCK
Think I solved it.
Used a dummy device to disable the lux sensor when I'm sleeping during the night.
Added 'Setpoint' so I can trigger the dummy manually via http
Used a dummy device to disable the lux sensor when I'm sleeping during the night.
Added 'Setpoint' so I can trigger the dummy manually via http
Code: Select all
on Setpoint do
TaskValueSet 2,1,%eventvalue%
endon
On Clock#Time=All,06:00 do
Taskvalueset,2,1,1
Endon
On Clock#Time=Sat,22:30 do
Taskvalueset,2,1,0
Endon
on lux#value<10 do
if [candlestick#dummy]=1
GPIO,12,1
else
GPIO,12,0
endif
endon
Re: Rule for LUX combined with CLOCK
You can also use the sunrise and sunset calculations in rules.
For this you have to enter the GPS coordinates in the Advanced Settings. (do not have to be very accurate)
For this you have to enter the GPS coordinates in the Advanced Settings. (do not have to be very accurate)
Re: Rule for LUX combined with CLOCK
Here is my solution for turning the backyard light on and off without an LDR sensor using sunset and sunrise features with up-to-date startup checking. I use ESP-1s relay
Code: Select all
on Time#Initialized do
GPIO,0,0
timerSet,1,5
endon
On Rules#Timer=1 do
If %systm_hm% > %sunset+25m%
Gpio,0,1
timerSet,1,0
else
timerSet,2,1
Endif
endon
On Rules#Timer=2 do
If %systm_hm% < %sunrise-25m%
Gpio,0,1
timerSet,2,0
else
timerSet,3,1
Endif
endon
On Rules#Timer=3 do
If %systm_hm% > %sunrise-25m%
Gpio,0,0
timerSet,4,1
else
timerSet,1,1
Endif
endon
On Rules#Timer=4 do
If %systm_hm% < %sunset+25m%
Gpio,0,0
timerSet,4,0
else
timerSet,1,1
Endif
endon
On Clock#Time=All,%sunrise-25m% do
Gpio,0,0
endon
On Clock#Time=All,%sunset+25m% do
Gpio,0,1
endon
Who is online
Users browsing this forum: No registered users and 55 guests