Display blocks of text in UI received from MQTT or from executed pyhon script

That’s the nature of a switch widget; if it’s OFF now, you must meant to command ON; and vice-versa. There is no choice about that to be had.

When you use a toggle, the command is built in. It sends ON when toggled up and OFF when toggled down.

You need that for a label widget. Otherwise what’s the widget supposed to send as the command? There is nothing implied by the nature of the widget. With a toggle, ON/OFF can be implied. With a slider a number between a starting point (0 be default) and ending point (100 by default) can be implied. But clicking on a label? :person_shrugging:

You still have to send something or else OH won’t publish anything to MQTT. And as I said, there is no such thing as a “nothing” command in OH anyway.

Because it’s actually publishing “ON” and “OFF” to the topic.

Then there is something wrong with the configuration of the widget. Don’t mess around with screen shots. Click the Code tab and post the YAML so we can actually see everything. Use code fences.

```
code goes here
```

In addition to what has been said, the toggle card and the label card are functioning by different mechanism. The switch on the toggle card is its own widget with it’s own configuration. To make an oh-toggle-card an oh-toggle component has been placed on a regular card. The oh-toggle docs show you that there is only an item property for configuring what item the toggle interacts with because, as has been pointed out, On/Off is easy for the system to deduce in that case.

The system of widgets actions are availabe in many different widget, including the oh-label-card and require more configuration (see the link in my first post). You can even simulate toggling with the actions (that is the toggle action) but you have to specify both the true AND false state commands in that case because the action will not make the same On/Off assumption.

Aha … Looking again at Rich’s answer I went back and started afresh and created a new text channel and relinked that to the string item and also added some text to the action command again and this time it works, so yes, something must have been wrong with the previous config but I can’t see what it was as I can’t compare them now.
Thanks to everyone to help me getting this to work. Really appreciated
All I can say that I am glad I chose openHAB based on my research as to which software to use
I can’t say enough about how responsive and helpful you have all been
I am very happy and now looking to delve further into what I can do with openHAB
Best wishes to you all

1 Like

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