rytilahti / python-miio

Python library & console tool for controlling Xiaomi smart appliances
https://python-miio.readthedocs.io
GNU General Public License v3.0
3.52k stars 542 forks source link

v6: Multiple Roborock devices swap attributes #1917

Open SLaks opened 3 months ago

SLaks commented 3 months ago

Describe the bug I have 2 Roborock vacuums added to Home Assistant (with the dev integration running against this library from source). They occasionally swap sensor values between vacuums.

Version information (please complete the following information):

For example, I see the following HA logs:

2024-03-19 11:05:10.279 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.lift_total_clean_count, value dropped from 1017.0 to 150.0, triggered by state with last_updated set to 2024-03-19T15:00:18.958009+00:00
2024-03-19 11:05:10.279 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.lift_total_dust_collection_count, value dropped from 1278.0 to 160.0, triggered by state with last_updated set to 2024-03-19T15:00:18.958043+00:00

Looking further in the logs, in one place, I see 2 copies of 2024-03-19 11:16:19.142 INFO (MainThread) [custom_components.xiaomi.coordinator] Got new state for <RoborockVacuum: ...>: for my 2 vacuums (with different IP addresses), with identical ConsumableStatus and CleaningSummary entries, but different CleaningDetails and VacuumStatus entries. In most places, all of those entries are (correctly) different for the 2 vacuums.

SLaks commented 3 months ago

The HA history graph for the same entity in the 2 vacuums looks like this; you can see the values swap.

image

SLaks commented 3 months ago

I'm seeing similar confusion in the map list; my vacuums have one and three maps, but it looks like the Current Map dropdown in HA shows the same set of maps for both vacuums (sometimes one, sometimes three)