Exception in async_discover_sensor when dispatching mqtt_discovery_new_sensor_mqtt

After upgrading Hass.io from 0.94.1 to 0.97.1 I have a lot of these errors…

2019-08-10 15:21:06 ERROR (MainThread) [homeassistant.components.mqtt.sensor] Exception in async_discover_sensor when dispatching 'mqtt_discovery_new_sensor_mqtt': ({'device_class': 'battery', 'name': 'Presenza Corridoio Battery', 'state_topic': 'homeassistant/sensor/motion_sensor_158d00016dafd8_battery/state', 'unit_of_measurement': '%', 'unique_id': 'motion_sensor_158d00016dafd8_battery', 'source_entity_id': 'binary_sensor.motion_sensor_158d00016dafd8', 'source_attribute': 'battery_level', 'platform': 'mqtt'},)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/mqtt/sensor.py", line 81, in async_discover_sensor
    config = PLATFORM_SCHEMA(discovery_payload)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 267, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 589, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 427, in validate_mapping
    raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: extra keys not allowed @ data['source_entity_id']

Please Help Me!

Problem not solved yet

It is shown if I set

mqtt:
  discovery: true
  discovery_prefix: homeassistant

in configuration.yaml

But I need it to works with zigbee2mqtt

Any solution?

Problem solved myself.
I was due to Mosquitto add-on.
I stopped it, unistalled and reinstalled again and problem has been solved.

2 Likes