I’m having some trouble understanding the MQTT Autodiscovery.
So as far as I understand, do correct me if I’m wrong, I have to tell Home Assistant to listen on some config topic. Where do I do this?
And then from some device I can publish something to this topic like:
Thanks for the script! I’ve implemented this on some local python client to test. So when I make the MQTT broker manually listen to “homeassistant/sensor/xiron_3201/temperature/config” it receives all the info (I’ve cut this short because it was a very long message):
I’m new to this - -how do I set up generic MQTT to publish updates for all devices for various values but especially state? Can I do it using a topic and payload, or do I need to write code? A simple version that says “changed” might be enough – I can then query the HA server.
I’m not sure if this is what you mean, but ‘various values’ are usually different entities with their own topics to which device subscribe. No need to query or something.
Maybe this is helpfull:
I have no problem writing MQTT code. I have my own app that listens for messages and updates the status locally. This works fine for Tasmota and Shelly.
Looking again, it does seem like the template facility is fairly powerful but the examples are a mixture of general and specific like the use of “.paulus”. It presumes I want put a lot of smarts into the HA side. I just want “tell me everything” so I can process it in my own client on my PC.
One problem with a general-purpose tool like HA is that there is a lot of implicit knowledge I need to get up to speed on, but I learn best by starting with simple working examples.
I agree with you on that one. Seems like a shitload of work to publish state changes. The API is a more easy way if you don’t mind querying the server.