Item value not displayed in sitemap when no format specified and is updated by MQTT event bus

Hi guys, sorry if this have already been discussed but I did not find a thread about that…

TL;DR;
It seems that openHAB let you define items without specifying a format and this works perfectly if it’s populated by a binding.
Exemple :
item : String CPU_Name "Name" <none> (SystemInfo) { channel="systeminfo:computer:work:cpu#name"}
sitemap : Default item=RpiOHvmc_CPU_Name
But this won’t work if the value is updated by a event bus synchronization via MQTT.

Explanation :
I have server running OH2 as master and an rpi running OH2 as slave. They are event and command synchronized using MQTT with MQTT v1 binding. Everything is perfectly working for this and I can see states coming from slave and commands going to slave.

What I don’t understand is why sitemap is working when you define an item (on the slave) :
String CPU_Name "Name" <none> (SystemInfo) { channel="systeminfo:computer:work:cpu#name"}
And in the sitemap :
Default item=RpiOHvmc_CPU_Name
Screenshot from 2020-07-31 17-21-52

But not if you define the item without the binding channel (on the master, updated by mqtt event) :
String CPU_Name "Name" <none> (SystemInfo)
And in the sitemap :
Default item=RpiOHvmc_CPU_Name
Screenshot from 2020-07-31 17-24-10

By the way, if I define the same item on the master like this :
String CPU_Name "Name [%s]" <none> (SystemInfo)

It’s perfectly working again :slight_smile:

I don’t know if this can be considered as a bug or not…

I think technically, it works as designed.
If you specify no [state presentation] then you get the default.
When there are no linked channels, you usually get a default string - though that can depend on the UI.

But if you link a channel, the binding can interact with the default [presentation]. The binding may look for units that you have chosen, or may supply formatting of its own based on an associated device perhaps. Where the binding can have no idea about the characteristics of a device (as with generic MQTT) then might get null default [presentation].

The summary is - you get what you asked for. If you didn’t ask, you might not get :wink: