MQTT Binding doesn`t recognise float values anymore

  • Platform information:

    • Hardware: Intel Xeon E3-1230 v3 @ 3.30GHz/24GB/6TB
    • OS: Debian 10
    • Java Runtime Environment: openjdk 11.0.11
    • openHAB version: 3.1.0
  • Issue of the topic:
    A few days ago I noticed that my temperatures weren’t shown anymore. In the logfiles I saw that the payload isn’t supported, but I didn’t change anything and I can’t get it going again. It worked before flawlessly. I for sure updated some things on the system but I dont’t think it’s related to my problem.

  • Log file:

[WARN ] [ab.binding.mqtt.generic.ChannelState] - Incoming payload ' 36.7' not supported by type 'NumberValue'
  • Items File:
Number kitchen_temp "Temperatur [%.1f °C]" {homekit="TemperatureSensor", channel="mqtt:topic:broker:kitchen:kitchen_temp"}
  • Things File:
Thing topic kitchen {
    Channels:
        Type number : kitchen_temp [stateTopic="kitchen/temperature"]
    }

I would appreciate your help, Thanks!

Floats via MQTT are working for me right now. A couple of things:

The recommended distribution for OH is Zulu, not openjdk.

Your payload has a space at the start of the string/number. Is this new?

1 Like

Thanks for the reply. It worked with openjdk, it shouldn’t be the problem.
It’s the space that causes the error. Althou it worked until now, and I did not change anything neither in OH nor the code from my esp8266 devices. Now I have to find why there is a space in the payload, it seems that only float variables are beeing published with a space infront.

Problem solved. The space comes from a dtostrf() in the esp8266 code. Apparently it didn’t do any harm on older versions of OH.