actionCommand oh-label-card to invoke MQTT message

Runnen OH3.3 (still don’t dare to upgrade), I have a page that, amongst other stuff, houses an oh-label-card. This card presents the numerical value of an item. The idea was to click on the item to reset it’s state to 100% (or 99 for this test-case), followed by an MQTT message on in the command topic.


- component: oh-label-card
                        item: zoutvoorraad
                        title: Zoutvoorraad waterontharder
                        action: command
                        actionCommand: "99"
                        actionItem: zoutvoorraad

However, this last bit does not happen. The value of the item is indeed commanded to be 99 but the number or string 99 is never send via MQTT. I have tried with 99 but also, as above, with "99".

MQTT channel setup:

Other MQTT messages do not have issues so MQTT is working fine. The event-log shows:

2024-01-29 20:32:32.052 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'zoutvoorraad' received command 99
2024-01-29 20:32:32.052 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'zoutvoorraad' predicted to become 99

The openhab-log show nothing.

I am hoping I missed something, otherwise, I have to create a rule while this seems so much easier.

The Item is Linked to the Channel?

Good question! I thought my post was complete but I did forget to mention. Yes, it is.

The breakdown is happening between the Item and the binding and/or the MQTT broker.

Put the binding into debug logging, watch the MQTT broker using MQTTExplorer.

Installed MQTTExplorer, handy bit of kit that is!

But how on OH3.3 do I put the binding into debug mode?

I don’t remember if 3.3 had the ability to do that through MainUI so you’ll have to edit log4j2.xml or use the karaf console. Navigate to the binding’s page and see if there is a little blue gear shaped icon. If so you can change it there. If not see Logging | openHAB

Karaf did the job. I set everything that has MQTT in it to DEBUG. If I change a light setting, it indeed shows up in de log. But nothing appears if I click the button. Only the item is updated to the commanded state.

I think it could have something to do with the fact that the channel is a string and the item is a number. I’ll have a look and report back.

Definitely the Item type needs to match the Channel type.

Have been looking so awfully long for the mistake.
Funny, as the incoming topic is set a String and this works and modifies the item’s state but outgoing this is not the case.

Happy it is solved. Thanks for your input once more!