I’m stuck in solving a problem.
What do I want to do?
I’m getting values from different sensors (e.g. Homematic, Zigbee/Deconz, …) and want them to be published to some MQTT topics.
For example I have an item which is linked to the temperature of an aqara zigbee sensor and this temperature should be published to “openhab/some/queue/topic”.
The MQTT Broker is working with other mqtt stuff and I’m subscribing to mqtt topics with openhab successfully.
I tried to link the item (for example the zigbee thing/channel) additionally to an mqtt thing/channel and configured a command topic for publishing.
My expectation was, that if the item value is changing (as the temperature reading changes) a mqtt message should be published. But surprisingly nothing happened. No message was published.
Maybe this is, because the item is only “updated” without a command?
But how could I easily achieve what I want to do without a lot of work? Of course I could create a second item, which is linked to the mqtt thing/channel and send changes as commands via rules, but this would tripple the work as I would have to maintain additional items and rules.