I have the following situation : a room with a push button for light, and a motion sensor. This motion sensor keeps the light on for X minutes, and only does so when it's dark outside
I was wondering, how to implement that :
- You turn on the light with 1 click on the push button (normal behavior)
- You turn off the light with 1 click on the same push button regardless how the light was switched on.
That means that if the motion sensor switched on the light, single click on the button now should:
- disable the sensor
- switch off the light
In other words, a click on the button always switches the state of the light
Seems straightforward, but I don't know how the GUI logic is translated into code and I notice that attaching an input to do both at the same time, doesn't seem to work.
The setup is :
INPUT => Tr on push button to light + R on timer for motion sensor + Dis on motion sensor
Light goes off but comes on again straight away...
I hope I am making any sense, or at least enough to get some ideas :-)
Thanks!
Kommentar