Control Z-Wave item via mqtt

Hi,

I need some Help. Basically, I want to control an Z-Wave Thermostat via MQTT and via Habpanel.

So I created a Thing for the Z-Wave Thermostat and the MQTT Topic and added channels. I then created an Item that is linked to the Channel oft the Z-Wave Thermostat. To Habpanel I added a Slider that controls the Temperature of the Item and therefore of the Channel. That works just fine. It works in both directions. When I change the slider, the Temperature on the Thermostat changes as well. When I change the Temperature on the Thermostat via Hand, it changes in the Item and the Slider.

Not I want to change the Temperature via MQTT. So I added the channel from the MQTT Thing to the Item with the Temperature. When I send a Number via MQTT, the Item changes, as well as the slider. But not on the Thermostat. As soon as the Thermostat wakes up, it pushes It current (old) Temperature setting to openhab. Example:

The item in OpenHab says 20°C
The Thermostat Display says 20°C

Now I send 22°C via MQTT
The item in OpenHab changes to 22°C
The Thermostat Display says 20°C and wont change.

After 300 Second (when the Thermostat wakes up) it changes the OpenHab Item back to 20°C

Does anybody know why it won’t accept the Temperature via MQTT ? When I set it with the Slider or use Alexa, it works just fine. Also, I want to read the Current Temperature that is set via MQTT

I hope somebody can help.
Thanks in advance
regards JD

Look in your events.log. What command is sent to what Item?
Then you need to replicate that from MQTT.

Yes, it is never actually sent to zwave. The zwave binding acts on commands.

That ordinarily causes an Item state update, as you observed.
State updates are not commands.
So you need to enable the special feature on your MQTT channel for post command, this will make incoming messages be treated as command instead of updates.

Do you mean you want to publish the zwave sensor reading to MQTT?
Obviously we’re talking about a different Item and zwave and MQTT channels here.
But it’s the same issue, if you want the MQTT binding to act on an incoming message from zwave, you need to turn it into a command.
But the zwave binding has no feature to do that.

What you can do instead is to apply a follow profile to the link from Item to MQTT channel.
This does a bit of magic, when the Item is updated (by zwave) this profile sends it to MQTT channel as though it were really a command.

Thanks, I changed the Setting in the MQTT channel and now it’s working fine. I did not know that a change to an Item is not treated like a command. I thought I would just update all connected channels.

The read back worked just fine with the “follow profile”.

I’m also amazed how active and helpful this Community is.

Thanks again.
Regards JD

Very deliberately designed not to do that, or virtually every link to a device would turn into a everlasting loop. Grasping the difference between command “instruction, do this” and state “status, it is like this” is important to get anywhere with openHAB.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.