Cheaterdev / clear_grass-ha

Xiaomi ClearGrass Air Detector integration into Home Assistant
59 stars 18 forks source link

Stopped working on HA 2021.12 #11

Closed ildar170975 closed 2 years ago

ildar170975 commented 2 years ago

After upgrade to HA 2021.12 the integration stopped working. There are messages in Log:

2021-12-12 04:00:57 WARNING (MainThread) [homeassistant.components.sensor] Platform clear_grass not ready yet: None; Retrying in background in 30 seconds
2021-12-12 04:00:57 WARNING (MainThread) [homeassistant.components.sensor] Platform clear_grass not ready yet: None; Retrying in background in 30 seconds

and the sensors are not created.

Cheaterdev commented 2 years ago

Sorry but I don't have the ability to fix this issue right now. Probably miio library was changed on which my custom integration is based.

BTW this device should be already supported by official miio integration:: https://www.home-assistant.io/integrations/xiaomi_miio/#xiaomi-air-quality-monitor

I see that their code was improved to handle this device: https://github.com/home-assistant/core/blob/dev/homeassistant/components/xiaomi_miio/air_quality.py

Cheaterdev commented 2 years ago

I can confirm that this device works after adding it to HA through "Xiaomi Miio" integration from "Integrations" page. Does not even need any yaml configuration for it

ildar170975 commented 2 years ago

Regarding Xiaomi Miio integration: Air Quality Monitor reports empty "charging" attribute https://github.com/home-assistant/core/issues/61533

ildar170975 commented 2 years ago

Sorry but I don't have the ability to fix this issue right now. Probably miio library was changed on which my custom integration is based.

Probably you may be able to help with that issue? https://github.com/home-assistant/core/issues/61533

Cheaterdev commented 2 years ago

Its not a sensor in the official integration but air_quality Under sensorits probably some other entity like from network discovery (I have it too)

I have my device under air_quality.qingping_air_monitor name So sensor templates are now: {{states.air_quality.qingping_air_monitor.attributes.carbon_dioxide}}

ildar170975 commented 2 years ago

The Xiaomi Miio creates 2 entities: изображение изображение As for AQ data - yes, it is available in air_quality entity (initially the entity has a cgllc_airmonitor_s1 name - I manually renamed it to xiaomi_cg_1 to ensure my template sensors are getting data from this new entity). All battery info is in the 2nd entity (which is of unknown state because of unknown reasons), and this entity has null for charging.

ildar170975 commented 2 years ago

https://github.com/Cheaterdev/clear_grass-ha/pull/12 The integration seems to work again!