Getting MQTT inbound values displayed on a sitemap

I finally got my MQTT binding working on OH2 after a complete reinstall (apt-get purge openhab2; apt-get install openhab2)

The mosquitto broker runs flawlessly since about a year now.

I checked the correct working of the binding with the tutorial example of a simple switch. I can send commands to the broker and I can receive states from the broker.

If I try to read the temperature values from my heating installation available at the broker something goes wrong. Here is my items description:

$ cat items/heizung.items
Number T_Heizung_Vorl    "Heizung Vorlauf [%.1f]C"   <temperature>      {mqtt="<[broker:heim/hzg1w/T_Heizung_Vorl:state:default]"}
Number T_Heizung_Rueckl  "Heizung Rucklauf [%.1f]C"   <temperature>  {mqtt="<[broker:heim/hzg1w/T_Heizung_Rueckl:state:default]"}
Number T_Zirkulation     "Zirkulation [%.1f]C"   <temperature>  {mqtt="<[broker:heim/hzg1w/T_Zirkulation:state:default]"}
Number T_Warmwasser_Ausl "Warmwasser Auslauf [%.1f]C"   <temperature>  {mqtt="<[broker:heim/hzg1w/T_Warmwasser_Ausl:state:default]"}
Number T_Warmwasser_Zul  "Warmwasser Zulauf [%.1f]C"   <temperature>  {mqtt="<[broker:heim/hzg1w/T_Warmwasser_Zul:state:default]"}

The simple sitemap:

$ cat sitemaps/default.sitemap
sitemap default label="My first sitemap"
    Text   item=T_Heizung_Vorl
    Text   item=T_Heizung_Rueckl
    Text   item=T_Warmwasser_Zul
    Text   item=T_Warmwasser_Ausl
    Text   item=T_Zirkulation

If I look on the sitemap in basicUI none of the items shows a number at all
(sorry, I cannot find how to upload screen shots. You just have to believe me)

Could someone please give me hint


Is your mqtt broker actually called “broker”? If it isn’t then replace broker with the actual name. Other issues could be in the mqqt config files where your account and password would be found and somewhere there is a client ID that has to be unique. Failing that there seem to be other possible issues with extracting numbers from text strings, depending how your broker is storing the data?

You\re not the only one struggling here as I can’t get simple stuff to work properly either!

Thanks for the hints.

Yes, I called the broker actually broker in the openhab2

$ grep -v '#' /etc/openhab2/services/mqtt.cfg | grep -v '^$'

If I start the mosquitto broker with full verbosity it tells me that openhab2 successfully subscribes to my topics and that mosquitto publishes the topics to openhab2.

If I look at the openhab2 event log it also shows a lot of state changes for my items:

$ tail -50 /var/log/openhab2/events.log | grep T_
2017-03-23 23:03:08.861 [ItemStateChangedEvent     ] - T_Heizung_Vorl changed from 28.0 to 28.1
2017-03-23 23:04:09.262 [ItemStateChangedEvent     ] - T_Heizung_Vorl changed from 28.1 to 28.0
2017-03-23 23:04:09.311 [ItemStateChangedEvent     ] - T_Warmwasser_Ausl changed from 34.0 to 34.2
2017-03-23 23:04:09.358 [ItemStateChangedEvent     ] - T_Zirkulation changed from 25.5 to 25.4
2017-03-23 23:05:08.620 [ItemStateChangedEvent     ] - T_Warmwasser_Zul changed from 41.8 to 41.7
2017-03-23 23:05:08.703 [ItemStateChangedEvent     ] - T_Warmwasser_Ausl changed from 34.2 to 34.1
2017-03-23 23:08:08.907 [ItemStateChangedEvent     ] - T_Warmwasser_Ausl changed from 34.1 to 34.0
2017-03-23 23:09:09.313 [ItemStateChangedEvent     ] - T_Warmwasser_Ausl changed from 34.0 to 33.9
2017-03-23 23:09:09.351 [ItemStateChangedEvent     ] - T_Zirkulation changed from 25.4 to 25.3
2017-03-23 23:10:08.722 [ItemStateChangedEvent     ] - T_Warmwasser_Ausl changed from 33.9 to 33.8
2017-03-23 23:10:08.753 [ItemStateChangedEvent     ] - T_Zirkulation changed from 25.3 to 25.4
2017-03-23 23:11:09.131 [ItemStateChangedEvent     ] - T_Zirkulation changed from 25.4 to 25.3
2017-03-23 23:12:08.446 [ItemStateChangedEvent     ] - T_Heizung_Vorl changed from 28.0 to 27.9
2017-03-23 23:12:08.493 [ItemStateChangedEvent     ] - T_Warmwasser_Ausl changed from 33.8 to 33.6

That means to me it must be an internal problem of openhab2