OpenHAB2 and ZWave switch/dimmer

Hi there!

I recently started “investigating” home automation and openHAB.
I have a Raspberry Pi3 with the Razberry addon, openHAB2 snapshot installed and just 1 ZWave switch - for begin with.
Problem is, that even if the thing linked to the switch seems properly setup (it was discovered and created automatically), I am unable to turn it on, off or read the meter value…
I have to point out that, using z-way-server or openzwave-control-panel, the switch function normally.
So the problem seems to be with openHAB2 configuration…
The switch is node 2 in the zwave network and you can see the thing screenshot below:

items:

Switch Light_Switch "Light Switch" (LightSwitch) {channel="zwave:device:73ed5f0c:node2:switch_dimmer"} 
Number Light_Switch_Watts "Light switch power consumption [%.1f W]" (LightSwitch) {zwave="zwave:device:73ed5f0c:node2:meter_watts"}

in the sitemap I have:

Switch item= Light_Switch
Text item=Light_Switch_Watts

Well, as I said toggling the switch does nothing… Does not turn on the light…
Here are lines from openHAB log (I enabled DEBUG for zwave) and it seems that the message goes through the zwave network…
What should I try next?

13:21:35.511 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'Light_Switch' received command ON
13:21:35.515 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 2: Command received zwave:device:73ed5f0c:node2:switch_dimmer --> ON
13:21:35.518 [DEBUG] [ss.ZWaveMultiLevelSwitchCommandClass] - NODE 2: Creating new message for command SWITCH_MULTILEVEL_SET
13:21:35.521 [DEBUG] [ocol.ZWaveController$ZWaveSendThread] - Took message from queue for sending. Queue length = 0
13:21:35.524 [DEBUG] [ve.internal.protocol.ZWaveController] - Message queued. Queue length = 0. Queue={}
13:21:35.525 [DEBUG] [wave.internal.protocol.SerialMessage] - Assembled message buffer = 01 0A 00 13 02 03 26 01 63 25 21 A7
13:21:35.528 [DEBUG] [ing.zwave.handler.ZWaveSerialHandler] - NODE 2: Sending REQUEST Message = 01 0A 00 13 02 03 26 01 63 25 21 A7
13:21:35.546 [DEBUG] [WaveSerialHandler$ZWaveReceiveThread] - Receive Message = 01 04 01 13 01 E8
13:21:35.559 [INFO ] [marthome.event.ItemStateChangedEvent] - Light_Switch changed from OFF to ON
13:21:35.561 [INFO ] [marthome.event.ItemStateChangedEvent] - zwave_serial_zstick_73ed5f0c_serial_ack changed from 64 to 65
13:21:35.562 [INFO ] [marthome.event.ItemStateChangedEvent] - zwave_serial_zstick_73ed5f0c_serial_sof changed from 109 to 110
13:21:35.570 [DEBUG] [ve.internal.protocol.ZWaveController] - Receive queue TAKE: Length=0
13:21:35.572 [DEBUG] [wave.internal.protocol.SerialMessage] - Assembled message buffer = 01 04 01 13 01 E8
13:21:35.573 [DEBUG] [WaveSerialHandler$ZWaveReceiveThread] - Receive Message = 01 07 00 13 21 00 00 02 C8
13:21:35.578 [DEBUG] [ve.internal.protocol.ZWaveController] - Process Message = 01 04 01 13 01 E8
13:21:35.579 [DEBUG] [ve.internal.protocol.ZWaveController] - Message: class=SendData[0x13], type=Response[0x01], priority=High, dest=255, callback=0, payload=01
13:21:35.580 [DEBUG] [l.serialmessage.SendDataMessageClass] - NODE 2: Sent Data successfully placed on stack.
13:21:35.582 [INFO ] [marthome.event.ItemStateChangedEvent] - zwave_serial_zstick_73ed5f0c_serial_sof changed from 110 to 111
13:21:35.590 [DEBUG] [ve.internal.protocol.ZWaveController] - Receive queue TAKE: Length=0
13:21:35.593 [DEBUG] [wave.internal.protocol.SerialMessage] - Assembled message buffer = 01 09 00 13 21 00 00 02 00 00 C6
13:21:35.595 [DEBUG] [ve.internal.protocol.ZWaveController] - Process Message = 01 09 00 13 21 00 00 02 00 00 C6
13:21:35.596 [DEBUG] [ve.internal.protocol.ZWaveController] - Message: class=SendData[0x13], type=Request[0x00], priority=High, dest=255, callback=0, payload=21 00 00 02
13:21:35.598 [DEBUG] [l.serialmessage.SendDataMessageClass] - NODE 2: SendData Request. CallBack ID = 33, Status = Transmission complete and ACK received(0)
13:21:35.599 [DEBUG] [alization.ZWaveNodeInitStageAdvancer] - NODE 2: Starting initialisation from DONE
13:21:35.610 [DEBUG] [ve.internal.protocol.ZWaveController] - Event Listener org.openhab.binding.zwave.internal.protocol.initialization.ZWaveNodeInitStageAdvancer@c993fa already registered
13:21:35.612 [DEBUG] [.serialmessage.ZWaveCommandProcessor] - Checking transaction complete: Sent Message: class=SendData[0x13], type=Request[0x00], priority=Set, dest=2, callback=33, payload=02 03 26 01 63
13:21:35.613 [DEBUG] [.serialmessage.ZWaveCommandProcessor] - Checking transaction complete: Recv Message: class=SendData[0x13], type=Request[0x00], priority=High, dest=255, callback=0, payload=21 00 00 02
13:21:35.614 [DEBUG] [.serialmessage.ZWaveCommandProcessor] - Checking transaction complete: class=SendData, callback id=33, expected=SendData, cancelled=false        transaction complete!
13:21:35.615 [DEBUG] [ve.internal.protocol.ZWaveController] - Notifying event listeners: ZWaveTransactionCompletedEvent
13:21:35.619 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 2: Got an event from Z-Wave network: ZWaveTransactionCompletedEvent
13:21:35.621 [DEBUG] [ocol.ZWaveController$ZWaveSendThread] - NODE 2: Response processed after 70ms/3000ms.

As I said, the switch doesn’t turn on and of course no reading for the power meter…
From time to time I see some error though…

 class=SendData[0x13], type=Request[0x00], priority=Get, dest=2, callback=41, payload=02 02 26 02
13:26:03.823 [DEBUG] [.serialmessage.ZWaveCommandProcessor] - Checking transaction complete: Recv Message: class=SendData[0x13], type=Request[0x00], priority=High, dest=255, callback=0, payload=29 00 00 03
13:26:03.824 [DEBUG] [.serialmessage.ZWaveCommandProcessor] - Checking transaction complete: class=SendData, callback id=41, expected=ApplicationCommandHandler, cancelled=false      MISMATCH
13:26:08.771 [ERROR] [ocol.ZWaveController$ZWaveSendThread] - NODE 2: Timeout while sending message. Requeueing - 1 attempts left!
13:26:09.286 [ERROR] [l.serialmessage.SendDataMessageClass] - NODE 2: Got an error while sending data. Resending message.
13:26:09.288 [DEBUG] [ve.internal.protocol.ZWaveController] - Message queued. Queue length = 3. Queue={}
13:26:09.291 [DEBUG] [ocol.ZWaveController$ZWaveSendThread] - Took message from queue for sending. Queue length = 2
13:26:09.295 [DEBUG] [wave.internal.protocol.SerialMessage] - Assembled message buffer = 01 09 00 13 02 02 26 02 25 2A CE
13:26:09.299 [DEBUG] [ing.zwave.handler.ZWaveSerialHandler] - NODE 2: Sending REQUEST Message = 01 09 00 13 02 02 26 02 25 2A CE
13:26:09.310 [DEBUG] [WaveSerialHandler$ZWaveReceiveThread] - Receive Message = 01 04 01 13 01 E8
13:26:09.313 [INFO ] [marthome.event.ItemStateChangedEvent] - zwave_serial_zstick_73ed5f0c_serial_ack changed from 71 to 72
13:26:09.320 [INFO ] [marthome.event.ItemStateChangedEvent] - zwave_serial_zstick_73ed5f0c_serial_sof changed from 123 to 124
13:26:09.340 [DEBUG] [ve.internal.protocol.ZWaveController] - Receive queue TAKE: Length=0
13:26:09.342 [DEBUG] [wave.internal.protocol.SerialMessage] - Assembled message buffer = 01 04 01 13 01 E8
13:26:09.343 [DEBUG] [WaveSerialHandler$ZWaveReceiveThread] - Receive Message = 01 07 00 13 2A 00 00 02 C3
13:26:09.345 [DEBUG] [ve.internal.protocol.ZWaveController] - Process Message = 01 04 01 13 01 E8
13:26:09.347 [DEBUG] [ve.internal.protocol.ZWaveController] - Message: class=SendData[0x13], type=Response[0x01], priority=High, dest=255, callback=0, payload=01
13:26:09.347 [INFO ] [marthome.event.ItemStateChangedEvent] - zwave_serial_zstick_73ed5f0c_serial_sof changed from 124 to 125
13:26:09.348 [DEBUG] [l.serialmessage.SendDataMessageClass] - NODE 2: Sent Data successfully placed on stack.
13:26:09.360 [DEBUG] [ve.internal.protocol.ZWaveController] - Receive queue TAKE: Length=0
13:26:09.362 [DEBUG] [wave.internal.protocol.SerialMessage] - Assembled message buffer = 01 09 00 13 2A 00 00 02 00 00 CD
13:26:09.364 [DEBUG] [ve.internal.protocol.ZWaveController] - Process Message = 01 09 00 13 2A 00 00 02 00 00 CD
13:26:09.366 [DEBUG] [ve.internal.protocol.ZWaveController] - Message: class=SendData[0x13], type=Request[0x00], priority=High, dest=255, callback=0, payload=2A 00 00 02
13:26:09.368 [DEBUG] [l.serialmessage.SendDataMessageClass] - NODE 2: SendData Request. CallBack ID = 42, Status = Transmission complete and ACK received(0)
13:26:09.369 [DEBUG] [alization.ZWaveNodeInitStageAdvancer] - NODE 2: Starting initialisation from DONE
13:26:09.370 [DEBUG] [ve.internal.protocol.ZWaveController] - Event Listener org.openhab.binding.zwave.internal.protocol.initialization.ZWaveNodeInitStageAdvancer@c993fa already registered
13:26:09.372 [DEBUG] [.serialmessage.ZWaveCommandProcessor] - Checking transaction complete: Sent Message: class=SendData[0x13], type=Request[0x00], priority=Get, dest=2, callback=42, payload=02 02 26 02
13:26:09.375 [DEBUG] [.serialmessage.ZWaveCommandProcessor] - Checking transaction complete: Recv Message: class=SendData[0x13], type=Request[0x00], priority=High, dest=255, callback=0, payload=2A 00 00 02
13:26:09.376 [DEBUG] [.serialmessage.ZWaveCommandProcessor] - Checking transaction complete: class=SendData, callback id=42, expected=ApplicationCommandHandler, cancelled=false      MISMATCH
13:26:14.321 [ERROR] [ocol.ZWaveController$ZWaveSendThread] - NODE 2: Timeout while sending message. Requeueing - 0 attempts left!
13:26:14.323 [ERROR] [l.serialmessage.SendDataMessageClass] - NODE 2: Got an error while sending data. Resending message.
13:26:14.324 [DEBUG] [ve.internal.protocol.ZWaveController] - Message queued. Queue length = 3. Queue={}
13:26:14.325 [DEBUG] [ocol.ZWaveController$ZWaveSendThread] - Took message from queue for sending. Queue length = 2
13:26:14.328 [DEBUG] [wave.internal.protocol.SerialMessage] - Assembled message buffer = 01 09 00 13 02 02 26 02 25 2B CF
13:26:14.331 [DEBUG] [ing.zwave.handler.ZWaveSerialHandler] - NODE 2: Sending REQUEST Message = 01 09 00 13 02 02 26 02 25 2B CF
13:26:14.343 [DEBUG] [WaveSerialHandler$ZWaveReceiveThread] - Receive Message = 01 04 01 13 01 E8
13:26:14.352 [INFO ] [marthome.event.ItemStateChangedEvent] - zwave_serial_zstick_73ed5f0c_serial_ack changed from 72 to 73
13:26:14.359 [INFO ] [marthome.event.ItemStateChangedEvent] - zwave_serial_zstick_73ed5f0c_serial_sof changed from 125 to 126
13:26:14.371 [DEBUG] [ve.internal.protocol.ZWaveController] - Receive queue TAKE: Length=0
13:26:14.373 [DEBUG] [wave.internal.protocol.SerialMessage] - Assembled message buffer = 01 04 01 13 01 E8
13:26:14.378 [INFO ] [marthome.event.ItemStateChangedEvent] - zwave_serial_zstick_73ed5f0c_serial_sof changed from 126 to 127
13:26:14.378 [DEBUG] [ve.internal.protocol.ZWaveController] - Process Message = 01 04 01 13 01 E8
13:26:14.376 [DEBUG] [WaveSerialHandler$ZWaveReceiveThread] - Receive Message = 01 07 00 13 2B 00 00 02 C2
13:26:14.380 [DEBUG] [ve.internal.protocol.ZWaveController] - Message: class=SendData[0x13], type=Response[0x01], priority=High, dest=255, callback=0, payload=01
13:26:14.382 [DEBUG] [l.serialmessage.SendDataMessageClass] - NODE 2: Sent Data successfully placed on stack.
13:26:14.401 [DEBUG] [ve.internal.protocol.ZWaveController] - Receive queue TAKE: Length=0
13:26:14.405 [DEBUG] [wave.internal.protocol.SerialMessage] - Assembled message buffer = 01 09 00 13 2B 00 00 02 00 00 CC
13:26:14.408 [DEBUG] [ve.internal.protocol.ZWaveController] - Process Message = 01 09 00 13 2B 00 00 02 00 00 CC
13:26:14.411 [DEBUG] [ve.internal.protocol.ZWaveController] - Message: class=SendData[0x13], type=Request[0x00], priority=High, dest=255, callback=0, payload=2B 00 00 02
13:26:14.414 [DEBUG] [l.serialmessage.SendDataMessageClass] - NODE 2: SendData Request. CallBack ID = 43, Status = Transmission complete and ACK received(0)
13:26:14.417 [DEBUG] [alization.ZWaveNodeInitStageAdvancer] - NODE 2: Starting initialisation from DONE
13:26:14.418 [DEBUG] [ve.internal.protocol.ZWaveController] - Event Listener org.openhab.binding.zwave.internal.protocol.initialization.ZWaveNodeInitStageAdvancer@c993fa already registered
13:26:14.422 [DEBUG] [.serialmessage.ZWaveCommandProcessor] - Checking transaction complete: Sent Message: class=SendData[0x13], type=Request[0x00], priority=Get, dest=2, callback=43, payload=02 02 26 02
13:26:14.426 [DEBUG] [.serialmessage.ZWaveCommandProcessor] - Checking transaction complete: Recv Message: class=SendData[0x13], type=Request[0x00], priority=High, dest=255, callback=0, payload=2B 00 00 02
13:26:14.428 [DEBUG] [.serialmessage.ZWaveCommandProcessor] - Checking transaction complete: class=SendData, callback id=43, expected=ApplicationCommandHandler, cancelled=false      MISMATCH

Hi,

I guess your item definition is the problem. The Switch should be defined like this

Switch Switch_Living "Schaltsteckdose [%s]" <switch> (Living, Switch) {zwave="2:command=switch_binary"}

The metering items should look like

Number Switch_Living_Watt "Leistung aktuell [%d W]" <poweroutlet> (Living, Switch) {zwave="2:command=meter,meter_scale=E_W"}
Number Switch_Living_KWh  "Energieverbrauch [%.3f KWh]" <poweroutlet> (Living, Switch) {zwave="2:command=meter,meter_scale=E_KWh"}

Cheers
Christian

Almost, but he is using openHAB2, so the textual definition is different.

Try

Switch Light_Switch "Light Switch" (LightSwitch) {channel="zwave:device:73ed5f0c:node2:switch_binary"} 
Number Light_Switch_Watts "Light switch power consumption [%.1f W]" (LightSwitch) {channel="zwave:device:73ed5f0c:node2:meter_watts"}

The config i posted is working for me with OH2

Okay … are you using the 1.x binding version of zwave?

NO, I use binding-zwave - 2.0.0.SNAPSHOT form the online snapshot distro

Allright. Then my previous understanding from how this all works together is screwed up now … :joy:

Sorry :blush:

From looking into the database that device supports multilevel, so another try could be:

Switch Light_Switch "Light Switch" (LightSwitch) {channel="zwave:device:73ed5f0c:node2:switch_multilevel"}

Thank guys for your prompt replies…
No luck with either definitions…
I put them all in my items file:

Group LightSwitch
Switch Light_Switch "Light Switch" (LightSwitch) {channel="zwave:device:73ed5f0c:node2:switch_binary"} 
Number Light_Switch_Watts "Light switch power consumption [%.1f W]" (LightSwitch) {channel="zwave:device:73ed5f0c:node2:meter_watts"}
Switch Switch_Living "Schaltsteckdose [%s]" <switch> (LightSwitch) {zwave="2:command=switch_binary"}
Number Switch_Living_Watt "Leistung aktuell [%d W]" <poweroutlet> (LightSwitch) {zwave="2:command=meter,meter_scale=E_W"}
Number Switch_Living_KWh  "Energieverbrauch [%.3f KWh]" <poweroutlet> (LightSwitch) {zwave="2:command=meter,meter_scale=E_KWh"}
 Switch Light_Switch2 "Light Switch2" (LightSwitch) {channel="zwave:device:73ed5f0c:node2:switch_multilevel"}

and sitemaps is simple:

Group item=LightSwitch

none of them works :grinning:
With the OH1 style binding is doesn’t send command through zwave network and for the others here is the log:

14:12:25.776 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 2: Command received zwave:device:73ed5f0c:node2:switch_binary --> ON
14:12:25.778 [WARN ] [ding.zwave.handler.ZWaveThingHandler] - NODE 2: Command for unknown channel zwave:device:73ed5f0c:node2:switch_binary with OnOffType
14:12:25.797 [INFO ] [marthome.event.ItemStateChangedEvent] - Light_Switch changed from OFF to ON
14:12:30.814 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'Switch_Living' received command ON
14:12:30.843 [INFO ] [marthome.event.ItemStateChangedEvent] - Switch_Living changed from OFF to ON
14:12:34.685 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'Light_Switch2' received command OFF
14:12:34.687 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 2: Command received zwave:device:73ed5f0c:node2:switch_multilevel --> OFF
14:12:34.695 [WARN ] [ding.zwave.handler.ZWaveThingHandler] - NODE 2: Command for unknown channel zwave:device:73ed5f0c:node2:switch_multilevel with OnOffType
14:12:34.705 [INFO ] [marthome.event.ItemStateChangedEvent] - Light_Switch2 changed from ON to OFF
14:12:37.819 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'Light_Switch2' received command ON
14:12:37.822 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 2: Command received zwave:device:73ed5f0c:node2:switch_multilevel --> ON
14:12:37.822 [WARN ] [ding.zwave.handler.ZWaveThingHandler] - NODE 2: Command for unknown channel zwave:device:73ed5f0c:node2:switch_multilevel with OnOffType
14:12:37.833 [INFO ] [marthome.event.ItemStateChangedEvent] - Light_Switch2 changed from OFF to ON

Unfortunately I have no idea what the problem is. Let’s what for Chris Jackson who is maintaining the binding. Probably he has a idea what to do.

Well… I sorted it… somehow…
Instead of running openHAB’s own zwave binding I installed Z-Way Binding and it’s working smoothly

OK, now I understand your problem.

It seems you installed Z-Way before and kept it running? I have a RaZberry as well and I first installed the Z-Way from z-wave.me. After that I had to terminate the Z-Way server, to have OH2 with the own z-wave binding working properly. Another try was to run the board without previous installation of Z-Way and this doesn’t work for me. So my current config is Z-Way installed and switched off and then Openhab installed with the “native” zwave binding. Your solution is new for me but if it works properly i will keep this in mind.

No, not at all.
z-way-server was disabled when I was running openhab with its z-wave binding.
Now, of course, they are running in parallel and I uninstalled openhab’s z-wave binding.