Code: Select all
on Light#Lux do
if [Light#Lux] < 25 and %systime% < 23:15:00 and %systime% > 16:30:00
GPIO,2,0
elseif [Light#Lux] < 35 and %systime% < 7:30:00 and %systime% > 6:30:00
GPIO,2.0
else
GPIO,2,1
endif
endon
on dummy#switch=0 do
event,lightoff
on dummy#switch=1 do
event,lighton
endon
// Attention!: GPIO2 has been intentionally "inverted" !
// At: dummy => switch => Edit "inversed logic" checked!
Trigger on 35 lux a.m. from 6:30 - 7:30 only on working days
Why?
Due to the sun coming up and going down the TSL2561 catches different light.
Working days:
Coming home from work: 16:30 – I want the light only switched on at 25 lux.
Going to sleep: 23:15 - I want the light switched off.
Wake up:
6:30 – 7:30 I want the light only switched on at < (less then) 15 lux
Weekend:
The same, but everything 1 hour later
I just build the attached Rules set.
This is working fine, but the only problem is I cann’t declare specific days
The same Rule with Clock#Time doesn’t work, ór only tiggers only one time.
If this is befóre it is dark, GPIO will not go to 1 anymore.
=>Anyone some advice how to work further on?
(I don't want to work with sunset/sunrise)
Thnx. Thomas