i dont know if it is a problem with openhab 2.5.1 ore the mqttv2 binding, but i have seen now that the mqtt message has now 5 dezimals, one month ago it was only 2.
Now i cant control my thermostat’s, i have nothing changed since months in the config, it was working before.
Here is my setup:
Thing:
Thing topic Popp_thermostat_FF_Bed "Thermostat Schlafzimmer" @ "Schlafzimmer" {
Channels:
Type number : temperature "Temperature" [ stateTopic="zwave2mqtt/Schlafzimmer/Thermostat_Schlafzimmer/thermostat_setpoint/heating_1", transformationPattern="JSONPATH:$.value", commandTopic="zwave2mqtt/Schlafzimmer/Thermostat_Schlafzimmer/thermostat_setpoint/heating_1/set", min=4, max=28, step=0.5]
Type number : battery "Battery Charge" [ stateTopic="zwave2mqtt/Schlafzimmer/Thermostat_Schlafzimmer/battery/battery_level", transformationPattern="JSONPATH:$.value" ]
}
Item:
Number Thermostat_FF_Bed_Set "Heizkörper [%.1f \u00B0C]" <heating> (FF_Bed, Heating) {channel="mqtt:topic:mosquitto:Popp_thermostat_FF_Bed:temperature"}
Perhaps you only needed to restart OH a few times for everything to work correctly. I restarted 3 time plus one reboot before all was good after update from 2.4 stable. Anyway, glad you have it working and please click square box with solution to mark topic as solved.
it is solved for me now, but i cant go to the latest version (2.5.1).
that’s a shame because I don’t get to the last versions of the bindings if this problem stay.
maybe its a bug in OH 2.5.1, because it is defined in the sitemap that it should increase in 0.5 steps, but this does not happen.
I’m sure I saw some changes in github at least partly related to this … from memory, folk were getting “7E1” payloads instead of “70”. This is in the same area, so I think it may be worth trying the most recent snapshot.
As @rossko57 mentioned you can try the recent snapshot. For an apt based install here is the commands (per the docs) to move from version to version.
Apt Based Systems
Upgrading is as easy as:
sudo apt-get update
sudo apt-get upgrade
You may want to switch to a different repo, or an older (but more stable) version of openHAB. To do this, simply select the repo as in the installation instructions above, then find the version by bringing a list of all versions available to install:
sudo apt-get update
apt-cache showpkg openhab2
Once you know which version you want, you can upgrade/downgrade to it by using the apt-get install openhab2=[version] command, for example:
sudo apt-get install openhab2=2.1.0-1
When you run the showpkg command, like above, you should have a full list to choose from. Pick the one you want and enter it like described in the last command.
i have tried to tranform the output with formatBeforePublish="%.1f" :
Type number : temperature "Temperature" [ stateTopic="zwave2mqtt/Schlafzimmer/Thermostat_Schlafzimmer/thermostat_setpoint/heating_1", transformationPattern="JSONPATH:$.value", commandTopic="zwave2mqtt/Schlafzimmer/Thermostat_Schlafzimmer/thermostat_setpoint/heating_1/set", formatBeforePublish="%.1f"]
than i get the value 20,5, but i need a 20.5, with a point instead of a comma .
@David_Graeff can you help me, is something changed this way since 2.5.0 in the mqtt binding?
Type number : temperature "Temperature" [ stateTopic="zwave2mqtt/Schlafzimmer/Thermostat_Schlafzimmer/thermostat_setpoint/heating_1", transformationPattern="JSONPATH:$.value", commandTopic="zwave2mqtt/Schlafzimmer/Thermostat_Schlafzimmer/thermostat_setpoint/heating_1/set", transformationPattern="JSONPATH:$.value", formatBeforePublish="{\"value\":%.1f}" ]
Try it with transformationPatternOut and see if that makes a difference.
Type number : temperature "Temperature" [ stateTopic="zwave2mqtt/Schlafzimmer/Thermostat_Schlafzimmer/thermostat_setpoint/heating_1", transformationPattern="JSONPATH:$.value", commandTopic="zwave2mqtt/Schlafzimmer/Thermostat_Schlafzimmer/thermostat_setpoint/heating_1/set", transformationPattern="JSONPATH:$.value", transformationPatternOut="{\"value\":%.1f}" ]
You may want to try transformationPatternOut with your original config as well.
Type number : temperature "Temperature" [ stateTopic="zwave2mqtt/Schlafzimmer/Thermostat_Schlafzimmer/thermostat_setpoint/heating_1", transformationPattern="JSONPATH:$.value", commandTopic="zwave2mqtt/Schlafzimmer/Thermostat_Schlafzimmer/thermostat_setpoint/heating_1/set", transformationPatternOut="%.1f" ]
Type number : temperature "Temperature" [ stateTopic="zwave2mqtt/Schlafzimmer/Thermostat_Schlafzimmer/thermostat_setpoint/heating_1", transformationPattern="JSONPATH:$.value", commandTopic="zwave2mqtt/Schlafzimmer/Thermostat_Schlafzimmer/thermostat_setpoint/heating_1/set", transformationPatternOut="%d" ]
Mqtt has not changed. The local for the system is taken into account for decimal value parsing and output (english local: “.”, german local “,” for example). That’s not ideal, but internally the standard java API is used which is local aware.
Either use a javascript script, or a second transformation (regex) to replace commas into dots, would be my advice. Maybe someone else has a smarter idea.