Openhab2 MQTT - switch item not updating

I’ve got a zwave based switch that I can’t get to update in basic ui.
I’ve also got a zwave sensor that seems to be quite happy getting it’s values via mqtt (they come from another openhab system)

Here’s my switch item

Switch zwave_switch_welcome "Welcome Home Lights" <light> (g_zwave,g_zwave_switch_welcome) {mqtt=">[openhabian:openhab/in/zwave_device_15a9b1f6ad6_node3_switch_binary1/command:command:ON:ON],>[openhabian:openhab/in/zwave_device_15a9b1f6ad6_node3_switch_binary1/command:command:OFF:OFF],<[openhabian:openhab/out/zwave_device_15a9b1f6ad6_node3_switch_binary1/state:state:default]"}

I’ve tried without the output commands.
Here’s the sitemap item:
Switch item=g_zwave_switch_welcome label="Welcome Lights"

There’s nothing different here from my OH1 system.
But when I put an update to turn the lights on the gui item doesn’t udpate…and with the output commands all I see on this OH2 system is a log error.

2017-03-10 22:32:06.377 [WARN ] [thome.io.rest.core.item.ItemResource] - Received HTTP POST request at 'items/g_zwave_switch_welcome' with an invalid status value 'ON'.
2017-03-10 22:32:17.209 [WARN ] [thome.io.rest.core.item.ItemResource] - Received HTTP POST request at 'items/g_zwave_switch_welcome' with an invalid status value 'OFF'.

Any ideas?

There are zwave switches that can also talk MQTT? Or are you using MQTT messages to cause OH to send a command to a zwave device?

When debugging problems like this work backwards.

  1. The UI isn’t upgrading so look to see the Item is being updated in events.log
  2. Events.log is not showing updates so see if the message is being sent using mosquitto_sub or some other independent MQTT client.
  3. If no MQTT messages are sent you need to debug the sender.

If you see the events at 1 you know OH is receiving the events and processing them and know the problem lies in the UI.

If you are at 2 you know that OH is not receiving the events so the problem is either:

  • mqtt.cfg is not correct (you can eliminate that if your other MQTT Items are working)
  • the mqtt binding config on the Item is incorrect (wrong topic, wrong broker name, etc)
  • the data published on the topic cannot be parsed into the Item’s state (e.g. invalid number formats, lower case for ON/OFF, etc).

If you are at 3 the problem lies outside of OH.

The error logs are interesting. they imply the message is received but it can’t apply the value to the Item’s state. ON and OFF should be fine though so I’m not sure what it could be.

Taking about zwave is probably just confusing the issue.

I’m using the mqtt event bus between two openHAB systems (technically now 3 as I’m building a oh2 system on the 3rd one/ the one where the ui items aren’t working).

I’ve subscribed on the source machine and dest machine to the mqtt topic and can see traffic. So my issue it would seem is getting the mqtt message that’s been received into openHAB. I’ll look at the events log. And then figure out mqtt logging in oh2

Ok so I tailed the events.log and can see on my new oh2 system that it’s getting the value from mqtt.

So I’m it’s a UI issue as it doesn’t seem to update the item.

How can I diagnose that?

There are limited things you can do. Are you running a version before the Release or 2.10 Snapshot? There may be a bug in BasicUI. Beyond that, I don’t know what you can do. I haven’t seen many reports of people not getting updates with Basic UI in the Release version.

You can try one of the other UIs and see if they fail to update. That would narrow the problem down to being Basic UI itself or with the REST API.

I don’t really use the UIs for much so I’ve little experience with trouble shooting them. But from what I know they either work or they have a bug which you can’t fix through configurations.