Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Home Assistant unable to auto-discover two specific sensors. #304

Closed
frdbonif opened this issue Oct 14, 2020 · 4 comments
Closed

Home Assistant unable to auto-discover two specific sensors. #304

frdbonif opened this issue Oct 14, 2020 · 4 comments

Comments

@frdbonif
Copy link

Describe the bug
Home Assistant produces an error in the log when trying to add sensors through MQTT autodiscovery from a Room Assistant sensor.

To reproduce
Add MiFlora device to Room Assistant.

Relevant logs
Log output that correlates to the bug. You can get debug output with room-assistant -v. No relevent logs from Room Assistant, the error message from Home Assistant is posted.

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'] 

Expected behavior
A clear and concise description of what you expected to happen.

Environment

  • room-assistant version: Not sure how to check but using the latest version available from npm (Ansible install)
  • installation type: NodeJS
  • hardware: Raspberry Pi 3
  • OS: RPi OS

Additional context
Also posted on Home Assistant Forum. (https://community.home-assistant.io/t/exception-with-mqtt-autodiscovery/235647)
The Illiminance and Temperature sensor from the same MiFlora device are correctly discovered and added to Home Asssistant. I'm not sure if this is a Home Assistant fault but I suspect room-assistant because other sensors are available as expected in Home Assistant.

@frdbonif frdbonif added the bug label Oct 14, 2020
@mKeRix
Copy link
Owner

mKeRix commented Oct 14, 2020

Yep, that looks like a small issue in the discovery information that room-assistant sends for these two specific sensors. Thanks for reporting complete with the HA logs! I'll try to fix this ASAP.

@mKeRix mKeRix self-assigned this Oct 17, 2020
mKeRix added a commit that referenced this issue Oct 17, 2020
github-actions bot pushed a commit that referenced this issue Oct 17, 2020
# [2.11.0-beta.1](v2.10.0...v2.11.0-beta.1) (2020-10-17)

### Bug Fixes

* **bluetooth-classic:** fix device rotation logic ([15f5f89](15f5f89)), closes [#288](#288)
* **xiaomi-mi:** fix auto-discovery information ([24d1460](24d1460)), closes [#304](#304)

### Features

* **bluetooth:** allow BLE and Classic to run on same adapter ([b0c0671](b0c0671)), closes [#209](#209)
* **bluetooth-classic:** add default state setting for inquiries switch ([dd464c9](dd464c9)), closes [#275](#275)
@github-actions
Copy link

🎉 This issue has been resolved in version 2.11.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@mKeRix mKeRix closed this as completed in 982a4c3 Oct 20, 2020
github-actions bot pushed a commit that referenced this issue Oct 20, 2020
## [2.10.1](v2.10.0...v2.10.1) (2020-10-20)

### Bug Fixes

* **cluster:** improve null safety ([c02269c](c02269c)), closes [#308](#308)
* **xiaomi-mi:** fix auto-discovery information ([982a4c3](982a4c3)), closes [#304](#304)
@github-actions
Copy link

🎉 This issue has been resolved in version 2.10.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this issue Oct 25, 2020
# [2.11.0](v2.10.1...v2.11.0) (2020-10-25)

### Bug Fixes

* **bluetooth:** await reset before unlocking adapter ([c026ac3](c026ac3))
* **bluetooth-classic:** fix device rotation logic ([15f5f89](15f5f89)), closes [#288](#288)
* **xiaomi-mi:** fix auto-discovery information ([24d1460](24d1460)), closes [#304](#304)

### Features

* **bluetooth:** allow BLE and Classic to run on same adapter ([b0c0671](b0c0671)), closes [#209](#209)
* **bluetooth-classic:** add default state setting for inquiries switch ([dd464c9](dd464c9)), closes [#275](#275)
@github-actions
Copy link

🎉 This issue has been resolved in version 2.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants