-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MQTT auto discovery #136
Comments
Hi! I think there are many similar applications that can serve as an example, such as PS5-MQTT or Docker2MQTT. I think this part of esphome Wiki can help you better understand MQTT message conversion. I hope I can help you with this information, if you need anything else, let me know and I'll be happy to help you. I show you an example of the information extracted from MQTT Explore Example "Topic" ps5-mqtt/id_device --> (name_app/id_device){"power":"AWAKE","device_status":"online","activity":"idle"} Example "auto discovery" homeassistant/sensor/id_device/activity/config --> (prefix_discovery/type/id_device/activity/config){"availability":[{"topic":"ps5-mqtt/name_device","value_template":"{{ value_json.device_status }}"}],"unique_id":"name_device_activity_ps5mqtt","state_topic":"ps5-mqtt/id_device","name":"PS5 activity","device":{"manufacturer":"Sony","model":"Playstation 5","name":"PS5","identifiers":["id_device"],"connections":[["ip","192.168.0.xx"]],"sw_version":"xxxxxxx"},"enabled_by_default":true,"json_attributes_topic":"ps5-mqtt/xxxxxx","value_template":"{{ value_json.activity }}"} Example "Topic" docker2mqtt/Docker2MQTT/MIELE-GW/memory_usage/state --> (name_app/name_app/device-docker/memory_usage/state)0.02 Example "auto discovery" homeassistant/sensor/docker2mqtt/docker_Docker2MQTT_MIELE-GW_memory_usage --> (prefix_discovery/type/name_app/name_app_device-docker_memory_usage/state){"availability_topic":"docker2mqtt/Docker2MQTT/MIELE-GW/lwt","device":{"identifiers":["docker_Docker2MQTT_MIELE-GW"],"manufacturer":"docker2mqtt","model":"docker","name":"docker_Docker2MQTT_MIELE-GW"},"name":"docker_Docker2MQTT_MIELE-GW_memory_usage","payload_available":"Online","payload_not_available":"Offline","platform":"mqtt","state_topic":"docker2mqtt/Docker2MQTT/MIELE-GW/memory_usage/state","unique_id":"docker_Docker2MQTT_MIELE-GW_memory_usage"} Component entities can be:
Surely most are better suited to "Sensor" but they do not have to be all "Sensor". |
@philipparndt Hi, any news? Do you need help with more examples or to prove something? |
Hi @cvc90 I'm currently low on time to implement this but I think the examples should help ;) |
Add MQTT auto discovery, so that Home Assistant can detect the devices.
See: https://www.home-assistant.io/integrations/mqtt/#mqtt-discovery
The text was updated successfully, but these errors were encountered: