Exception with MQTT Autodiscovery

I have three room-assistant devices which are all working as expected, I am however having an issue auto-discovering two sensors on a MiFlora device. This is the error produced in the log.

I’m not sure where the error lies, I’m quite new to Python as a programmer and could do with a bit of help understanding the error. If the error lies with Room Assistant I’ll post on the appropriate GitHub repo.

Exception in async_discover_sensor when dispatching 'mqtt_discovery_new_sensor_mqtt': ({'payload_available': 'online', 'payload_not_available': 'offline', 'name': 'kitchenPlant moisture', 'device': {'sw_version': '2.9.1', 'identifiers': '0000000007c84ac9', 'name': 'Kitchen', 'model': 'BCM2835 - Pi 3 Model B', 'manufacturer': 'Raspberry Pi Foundation'}, 'unique_id': 'room-assistant-kitchen-kitchenplant-moisture', 'state_topic': 'room-assistant/sensor/kitchen-kitchenplant-moisture/state', 'json_attributes_topic': 'room-assistant/sensor/kitchen-kitchenplant-moisture/attributes', 'availability_topic': 'room-assistant/sensor/kitchen-kitchenplant-moisture/status', 'device_class': 'moisture', 'unit_of_measurement': '%', 'platform': 'mqtt'},) Traceback (most recent call last): File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/mqtt/sensor.py", line 83, in async_discover_sensor config = PLATFORM_SCHEMA(discovery_payload) File "/srv/homeassistant/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 272, in __call__ return self._compiled([], data) File "/srv/homeassistant/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict return base_validate(path, iteritems(data), out) File "/srv/homeassistant/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping raise er.MultipleInvalid(errors) voluptuous.error.MultipleInvalid: value is not allowed for dictionary value @ data['device_class'] 
Exception in async_discover_sensor when dispatching 'mqtt_discovery_new_sensor_mqtt': ({'payload_available': 'online', 'payload_not_available': 'offline', 'name': 'kitchenPlant fertility', 'device': {'sw_version': '2.9.1', 'identifiers': '0000000007c84ac9', 'name': 'Kitchen', 'model': 'BCM2835 - Pi 3 Model B', 'manufacturer': 'Raspberry Pi Foundation'}, 'unique_id': 'room-assistant-kitchen-kitchenplant-fertility', 'state_topic': 'room-assistant/sensor/kitchen-kitchenplant-fertility/state', 'json_attributes_topic': 'room-assistant/sensor/kitchen-kitchenplant-fertility/attributes', 'availability_topic': 'room-assistant/sensor/kitchen-kitchenplant-fertility/status', 'device_class': 'fertility', 'unit_of_measurement': '', 'platform': 'mqtt'},) Traceback (most recent call last): File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/mqtt/sensor.py", line 83, in async_discover_sensor config = PLATFORM_SCHEMA(discovery_payload) File "/srv/homeassistant/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 272, in __call__ return self._compiled([], data) File "/srv/homeassistant/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict return base_validate(path, iteritems(data), out) File "/srv/homeassistant/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping raise er.MultipleInvalid(errors) voluptuous.error.MultipleInvalid: value is not allowed for dictionary value @ data['device_class'] 

Thanks in advanced.

Hi, were you able to solve this issue? I’m very new to HA and RA and I’m having the same problem on RA installed on a Pi4.

Any help very much appreciated! Thanks

I have not, sorry I cannot be of more help.