core: Xiaomi Miio Vacuum: Could not determine how to parse state value of type

The problem

image

What is version of Home Assistant Core has the issue?

core-2021.11.0.dev20211011

What was the last working version of Home Assistant Core?

core-2021.11.0.dev20211006

What type of installation are you running?

Home Assistant Supervised

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?

Could not determine how to parse state value of type <class 'NoneType'> for state <class 'miio.vacuumcontainers.VacuumStatus'> and attribute is_water_box_carriage_attached
Could not determine how to parse state value of type <class 'NoneType'> for state <class 'miio.vacuumcontainers.VacuumStatus'> and attribute is_water_shortage

Additional information

Probably a regression introduced in #54990

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 36 (30 by maintainers)

Commits related to this issue

Most upvoted comments

Yes, I can work on that once https://github.com/home-assistant/core/pull/57553 is resolved 😃

Why have all these models never been added to the list 😮 Will add roborock.vacuum.a19 to the list, that should fix the unavailable part. Not sure how you’ve managed to create the mopping sensors tho 🤔 the following code should have blcoked it: https://github.com/home-assistant/core/blob/ed80f8c291b487103a8624c6eba293dcc00cfdbb/homeassistant/components/xiaomi_miio/binary_sensor.py#L116-L117

So I’m confused on that part. Lets wait for #57553 and my PR to add a19 to the list to get merged and see if the issue is still there afterwards.

Alright, ill hold on on working on the vacuum sensor fix after: https://github.com/home-assistant/core/pull/57553 as it will cause merge conflicts. Don’t want to branch of from that neither as it not clear if that PR will be accepted or not yet.

We have to hurry tho, it will be Nov soon and want to have this fixed before it released.

Or is this not a nice approach?

@OGKevin, sorry for the delay. I think that approach is fine, and until the vacuums inside python-miio get refactored to have feature flags & an interface for exposing supported model information, I think it’s best to have have that const living inside homeassistant for this use case.

Sometimes means 3-4 times per hour. These values are supported by the device and usually are normally reported.

2021-10-12 14:27:11 INFO (MainThread) [custom_components.xiaomi_miio.device] aqi: 3
2021-10-12 14:27:11 INFO (MainThread) [custom_components.xiaomi_miio.device] filter_life_remaining: 96
2021-10-12 14:27:21 INFO (MainThread) [custom_components.xiaomi_miio.device] aqi: 3
2021-10-12 14:27:21 INFO (MainThread) [custom_components.xiaomi_miio.device] filter_life_remaining: 96
2021-10-12 14:27:31 INFO (MainThread) [custom_components.xiaomi_miio.device] aqi: None
2021-10-12 14:27:31 WARNING (MainThread) [custom_components.xiaomi_miio.device] Could not determine how to parse state value of type <class 'NoneType'> for state <class 'miio.airpurifier_miot.AirPurifierMiotStatus'> and attribute aqi
2021-10-12 14:27:31 INFO (MainThread) [custom_components.xiaomi_miio.device] filter_life_remaining: None
2021-10-12 14:27:31 WARNING (MainThread) [custom_components.xiaomi_miio.device] Could not determine how to parse state value of type <class 'NoneType'> for state <class 'miio.airpurifier_miot.AirPurifierMiotStatus'> and attribute filter_life_remaining

@OGKevin

Models S5: roborock.vacuum.s5 S5 Max: roborock.vacuum.s5e

I have been seeing these as well but with a different device

2021-10-11 10:27:51 WARNING (MainThread) [homeassistant.components.xiaomi_miio.device] Could not determine how to parse state value of type <class 'NoneType'> for state <class 'miio.airpurifier.AirPurifierStatus'> and attribute filter_type

If this should be a separate issue let me know but the error is very similar.