hassio_addons icon indicating copy to clipboard operation
hassio_addons copied to clipboard

MQTT discovery error on latest - Exception in async_discover when dispatching 'mqtt_discovery_new_sensor_mqtt

Open convicte opened this issue 1 year ago • 5 comments

Hi @thejeffreystone

If I am not mistaken, you may have added ['expire_after'] to this add-on (from the Accurate version) that has no call in the config, but is reported as an error:

Exception in async_discover when dispatching 'mqtt_discovery_new_sensor_mqtt': ({'name': 'Bresser 7in1 43807 uv', 'unit_of_measurement': 'UV Index', 'value_template': '{{ value|int }}', 'state_topic': 'rtl_433/Bresser-7in1/43807/0/uv', 'unique_id': 'rtl433sensor43807uv', 'availability_topic': 'rtl_433/status', 'expire_after': 'null', 'last_reset': 'homeassistant.util.dt.utc_from_timestamp(0)', 'state_class': 'measurement', 'device': {'identifiers': '43807', 'name': '43807', 'model': '7in1', 'manufacturer': 'Bresser'}, 'platform': 'mqtt'},) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/mqtt/mixins.py", line 331, in async_discover config: DiscoveryInfoType = discovery_schema(discovery_payload) File "/usr/local/lib/python3.10/site-packages/voluptuous/validators.py", line 232, in call return self._exec((Schema(val) for val in self.validators), v) File "/usr/local/lib/python3.10/site-packages/voluptuous/validators.py", line 355, in _exec raise e if self.msg is None else AllInvalid(self.msg, path=path) File "/usr/local/lib/python3.10/site-packages/voluptuous/validators.py", line 351, in _exec v = func(v) File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 272, in call return self._compiled([], data) File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable return schema(data) File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 272, in call return self._compiled([], data) File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict return base_validate(path, iteritems(data), out) File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 433, in validate_mapping raise er.MultipleInvalid(errors) voluptuous.error.MultipleInvalid: expected int for dictionary value @ data['expire_after']

image

Could you advise what to do in this situation? I was trying to add it manual in yaml config, to see if it's going to be a workaround for the moment, but this didn't work.

Thank you in advance!!

convicte avatar Jan 31 '23 14:01 convicte