Thermostat Controll via MQTT

Hello everybody, I’ve been using Openhab for 3 years now and thanks to this forum I could resolve all my issues I had until now.
I am using Openhab to control all the lights, the heating system, some sound systems and a lot of other stuff in my house. Therefore I mainly use mqtt and zigbee2mqtt and of course some bindings.

  • Platform information:
    • Hardware: raspberry pi 3b
    • OS: Openhabian
    • openHAB version: 2.4

Currently I am trying to control a thermostat for my new installed electric floor heating. I am using following product:

The controller is sucessfully connected to zigbee2mqtt and I already can control it via mqtt.fx - everything fine until now.

I also can read the set values for the thermostat, e.g. current_heating_setpoint

The problem i have right know is to control these values, e.g. to change the current_heating_setpoint

Therefore I need to publish {“current_heating_setpoint”: VALUE}
I am still using the old 1.0 mqtt binding (the plan is to change to the new one, but therefore I need some time which I don’t have at the moment.

I have the following item definition, which is working for the incoming values

Number Fussbodenheizung_Gaestehaus_Setpoint "Fußbodenheizung" {mqtt="<[broker:zigbee2mqtt/Fussbodenheizung_Gaestehaus:state:JSONPATH($.current_heating_setpoint)]"} 

Unfortunately I have no idea how I can control these values as I need to publish {“current_heating_setpoint”: VALUE}

I can easily just send the value via:

Number Fussbodenheizung_Gaestehaus_Setpoint "Fußbodenheizung" {mqtt=">[broker:zigbee2mqtt/Fussbodenheizung_Gaestehaus/set:command*:default"}

But this will only send the Value and is of course not accepted by the thermostat.

Can somebody help me out on this issue?

Thanks a lot
BR, Sebastian

The v1 binding is very old, so you may not get much help with that aspect.

However, a workaround might be to set zigbee2mqtt so it publishes and receives values, rather than JSON strings. See below for a start:

Then you can just send the value, as in your last example.

Thanks for the fast reply.

I have in my mind to change to new mqtt binding for a long time now. But never found the time to do it.

Thanks for your workaround, but I think this will affect all my zigbee2mqtt item. Which means i need to adopt all of them, am I right?

I think there would be a workaround with a rule as well, but at the moment I want to avoid this and find a solution directly on the item.

BR, Sebastian

Correct.

When you do, check this page out:

example

You’d probably use an interim String Item to do the sending when your existing Number Itemis commanded.