Z-Wave binding and Qubino dimmer with two switches on i1 and i2

Hi,

I just switched from domoticz to openhab2, so I’m fairly new at this. I can’t figure out how to setup rules for the i2 input on a Qubino dimmer (ZMNHDD) with a momentary switch and would greatly appreciate some guidance.

I’ve got one lamp attached to the dimmer module, two physical light switches (mono-stable), one on i1 and one on i2. I’d like to use the second button (i2) to control other lamps using some rules. Has anyone achieved a similar setup and if so how?

Without changing any config params and setting association group 5 (i2 basic on/off) to openhab the i2 input event is interpreted as a 100%/0% dim level on the same dimmer associated with i1 (log snippets below). If I change param 100 to ‘9 - sensor binary’ it’s separated and I can listen to “received update” in the rules and act on that. As the actual switch is momentary it never changes state (“changed” in the rule). If I hold the button pressed for a bit I get a state change ON-OFF, just one normal click always gives OFF so I only get something on “received update”.

The problem with the binary sensor approach is that when the z-wave polling kicks in it also hits the “received update” rule, at that point the rule doesn’t know what the source was (polling or click) so I can’t program around that, or is there a source attribute somewhere?

Any tips would be helpful. An option would be to change the i2 physical switch to an on-off type but I prefer not to as I’ve got 6 other similar setups already attached in the house.

Thanks,
Johan

Log when clicking on i2 (only association group 5 set)

2017-02-27 22:38:22.722 [DEBUG] [WaveSerialHandler$ZWaveReceiveThread] - Receive Message = 01 09 00 04 00 0C 03 20 01 FF 23 
2017-02-27 22:38:22.723 [DEBUG] [ve.internal.protocol.ZWaveController] - Receive queue TAKE: Length=0
2017-02-27 22:38:22.724 [DEBUG] [wave.internal.protocol.SerialMessage] - Assembled message buffer = 01 09 00 04 00 0C 03 20 01 FF 23 
2017-02-27 22:38:22.724 [DEBUG] [ve.internal.protocol.ZWaveController] - Process Message = 01 09 00 04 00 0C 03 20 01 FF 23 
2017-02-27 22:38:22.725 [DEBUG] [ve.internal.protocol.ZWaveController] - Message: class=ApplicationCommandHandler[0x04], type=Request[0x00], priority=High, dest=255, callback=0, payload=00 0C 03 20 01 FF 
2017-02-27 22:38:22.725 [DEBUG] [ssage.ApplicationCommandMessageClass] - NODE 12: Application Command Request (ALIVE:DONE)
2017-02-27 22:38:22.725 [DEBUG] [alization.ZWaveNodeInitStageAdvancer] - NODE 12: Starting initialisation from DONE
2017-02-27 22:38:22.725 [DEBUG] [ve.internal.protocol.ZWaveController] - Event Listener org.openhab.binding.zwave.internal.protocol.initialization.ZWaveNodeInitStageAdvancer@bebae8d already registered
2017-02-27 22:38:22.725 [DEBUG] [ssage.ApplicationCommandMessageClass] - NODE 12: Incoming command class BASIC
2017-02-27 22:38:22.725 [DEBUG] [.commandclass.ZWaveBasicCommandClass] - NODE 12: Received Basic Request
2017-02-27 22:38:22.725 [DEBUG] [.commandclass.ZWaveBasicCommandClass] - NODE 12: Basic Set sent to the controller will be processed as Basic Report
2017-02-27 22:38:22.725 [DEBUG] [.commandclass.ZWaveBasicCommandClass] - NODE 12: Basic report, value = 0xFF
2017-02-27 22:38:22.725 [DEBUG] [ve.internal.protocol.ZWaveController] - Notifying event listeners: ZWaveCommandClassValueEvent
2017-02-27 22:38:22.726 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 12: Got an event from Z-Wave network: ZWaveCommandClassValueEvent
2017-02-27 22:38:22.726 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 12: Got a value event from Z-Wave network, endpoint = 0, command class = BASIC, value = 255
2017-02-27 22:38:22.726 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 12: Updating channel state zwave:device:53ee489e:node12:switch_dimmer to 100 [PercentType]
2017-02-27 22:38:22.726 [DEBUG] [.serialmessage.ZWaveCommandProcessor] - Checking transaction complete: Sent Message: class=SendData[0x13], type=Request[0x00], priority=Get, dest=12, callback=6, payload=0C 03 8E 02 05 
2017-02-27 22:38:22.727 [DEBUG] [.serialmessage.ZWaveCommandProcessor] - Checking transaction complete: Recv Message: class=ApplicationCommandHandler[0x04], type=Request[0x00], priority=High, dest=255, callback=0, payload=00 0C 03 20 01 FF 
2017-02-27 22:38:22.727 [DEBUG] [.serialmessage.ZWaveCommandProcessor] - Checking transaction complete: class=ApplicationCommandHandler, callback id=6, expected=ApplicationCommandHandler, cancelled=false        transaction complete!
2017-02-27 22:38:22.727 [DEBUG] [ve.internal.protocol.ZWaveController] - Notifying event listeners: ZWaveTransactionCompletedEvent
2017-02-27 22:38:22.727 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 12: Got an event from Z-Wave network: ZWaveTransactionCompletedEvent

Log when clicking on i1 (only association group 5 set)

2017-02-27 22:40:30.435 [DEBUG] [WaveSerialHandler$ZWaveReceiveThread] - Receive Message = 01 09 00 04 00 0C 03 26 03 2E F6 
2017-02-27 22:40:30.436 [DEBUG] [ve.internal.protocol.ZWaveController] - Receive queue TAKE: Length=0
2017-02-27 22:40:30.436 [DEBUG] [wave.internal.protocol.SerialMessage] - Assembled message buffer = 01 09 00 04 00 0C 03 26 03 2E F6 
2017-02-27 22:40:30.436 [DEBUG] [ve.internal.protocol.ZWaveController] - Process Message = 01 09 00 04 00 0C 03 26 03 2E F6 
2017-02-27 22:40:30.436 [DEBUG] [ve.internal.protocol.ZWaveController] - Message: class=ApplicationCommandHandler[0x04], type=Request[0x00], priority=High, dest=255, callback=0, payload=00 0C 03 26 03 2E 
2017-02-27 22:40:30.437 [DEBUG] [ssage.ApplicationCommandMessageClass] - NODE 12: Application Command Request (ALIVE:DONE)
2017-02-27 22:40:30.437 [DEBUG] [alization.ZWaveNodeInitStageAdvancer] - NODE 12: Starting initialisation from DONE
2017-02-27 22:40:30.437 [DEBUG] [ve.internal.protocol.ZWaveController] - Event Listener org.openhab.binding.zwave.internal.protocol.initialization.ZWaveNodeInitStageAdvancer@bebae8d already registered
2017-02-27 22:40:30.437 [DEBUG] [ssage.ApplicationCommandMessageClass] - NODE 12: Incoming command class SWITCH_MULTILEVEL
2017-02-27 22:40:30.438 [DEBUG] [ss.ZWaveMultiLevelSwitchCommandClass] - NODE 12: Received SWITCH_MULTILEVEL command V3
2017-02-27 22:40:30.438 [DEBUG] [ss.ZWaveMultiLevelSwitchCommandClass] - NODE 12: Switch Multi Level report, value = 46
2017-02-27 22:40:30.438 [DEBUG] [ve.internal.protocol.ZWaveController] - Notifying event listeners: ZWaveCommandClassValueEvent
2017-02-27 22:40:30.438 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 12: Got an event from Z-Wave network: ZWaveCommandClassValueEvent
2017-02-27 22:40:30.438 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 12: Got a value event from Z-Wave network, endpoint = 0, command class = SWITCH_MULTILEVEL, value = 46
2017-02-27 22:40:30.438 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 12: Updating channel state zwave:device:53ee489e:node12:switch_dimmer to 46 [PercentType]
2017-02-27 22:40:30.439 [DEBUG] [.serialmessage.ZWaveCommandProcessor] - Checking transaction complete: Sent Message: class=SendData[0x13], type=Request[0x00], priority=Get, dest=12, callback=6, payload=0C 03 8E 02 05 
2017-02-27 22:40:30.439 [DEBUG] [.serialmessage.ZWaveCommandProcessor] - Checking transaction complete: Recv Message: class=ApplicationCommandHandler[0x04], type=Request[0x00], priority=High, dest=255, callback=0, payload=00 0C 03 26 03 2E 
2017-02-27 22:40:30.439 [DEBUG] [.serialmessage.ZWaveCommandProcessor] - Checking transaction complete: class=ApplicationCommandHandler, callback id=6, expected=ApplicationCommandHandler, cancelled=false        transaction complete!
2017-02-27 22:40:30.439 [DEBUG] [ve.internal.protocol.ZWaveController] - Notifying event listeners: ZWaveTransactionCompletedEvent
2017-02-27 22:40:30.439 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 12: Got an event from Z-Wave network: ZWaveTransactionCompletedEvent

Note that both i1 and i2 above trigger a state change on zwave:device:53ee489e:node12:switch_dimmer

Log when clicking on i2 (binary sensor setup)

2017-02-27 22:33:25.543 [DEBUG] [WaveSerialHandler$ZWaveReceiveThread] - Receive Message = 01 09 00 04 00 0C 03 30 03 00 CE 
2017-02-27 22:33:25.543 [DEBUG] [ve.internal.protocol.ZWaveController] - Receive queue TAKE: Length=0
2017-02-27 22:33:25.544 [DEBUG] [wave.internal.protocol.SerialMessage] - Assembled message buffer = 01 09 00 04 00 0C 03 30 03 00 CE 
2017-02-27 22:33:25.544 [DEBUG] [ve.internal.protocol.ZWaveController] - Process Message = 01 09 00 04 00 0C 03 30 03 00 CE 
2017-02-27 22:33:25.544 [DEBUG] [ve.internal.protocol.ZWaveController] - Message: class=ApplicationCommandHandler[0x04], type=Request[0x00], priority=High, dest=255, callback=0, payload=00 0C 03 30 03 00 
2017-02-27 22:33:25.544 [DEBUG] [ssage.ApplicationCommandMessageClass] - NODE 12: Application Command Request (ALIVE:DONE)
2017-02-27 22:33:25.544 [DEBUG] [alization.ZWaveNodeInitStageAdvancer] - NODE 12: Starting initialisation from DONE
2017-02-27 22:33:25.545 [DEBUG] [ve.internal.protocol.ZWaveController] - Event Listener org.openhab.binding.zwave.internal.protocol.initialization.ZWaveNodeInitStageAdvancer@bebae8d already registered
2017-02-27 22:33:25.545 [DEBUG] [ssage.ApplicationCommandMessageClass] - NODE 12: Incoming command class SENSOR_BINARY
2017-02-27 22:33:25.545 [DEBUG] [dclass.ZWaveBinarySensorCommandClass] - NODE 12: Received SENSOR_BINARY command V1
2017-02-27 22:33:25.545 [DEBUG] [dclass.ZWaveBinarySensorCommandClass] - NODE 12: Sensor Binary report, type=Unknown, value=0
2017-02-27 22:33:25.545 [DEBUG] [ve.internal.protocol.ZWaveController] - Notifying event listeners: ZWaveBinarySensorValueEvent
2017-02-27 22:33:25.545 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 12: Got an event from Z-Wave network: ZWaveBinarySensorValueEvent
2017-02-27 22:33:25.545 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 12: Got a value event from Z-Wave network, endpoint = 0, command class = SENSOR_BINARY, value = 0
2017-02-27 22:33:25.546 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 12: Updating channel state zwave:device:53ee489e:node12:sensor_binary to OFF [OnOffType]

Not that it’s only set to OFF (with a normal light switch click)

If found a solution by setting the state of the binary sensor back to ON once it’s changed to OFF. That way I always get the “changed to OFF” event triggered on click.

rule "node36 click on I2"
when
  Item node36_sensor_binary changed to OFF
then
  logInfo("rules.main", "It works!");
  // Toggle other lamps here (if lamp is ON turn it OFF, if lamp is OFF turn it ON) 
  sendCommand(node36_sensor_binary, ON);
end

Cheers,
Johan