Hi..
Could you explain how the single/double on/off function is supposed to work - I'm a bit confused by it.. maybe it's just me ;-)
If a have a light that is on (triggered by a motion sensor) and i send a single off for that light, it turns off and then immediately back on again. If i send a double off it turns off and stays off until the motion sensor turns it on again when it detects movement.
Is this how it is supposed to work? If so then what is the single off used for ?
The way i would like this to work is:
1. Single off - turn off the light, but allow the motion sensor to turn it back on (after a short delay to allow you to exit the area).
2. Double off - turn off the light and ignore the motion sensor, so that the light wont turn on again until a single on is received (which would enable the motion sensor again).
3. Single on - turn the light on and start the timer so that the light turns off automatically (during the day). This also re-enable the motion sensor if it's disabled.
4. Have a double on turn the light on leave it on - no timer (during the day).
Hopefully this makes sense...
Rich
This is a large update to Gene's Smart Lights C# code. This code will control a module with a motion sensor. If the controlled module is a light (on/off light) or dimmer (dimmable light), it can also be optionally controlled by a wall switch transmitter. If the module is a siren, it will treat it as a notification chime.
Day/night is handled via jkUtils though Weather Underground is possible too with minimal modifications to the code.
There is an option for triggering the timer when motion is initially detected (on received) or after motion has stopped (off received).
The wall switch control has an advanced functionality beyond simply turning on and off the light module. If a double on is received, it will turn the light on and enable the timer. If a double off is received with the timer running, it will override and turn off the light immediately. If a single off is received and the timer is on, it will not turn the light off. In order to use this advanced switch control, it's also necessary to add the Last Event code. This will allow HG to properly track duplicated on or off commands which is not possible by default.
The final code that is available is a stuck module check. This is useful if you have a module that does not transmit properly every time or, more likely, the signal is not received consistently. In this case, the stuck module check code will use a timer to turn the module off after a user specified timeout period.
I've spent a lot of time debugging, so hopefully everything works 100%. If bugs are located, please let me know. Enjoy!