Hi!
I'm facing a small issue with openBEKEN and Home Assistant.
My device is a simple, generic TUYA smart plug switch with power monitoring, BK7231N based, flashed with the last version of openBEKEN. (version 1.17.200).
openBEKEN is configured with MQTT and Flag 27 is ON (Invoke HomeAssistant discovery on change to ip address, configuration).
MQTT server is a Mosquitto running on a virtualized HASSIO installation.
The auto discovery is working fine: my device appears, with all sensors and switches, on MQTT integration in Home Assistant.
But HASS log has a bunch of entries related to my smart plug. Here is an example log line:
2023-07-24 10:55:02.884 ERROR (MainThread) [homeassistant.components.mqtt.mixins] Error 'required key not provided @ data['state_topic']' when processing MQTT discovery message topic: 'homeassistant/sensor/TM09_GeladeiraCozinha_sensor_6/config', message: '{'device': {'identifiers': ['TM09_GeladeiraCozinha'], 'name': 'TM09_GeladeiraCozinha', 'sw_version': '1.17.200', 'manufacturer': 'Beken Corporation', 'model': 'BK7231N', 'configuration_url': 'http://192.168.144.59/index'}, 'name': 'http://192.168.144.59/index', 'availability_topic': 'TM09/connected', 'unique_id': 'TM09_GeladeiraCozinha_sensor_6', 'qos': 1, 'platform': 'mqtt'}'
2023-07-24 10:55:02.886 ERROR (MainThread) [homeassistant.components.mqtt.mixins] Error 'required key not provided @ data['state_topic']' when processing MQTT discovery message topic: 'homeassistant/sensor/TM09_GeladeiraCozinha_sensor_7/config', message: '{'device': {'identifiers': ['TM09_GeladeiraCozinha'], 'name': 'TM09_GeladeiraCozinha', 'sw_version': '1.17.200', 'manufacturer': 'Beken Corporation', 'model': 'BK7231N', 'configuration_url': 'http://192.168.144.59/index'}, 'name': 'http://192.168.144.59/index', 'availability_topic': 'TM09/connected', 'unique_id': 'TM09_GeladeiraCozinha_sensor_7', 'qos': 1, 'platform': 'mqtt'}'
2023-07-24 10:55:02.887 ERROR (MainThread) [homeassistant.components.mqtt.mixins] Error 'required key not provided @ data['state_topic']' when processing MQTT discovery message topic: 'homeassistant/sensor/TM09_GeladeiraCozinha_sensor_8/config', message: '{'device': {'identifiers': ['TM09_GeladeiraCozinha'], 'name': 'TM09_GeladeiraCozinha', 'sw_version': '1.17.200', 'manufacturer': 'Beken Corporation', 'model': 'BK7231N', 'configuration_url': 'http://192.168.144.59/index'}, 'name': 'http://192.168.144.59/index', 'availability_topic': 'TM09/connected', 'unique_id': 'TM09_GeladeiraCozinha_sensor_8', 'qos': 1, 'platform': 'mqtt'}'
I have a dozen of smart plugs identically flashed and configured, and all of them present the same error on HASS log.
Am I doing something wrong? Is the required key:
data['state_topic']
really missing? Is this a bug in openBEKEN MQTT discovery?
Thanks in advance!