Hello
I have been trying to get MQTT Discovery to work but to no avail.
I have a process (pi zero attached to my UPS) that sends MQTT messages to my MQTT server (not the add on, running EMQX on a seperate device). I started with this Sources + Config: https://github.com/ned-kelly/docker-voltronic-homeassistant
I have tested that Home Assistant can read the messages using the test facilities in the intergration:
The json looks well formed with the correct required keys:
{
"name": "main_ups_Battery_float_voltage",
"unit_of_measurement": "V",
"state_topic": "homeassistant/sensor/main_ups_Battery_float_voltage/state",
"icon": "mdi:current-dc",
"unique_id": "main_ups_Battery_float_voltage"
}
I have also checked that the “add new entities” is enabled as well as Discovery. The topic set to “homeassistant” and it matches the topic being sent.
{
"home_assistant": {
"installation_type": "Home Assistant OS",
"version": "2023.3.6",
"dev": false,
"hassio": true,
"virtualenv": false,
"python_version": "3.10.10",
"docker": true,
"arch": "x86_64",
"timezone": "Africa/Johannesburg",
"os_name": "Linux",
"os_version": "5.15.90",
"supervisor": "2023.03.3",
"host_os": "Home Assistant OS 9.5",
"docker_version": "20.10.22",
"chassis": "vm",
"run_as_root": true
},
"integration_manifest": {
"domain": "mqtt",
"name": "MQTT",
"codeowners": [
"@emontnemery",
"@jbouwh"
],
"config_flow": true,
"dependencies": [
"file_upload",
"http"
],
"documentation": "https://www.home-assistant.io/integrations/mqtt",
"iot_class": "local_push",
"quality_scale": "gold",
"requirements": [
"paho-mqtt==1.6.1"
],
"is_built_in": true
},
"data": {
"connected": true,
"mqtt_config": {
"birth_message": {
"topic": "homeassistant/status",
"payload": "online",
"qos": 0,
"retain": false
},
"discovery": true,
"discovery_prefix": "homeassistant",
"port": 1883,
"protocol": "3.1.1",
"tls_version": "auto",
"transport": "tcp",
"will_message": {
"topic": "homeassistant/status",
"payload": "offline",
"qos": 0,
"retain": false
},
However no new entity gets added.
I use MQTT with some Tasmota devices, these were manually configured before Discovery was a things and work just fine. Not sure if this is messing with the process? I have nothing in my configuration.yaml for MQTT other than the below, those Tasmota devices:
mqtt:
sensor: !include mqtt_sensor.yaml
switch: !include mqtt_switch.yaml
light: !include mqtt_light.yaml
Any suggestions or advice would be greatly appreciated, thank you!