Xiaomi Air Quality has no attribute 'time_state'

Hello,

I try to set up my Xiaomi Air Quality Sensor. I checked my Token several times and it should be ok.
Has anyone any idea what I am doing wrong?

Thank you,
Andy

Running on HassIO with 0.72

Log:

`>2018-06-24 11:28:57 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.xiaomi_miio

2018-06-24 11:28:59 INFO (MainThread) [homeassistant.components.sensor.xiaomi_miio] Initializing with host 192.168.1.13 (token 7fc49…)
2018-06-24 11:29:00 INFO (MainThread) [homeassistant.components.sensor.xiaomi_miio] zhimi.airmonitor.v1 1.2.9_8038 MW300 detected
2018-06-24 11:29:00 ERROR (MainThread) [homeassistant.components.sensor] xiaomi_miio: Error on device update!
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 248, in _async_add_entity
await entity.async_device_update(warning=False)
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py”, line 318, in async_device_update
yield from self.async_update()
File “/usr/lib/python3.6/site-packages/homeassistant/components/sensor/xiaomi_miio.py”, line 146, in async_update
ATTR_TIME_STATE: state.time_state,
AttributeError: ‘AirQualityMonitorStatus’ object has no attribute ‘time_state’`

Config:

  • platform: xiaomi_miio
    name: Xiaomi Air Quality Monitor
    host: 192.168.1.13
    token: 7fc49xxxxxxxxxxxxxxxxxxx…

Suddenly I’m having the same error.

It did work before, but it seems that after I’ve upgraded to 0.72 this sensor doesn’t work anymore.
Does anyone have an idea how to get it back to work?

Log:
2018-06-26 22:36:05 ERROR (MainThread) [homeassistant.components.sensor] xiaomi_miio: Error on device update!
Traceback (most recent call last):
File “/usr/local/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py”, line 248, in _async_add_entity
await entity.async_device_update(warning=False)
File “/usr/local/lib/python3.5/site-packages/homeassistant/helpers/entity.py”, line 318, in async_device_update
yield from self.async_update()
File “/usr/local/lib/python3.5/site-packages/homeassistant/components/sensor/xiaomi_miio.py”, line 146, in async_update
ATTR_TIME_STATE: state.time_state,
AttributeError: ‘AirQualityMonitorStatus’ object has no attribute ‘time_state’

+1, I’m having the same error post 0.72 upgrade. The sensor stopped working.

I guess it might be releated to https://github.com/home-assistant/home-assistant/pull/14796
@syssi any thoughts ?

Oh, I broke the compatibility. I will care about a fix!

2 Likes

Just comment string 146 in File /srv/homeassistant/lib64/python3.6/site-packages/homeassistant/components/sensor/xiaomi_miio.py

ATTR_TIME_STATE: state.time_state