UI MQTT Item is not updated

Platform information: Hardware: RPI 3, OS: Openhabian openHAB version: 2.4.0 Release Build

Hello. I have a strange issue, which I can’t resolve for a while. I’m using MQTT event bus binding from OH1 to link the MQTT topics directly to the items. The broker is Mosquitto.
E.g. I have a sensor which can publish a current temperature into a topic
/myhome/command/Weather_Temperature/state

The mqtt-eventbus.cfg file contains parameter commandSubscribeTopic=/myhome/command/${item}/state

I made an item Weather_Temperature like this:

The problem is that when the value is published on MQTT, the log file shows everything correctly:

But the item in UI remains blank:


Same is in iOS app and everywhere.

I tried with enforce autoupdate and without - no change. How to make the item to be updated in UI?

Maybe your sitemap Weather_Temperature entry is wrong.
Maybe your sitemap is not refreshing due to filename error.

Not sure, what has sitemap to do with this. My Sitemap file is very simple:
sitemap default label=“MyHouse”
{
Group item=Weather
Group item=Terasse
}

And it wasn’t changed, when I added this item. Other items of group Weather are shown normally and Weather_Temperature is also shown, but without value.

There are two things about your sitemap

If the filename is not exactly default.sitemap, the sitemap works but with refresh problems.

You’re relying on Group membership to display your Item. I’m not sure how clever any of the UIs are about handling new members added in flight. Sometimes openHAB framework is not so clever about it either, e.g. with rule triggers, so I would not depend on that working before a reboot.

In the meantime you can make a better test by temporarily adding a widget

Text item=Weather_Temperature label="Test [%s]"

The sitemap file name is exactly default.sitemap

In the meantime you can make a better test by temporarily adding a widget

It’s strange, but it works!

But not with the group - even after reboot. Any hints how to make it work in a group?

I should also have said to refresh the UI after reboot, but let’s assume that happened.

No real ideas ; I’d use REST API to have a close look at group membership, with a view to finding a duplicate item or typo.

EDIT - ah, just realized that you haven’t asked for a display of your Item state in its label. That’s the [%d] or similar part. You might or might not get a display by default, this seems to depend on linked bindings. But you will only get the default when using Group widget to display. Don’t ask, might not get. Add a [state representation] to your Item label definition.

EDIT - ah, just realized that you haven’t asked for a display of your Item state in its label. That’s the [%d] or similar part. You might or might not get a display by default, this seems to depend on linked bindings. But you will only get the default when using Group widget to display. Don’t ask, might not get. Add a [state representation] to your Item label definition.

Yes. That’s was the bug, thank you! Just added [%s] to the label and it started to show up properly in the group.

1 Like