home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.11k stars 29.79k forks source link

Xiaomi Miio integration missing sensor entities #59045

Closed xrypta closed 2 years ago

xrypta commented 2 years ago

The problem

After updating from 2021.10.7 to 2021.11.0 the Xiaomi Miio integration is not giving any sensor entities. In my specific use-case for the Air Humidifier MJJSQ both the Humidity sensor and the Temperature sensor.

Binary and switch entities still work.

What version of Home Assistant Core has the issue?

2021.11.0

What was the last working version of Home Assistant Core?

2021.10.7

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Xiaomi Miio

Link to integration documentation on our website

https://www.home-assistant.io/integrations/xiaomi_miio/

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No specific entries besides;

Logger: homeassistant.components.sensor
Source: components/xiaomi_miio/device.py:160
Integration: Sensor (documentation, issues)
First occurred: November 3, 2021, 11:19:42 PM (8 occurrences)
Last logged: 2:43:00 AM

Error while setting up xiaomi_miio platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/sensor.py", line 635, in async_setup_entry
    XiaomiGenericSensor(
  File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/sensor.py", line 658, in __init__
    self._attr_native_value = self._determine_native_value()
  File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/sensor.py", line 692, in _determine_native_value
    return self._extract_value_from_attribute(
  File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/device.py", line 160, in _extract_value_from_attribute
    value = getattr(state, attribute)
AttributeError: 'AirHumidifierStatus' object has no attribute 'use_time'

Additional information

No response

probot-home-assistant[bot] commented 2 years ago

Hey there @rytilahti, @syssi, @starkillerog, @bieniu, mind taking a look at this issue as it has been labeled with an integration (xiaomi_miio) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)


xiaomi_miio documentation xiaomi_miio source (message by IssueLinks)

rytilahti commented 2 years ago

Regression from #57560 I think, not all humidifiers support use_time. The attached PR should fix this for you.

xrypta commented 2 years ago

Thanks for your effort Rytilahti!