Generic MQTT rule


I want to define a rule which triggers on an MQTT message.

The idea is that I publish cmnd/OH3/Items with a payload like { “Item” : “FloorLight”, “State”: “ON” }
This should do a FloorLight.SendCommand(“ON”).

I want this rule to be generic so that I also can send { “Item” : “GarageDorr”, “State”: “OPEN” } and so on.
Can anyone please provide a simple sample for this?

See MQTT 2.5 Event Bus.

Careful about the distinction in openHAB between states and commands, or you’ll drive yourself mad :crazy_face: