Hello all, I’m trying to control my GE 12724 dimmer based on input from the dimmer itself, rather than a web interface or other command. Basically, I would like to have the dimmer go up to full power during the day, but only up to about 20% at night. I have the dimmer in my master bathroom, so the idea is that if I wake up in the middle of the night, I only need minimal lighting.
I’ve seen some example rules that use the “received command” event, but that only appears to work (i.e., that event is only triggered) in response to sending a command or the web interface. So I tried the following rules (testing, so I didn’t include code for the time-of-day changes):
rule “MBR Lights On”
when
Item sMBRLight received update ON
then
sendCommand(diMBRLight, 100)
end
rule “MBR Lights Off”
when
Item sMBRLight received update OFF
then
sendCommand(diMBRLight, 0)
end
In practice, these rules resulted in the dimmer going straight to 100% rather than ramping up (fine by me, and I can add a delay loop to make it ramp if I choose). But the rule has also prevented the dimmer from shutting off. It appears that when I press the off button, the switch updates the dimmer value but again updates its status to ON. And from the logs, it looks like the switch is never updated to OFF:
2016-01-07 16:50:09 - diMBRLight state updated to 0
2016-01-07 16:50:09 - diMBRLight received command 0
2016-01-07 16:50:09 - diMBRLight state updated to 0
2016-01-07 16:50:12 - sMBRLight state updated to OFF
2016-01-07 16:50:12 - diMBRLight state updated to 0
2016-01-07 16:50:12 - diMBRLight received command 0
2016-01-07 16:50:12 - diMBRLight state updated to 0
2016-01-07 17:27:23 - sMBRLight state updated to ON
2016-01-07 17:27:23 - diMBRLight state updated to 90
2016-01-07 17:27:27 - sMBRLight state updated to ON
2016-01-07 17:27:27 - diMBRLight state updated to 2
2016-01-07 17:30:07 - sMBRLight state updated to ON
2016-01-07 17:30:07 - diMBRLight state updated to 90
2016-01-07 17:30:12 - sMBRLight state updated to ON
2016-01-07 17:30:12 - diMBRLight state updated to 20
Also, here are my item definitions:
Switch sMBRLight “MBR Light:” { zwave=“12:command=SWITCH_MULTILEVEL” }
Dimmer diMBRLight “MBR Dimmer: [%d %%]” { zwave=“12:command=SWITCH_MULTILEVEL” }
Are there any events that I can capture that will allow me to have the OFF rule work properly?