Hi!
After searching and testing quite a while am reaching out for help.
Problem: I have a bulb / light device attached via ZHA. I want to read and write its state via MQTT.
I’m using the MQTT integration but with an MQTT broker running on another machine. Zigbee und MQTT are working fine in general. I’m using the most recent HA version on RPi4.
Question: how can I link the state property of the bulb entity to a certain MQTT topic?
I understood how I can add (either manually or via discovery) MQTT “devices” as entities. But how does it work the other way around?
Thank you! This solved half of the problem. I’m getting the required state information (also from sensors which is also important for another use case).
However, this is “publish only” - right? I need also to set the state via MQTT. This integration does not support subscribing to a topic.
Thank you Daryl. I think for the moment this fits my needs. If the number of device is growing significantly this might be a little bit “confusing”. On the other hand this gives me full control on the MQTT topic naming and structuting which helps integrating with my other applications.
Remember that you don’t need to specify the payload, this can reduce the number of automations. You just trigger on the topic and then with some judicious choice of payloads you can use the payload in a templated action.