Mqtt state of items

Hi there,
Since I migratet to OH3, I’m also using the newest mqtt binding. I got everything running, only a little pain remains…on the UI’s, the state is shown additionally as “ON” or “OFF”, which is useless for switches due their state is already shown with their depiction. I created my things as follows:

Bridge mqtt:broker:mosquitto "mosquitto" [ host="xxx.xxx.x.xx",port=1883, secure=false, username="", password="" ]
{
	
	Thing topic shellys "Shellys" {
	Channels:
		Type switch : ShellyPlug_Gartenpumpe_t "ShellyPlug_Gartenpumpe" [ stateTopic="shellies/shellyplug-s-040E66/relay/0",transformationPattern="MAP:shellystate.map", commandTopic="shellies/shellyplug-s-040E66/relay/0/command",transformationPatternOut="MAP:shellyout.map" ]

I’m pretty sure, this has to do with the transformation Pattern. But since shellys commands are as lower case, I have to transform from “on” to “ON”

The item looks like:

Switch ShellyPlug_Gartenpumpe "Gartenpumpe" <faucet> (gOutside)  { channel="mqtt:topic:mosquitto:shellys:ShellyPlug_Gartenpumpe_t"}

And the transformation file:

off=OFF
on=ON

Does someone have a idea, how to remove the additional “ON/OFF” information from the frontend?
Any help is highly appreciated!

Andreas

openHAB has a few front ends - can you show us what you mean?


Thanks for the fast reply! The states are shown on iOS, BasicUI…

So the question becomes “how do I hide a text display of my Item’s state” when using a Sitemap?

Switch ShellyPlug_Gartenpumpe "Gartenpumpe []" <faucet> ...

Use of MQTT irrelevant to UI, which only cares about the Item.

2 Likes

But I’m woundering, ONLY the mqtt items show their state “ON/OFF” in the sitemap…and I don’t know how to eliminate them…
And: it’s a new issue, did not had it with mqtt 1.xx…

Well, try it or don’t try it, advice is free.

Default [state presentation] of each Item may be influenced by any channels it is linked to.

1 Like

Default [state presentation] ?
What exactly I have to do?

See @rossko57 example in his first post. The important bit is to use the empty square brackets [] to force the UI to keep the label empty.

1 Like

You made my day! The [ ] resolved it - do you know, why only mqtt items are affected?
THANK YOU!

We should rearrange your question. By default, where you haven’t given any [state presentation] instruction to an xxx.items defined Item, sitemap based widgets will show the string version of the Item’s state in the UI.

So the MQTT Items are working as expected.

So the question is … what channels/bindings are your other Items linked to, that affects their default presentation?

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.