Outdated Home assistant MQTT discovery message format
Describe the bug This firmware have outdated Home assistant MQTT discovery message format. Home assistant version: 2024.6.4
Firmware:
- Version: 1.17.622
- Device: ONENUO ZHQ01 (Delivered from Aliexpress with product title "ONENUO Tuya Smart Micro USB Adapter Switch 5V WiFi Mini USB Power Adapter Works with Alexa Hey Go Ogle Alice for Smart Home"
- Chip/model: BK7231N
- Device config
{
"vendor": "Tuya",
"bDetailed": "0",
"name": "USB Smart Adapter HC-S050-WIFI",
"model": "HC-S050-WIFI",
"chip": "BK7231N",
"board": "TODO",
"flags": "1024",
"keywords": [
"5V",
"MOSFET"
],
"pins": {
"6": "WifiLED_n;0",
"7": "Rel;1",
"8": "Btn_Tgl_All;0",
"24": "Btn;1"
},
"command": "",
"image": "https://obrazki.elektroda.pl/5839545100_1692292748_thumb.jpg",
"wiki": "https://www.elektroda.com/rtvforum/viewtopic.php?p=20697534#20697534"
}
To Reproduce Steps to reproduce the behavior:
- Go to 'http://device_ip'
- Click on 'Config'
- Click on 'Home Assistant Configuration'
- Press 'Start Home Assistant Discovery Configure MQTT'
- Go to to HA web interface and check for new just added device
- Actual result: device not added to HA
Reason: firmware has outdated MQTT discovery format
Example
Discovery topic: homeassistant
Payload Current format:
mqtt:
switch:
- unique_id: "OpenBK7231N_LedStripHall_relay_0"
name: 0
state_topic: "led_strip_hall/0/get"
command_topic: "led_strip_hall/0/set"
qos: 1
payload_on: 1
payload_off: 0
retain: true
availability:
- topic: "led_strip_hall/connected"
Correct format: according to HA docs (https://www.home-assistant.io/integrations/mqtt/#mqtt-discovery)
Discovery topic:
homeassistant/switch/OpenBK7231N_LedStripHall_relay_0/config
Payload:
{
"device_class":"switch",
"device": {
"identifiers": "OpenBK7231N_LedStripHall_relay_0",
"manufacturer": "Led Strip Hall",
"model": "Led Strip Hall",
"name": "Led Strip Hall"
},
"object_id":"OpenBK7231N_LedStripHall_relay_0",
"unique_id": "OpenBK7231N_LedStripHall_relay_0",
"name": "Led Strip Hall",
"command_topic": "ed_strip_hall/0/set",
"payload_on": "1",
"payload_off": "0",
"state_topic": "led_strip_hall/0/get",
"state_on": 1,
"state_off": 0,
"qos": 1
}
Current discovery message format is JSON in all cases (in application code). I had no issues when did sensors discovery from my device to my hass. So, your provided description looks unreal for me. But I'm newbie here so I could be wrong.
Aren't you confusing the old yaml code displayed for legacy purposes with the internal HASS discovery format?
Current discovery message format is JSON in all cases (in application code). I had no issues when did sensors discovery from my device to my hass. So, your provided description looks unreal for me. But I'm newbie here so I could be wrong.
What HASS version do you use?
2024.6.4