I am after some help with creating a macro or other solution to control a light from a light switch as well as automatically from sensors. Sounds more simple than it is as I'll try to explain.
Automatic light control defined by light level sensor, time of day, presence and timer.
Manual input from digital switch.
The automatic side works fine, someone enters, its dark, the right time of day the light turns on. They leave and presence removed, light goes off.
Now to explain what I am trying to do with the manual input from the switch. Basically it should be able to override the current light state regardless of other conditions. So if the light is off and the switch operated the light should come on (regardless of time of day or light level). If the light is on then it can be turned off immediately by pressing the button. However, if the light is left on then the automated presence removal should turn it off after the timer period.
Now the main problem I have is the macro functionality doesn't allow for state interrogation or extended logic. So I can't do something like.... if light is off then turn on...
I have made some progress by using two macros; one to switch light on, one to turn light off, both macros are always running and registered against the light condition change. The continuing problem is that when the light conditions would normally have the light off and it is manually turned on the override flag is set and doesn't get reset. Therefore, automatic control no longer works (lights will turn on even when they should be off due to time of day or light level when presence is detected)
Paul
Automatic light control defined by light level sensor, time of day, presence and timer.
Manual input from digital switch.
The automatic side works fine, someone enters, its dark, the right time of day the light turns on. They leave and presence removed, light goes off.
Now to explain what I am trying to do with the manual input from the switch. Basically it should be able to override the current light state regardless of other conditions. So if the light is off and the switch operated the light should come on (regardless of time of day or light level). If the light is on then it can be turned off immediately by pressing the button. However, if the light is left on then the automated presence removal should turn it off after the timer period.
Now the main problem I have is the macro functionality doesn't allow for state interrogation or extended logic. So I can't do something like.... if light is off then turn on...
I have made some progress by using two macros; one to switch light on, one to turn light off, both macros are always running and registered against the light condition change. The continuing problem is that when the light conditions would normally have the light off and it is manually turned on the override flag is set and doesn't get reset. Therefore, automatic control no longer works (lights will turn on even when they should be off due to time of day or light level when presence is detected)
Paul
Comment