microfrost1 / xiaomi_vacuum

18 stars 5 forks source link

Device update error while updating Dreame F9 to 3.5.8_1050 #6

Closed Neonox31 closed 3 years ago

Neonox31 commented 3 years ago

Hello,

First thanks for this awesome integration, I use it since many months and it works very well 👍 Since I upgraded my Dreame F9 to 3.5.8_1050 version, I lost the integration in H.A with the following logs :

Logger: homeassistant.components.vacuum
Source: custom_components/xiaomi_vacuum/miio/miot_device.py:64
Integration: Aspirateur (documentation, issues)
First occurred: 8 août 2021, 20:51:25 (1 occurrences)
Last logged: 8 août 2021, 20:51:25

xiaomi_vacuum: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 432, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 601, in async_device_update
    await task
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/xiaomi_vacuum/vacuum.py", line 391, in update
    state = self._vacuum.status()
  File "/config/custom_components/xiaomi_vacuum/miio/dreamevacuum.py", line 291, in status
    return self.get_properties_for_dataclass(DreameStatus)
  File "/config/custom_components/xiaomi_vacuum/miio/miot_device.py", line 63, in get_properties_for_dataclass
    response = {
  File "/config/custom_components/xiaomi_vacuum/miio/miot_device.py", line 64, in <dictcomp>
    prop["did"]: prop["value"] if prop["code"] == 0 else None
TypeError: list indices must be integers or slices, not str

Any tips to recover it or maybe I should wait for a python-miio fix ?

Thanks

Neonox31 commented 3 years ago

Hi,

Here are few more logs after putting custom component into debug mode :

❯ stern -n smarthome smarthome | grep custom_components.xiaomi_vacuum
+ smarthome-6547d5bbd8-85vmd › home-assistant
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:35:51 INFO (MainThread) [custom_components.xiaomi_vacuum.vacuum] Initializing with host 192.168.10.63 (token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...)
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:35:52 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.protocol] Unable to decrypt, returning raw bytes: b''
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:35:52 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] Got a response: Container: 
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:35:52 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] Discovered 15bf5f08 with ts: 2021-08-27 08:35:51, token: b'ffffffffffffffffffffffffffffffff'
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:35:52 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] 192.168.10.63:54321 >>: {'id': 1, 'method': 'get_properties', 'params': [{'did': 'battery', 'siid': 3, 'piid': 1}, {'did': 'state', 'siid': 3, 'piid': 2}, {'did': 'error', 'siid': 2, 'piid': 2}, {'did': 'status', 'siid': 2, 'piid': 1}, {'did': 'brush_left_time', 'siid': 9, 'piid': 1}, {'did': 'brush_life_level', 'siid': 9, 'piid': 2}, {'did': 'filter_life_level', 'siid': 11, 'piid': 1}, {'did': 'filter_left_time', 'siid': 11, 'piid': 2}, {'did': 'brush_left_time2', 'siid': 10, 'piid': 1}, {'did': 'brush_life_level2', 'siid': 10, 'piid': 2}, {'did': 'operating_mode', 'siid': 4, 'piid': 1}, {'did': 'area', 'siid': 4, 'piid': 3}, {'did': 'timer', 'siid': 4, 'piid': 2}, {'did': 'fan_speed', 'siid': 4, 'piid': 4}]}
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:35:57 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] Retrying with incremented id, retries left: 3
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:35:57 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.protocol] Unable to decrypt, returning raw bytes: b''
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:35:57 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] Got a response: Container: 
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:35:57 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] Discovered 15bf5f08 with ts: 2021-08-27 08:35:56, token: b'ffffffffffffffffffffffffffffffff'
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:35:57 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] 192.168.10.63:54321 >>: {'id': 102, 'method': 'get_properties', 'params': [{'did': 'battery', 'siid': 3, 'piid': 1}, {'did': 'state', 'siid': 3, 'piid': 2}, {'did': 'error', 'siid': 2, 'piid': 2}, {'did': 'status', 'siid': 2, 'piid': 1}, {'did': 'brush_left_time', 'siid': 9, 'piid': 1}, {'did': 'brush_life_level', 'siid': 9, 'piid': 2}, {'did': 'filter_life_level', 'siid': 11, 'piid': 1}, {'did': 'filter_left_time', 'siid': 11, 'piid': 2}, {'did': 'brush_left_time2', 'siid': 10, 'piid': 1}, {'did': 'brush_life_level2', 'siid': 10, 'piid': 2}, {'did': 'operating_mode', 'siid': 4, 'piid': 1}, {'did': 'area', 'siid': 4, 'piid': 3}, {'did': 'timer', 'siid': 4, 'piid': 2}, {'did': 'fan_speed', 'siid': 4, 'piid': 4}]}
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:02 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] Retrying with incremented id, retries left: 2
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:02 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.protocol] Unable to decrypt, returning raw bytes: b''
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:02 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] Got a response: Container: 
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:02 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] Discovered 15bf5f08 with ts: 2021-08-27 08:36:02, token: b'ffffffffffffffffffffffffffffffff'
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:02 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] 192.168.10.63:54321 >>: {'id': 203, 'method': 'get_properties', 'params': [{'did': 'battery', 'siid': 3, 'piid': 1}, {'did': 'state', 'siid': 3, 'piid': 2}, {'did': 'error', 'siid': 2, 'piid': 2}, {'did': 'status', 'siid': 2, 'piid': 1}, {'did': 'brush_left_time', 'siid': 9, 'piid': 1}, {'did': 'brush_life_level', 'siid': 9, 'piid': 2}, {'did': 'filter_life_level', 'siid': 11, 'piid': 1}, {'did': 'filter_left_time', 'siid': 11, 'piid': 2}, {'did': 'brush_left_time2', 'siid': 10, 'piid': 1}, {'did': 'brush_life_level2', 'siid': 10, 'piid': 2}, {'did': 'operating_mode', 'siid': 4, 'piid': 1}, {'did': 'area', 'siid': 4, 'piid': 3}, {'did': 'timer', 'siid': 4, 'piid': 2}, {'did': 'fan_speed', 'siid': 4, 'piid': 4}]}
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:07 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] Retrying with incremented id, retries left: 1
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:09 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.protocol] Unable to decrypt, returning raw bytes: b''
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:09 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] Got a response: Container: 
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:09 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] Discovered 15bf5f08 with ts: 2021-08-27 08:36:08, token: b'ffffffffffffffffffffffffffffffff'
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:09 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] 192.168.10.63:54321 >>: {'id': 304, 'method': 'get_properties', 'params': [{'did': 'battery', 'siid': 3, 'piid': 1}, {'did': 'state', 'siid': 3, 'piid': 2}, {'did': 'error', 'siid': 2, 'piid': 2}, {'did': 'status', 'siid': 2, 'piid': 1}, {'did': 'brush_left_time', 'siid': 9, 'piid': 1}, {'did': 'brush_life_level', 'siid': 9, 'piid': 2}, {'did': 'filter_life_level', 'siid': 11, 'piid': 1}, {'did': 'filter_left_time', 'siid': 11, 'piid': 2}, {'did': 'brush_left_time2', 'siid': 10, 'piid': 1}, {'did': 'brush_life_level2', 'siid': 10, 'piid': 2}, {'did': 'operating_mode', 'siid': 4, 'piid': 1}, {'did': 'area', 'siid': 4, 'piid': 3}, {'did': 'timer', 'siid': 4, 'piid': 2}, {'did': 'fan_speed', 'siid': 4, 'piid': 4}]}
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:14 ERROR (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] Got error when receiving: timed out
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:14 ERROR (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.device] Unable to request properties [{'did': 'battery', 'siid': 3, 'piid': 1}, {'did': 'state', 'siid': 3, 'piid': 2}, {'did': 'error', 'siid': 2, 'piid': 2}, {'did': 'status', 'siid': 2, 'piid': 1}, {'did': 'brush_left_time', 'siid': 9, 'piid': 1}, {'did': 'brush_life_level', 'siid': 9, 'piid': 2}, {'did': 'filter_life_level', 'siid': 11, 'piid': 1}, {'did': 'filter_left_time', 'siid': 11, 'piid': 2}, {'did': 'brush_left_time2', 'siid': 10, 'piid': 1}, {'did': 'brush_life_level2', 'siid': 10, 'piid': 2}, {'did': 'operating_mode', 'siid': 4, 'piid': 1}, {'did': 'area', 'siid': 4, 'piid': 3}, {'did': 'timer', 'siid': 4, 'piid': 2}, {'did': 'fan_speed', 'siid': 4, 'piid': 4}]
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:14 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] 192.168.10.63:54321 >>: {'id': 305, 'method': 'get_properties', 'params': [{'did': 'waterbox_status', 'siid': 4, 'piid': 6}, {'did': 'total_clean_count', 'siid': 12, 'piid': 3}, {'did': 'total_area', 'siid': 12, 'piid': 4}, {'did': 'dnd_enabled', 'siid': 5, 'piid': 1}, {'did': 'dnd_start_time', 'siid': 5, 'piid': 2}, {'did': 'dnd_stop_time', 'siid': 5, 'piid': 3}, {'did': 'map_view', 'siid': 6, 'piid': 1}, {'did': 'audio_volume', 'siid': 7, 'piid': 1}, {'did': 'audio_language', 'siid': 7, 'piid': 2}, {'did': 'timezone', 'siid': 8, 'piid': 1}]}
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:19 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] Retrying with incremented id, retries left: 3
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:19 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.protocol] Unable to decrypt, returning raw bytes: b''
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:19 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] Got a response: Container: 
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:19 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] Discovered 15bf5f08 with ts: 2021-08-27 08:36:18, token: b'ffffffffffffffffffffffffffffffff'
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:19 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] 192.168.10.63:54321 >>: {'id': 406, 'method': 'get_properties', 'params': [{'did': 'waterbox_status', 'siid': 4, 'piid': 6}, {'did': 'total_clean_count', 'siid': 12, 'piid': 3}, {'did': 'total_area', 'siid': 12, 'piid': 4}, {'did': 'dnd_enabled', 'siid': 5, 'piid': 1}, {'did': 'dnd_start_time', 'siid': 5, 'piid': 2}, {'did': 'dnd_stop_time', 'siid': 5, 'piid': 3}, {'did': 'map_view', 'siid': 6, 'piid': 1}, {'did': 'audio_volume', 'siid': 7, 'piid': 1}, {'did': 'audio_language', 'siid': 7, 'piid': 2}, {'did': 'timezone', 'siid': 8, 'piid': 1}]}
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:24 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] Retrying with incremented id, retries left: 2
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:24 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.protocol] Unable to decrypt, returning raw bytes: b''
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:24 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] Got a response: Container: 
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:24 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] Discovered 15bf5f08 with ts: 2021-08-27 08:36:24, token: b'ffffffffffffffffffffffffffffffff'
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:24 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] 192.168.10.63:54321 >>: {'id': 507, 'method': 'get_properties', 'params': [{'did': 'waterbox_status', 'siid': 4, 'piid': 6}, {'did': 'total_clean_count', 'siid': 12, 'piid': 3}, {'did': 'total_area', 'siid': 12, 'piid': 4}, {'did': 'dnd_enabled', 'siid': 5, 'piid': 1}, {'did': 'dnd_start_time', 'siid': 5, 'piid': 2}, {'did': 'dnd_stop_time', 'siid': 5, 'piid': 3}, {'did': 'map_view', 'siid': 6, 'piid': 1}, {'did': 'audio_volume', 'siid': 7, 'piid': 1}, {'did': 'audio_language', 'siid': 7, 'piid': 2}, {'did': 'timezone', 'siid': 8, 'piid': 1}]}
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:29 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] Retrying with incremented id, retries left: 1
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:29 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.protocol] Unable to decrypt, returning raw bytes: b''
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:29 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] Got a response: Container: 
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:29 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] Discovered 15bf5f08 with ts: 2021-08-27 08:36:29, token: b'ffffffffffffffffffffffffffffffff'
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:29 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] 192.168.10.63:54321 >>: {'id': 608, 'method': 'get_properties', 'params': [{'did': 'waterbox_status', 'siid': 4, 'piid': 6}, {'did': 'total_clean_count', 'siid': 12, 'piid': 3}, {'did': 'total_area', 'siid': 12, 'piid': 4}, {'did': 'dnd_enabled', 'siid': 5, 'piid': 1}, {'did': 'dnd_start_time', 'siid': 5, 'piid': 2}, {'did': 'dnd_stop_time', 'siid': 5, 'piid': 3}, {'did': 'map_view', 'siid': 6, 'piid': 1}, {'did': 'audio_volume', 'siid': 7, 'piid': 1}, {'did': 'audio_language', 'siid': 7, 'piid': 2}, {'did': 'timezone', 'siid': 8, 'piid': 1}]}
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:34 ERROR (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.miioprotocol] Got error when receiving: timed out
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:34 ERROR (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.device] Unable to request properties [{'did': 'waterbox_status', 'siid': 4, 'piid': 6}, {'did': 'total_clean_count', 'siid': 12, 'piid': 3}, {'did': 'total_area', 'siid': 12, 'piid': 4}, {'did': 'dnd_enabled', 'siid': 5, 'piid': 1}, {'did': 'dnd_start_time', 'siid': 5, 'piid': 2}, {'did': 'dnd_stop_time', 'siid': 5, 'piid': 3}, {'did': 'map_view', 'siid': 6, 'piid': 1}, {'did': 'audio_volume', 'siid': 7, 'piid': 1}, {'did': 'audio_language', 'siid': 7, 'piid': 2}, {'did': 'timezone', 'siid': 8, 'piid': 1}]
smarthome-6547d5bbd8-85vmd home-assistant 2021-08-27 10:36:34 DEBUG (SyncWorker_4) [custom_components.xiaomi_vacuum.miio.device] Count (24) of requested properties does not match the count (2) of received values.
smarthome-6547d5bbd8-85vmd home-assistant   File "/config/custom_components/xiaomi_vacuum/vacuum.py", line 391, in update
smarthome-6547d5bbd8-85vmd home-assistant   File "/config/custom_components/xiaomi_vacuum/miio/dreamevacuum.py", line 291, in status
smarthome-6547d5bbd8-85vmd home-assistant   File "/config/custom_components/xiaomi_vacuum/miio/miot_device.py", line 63, in get_properties_for_dataclass
smarthome-6547d5bbd8-85vmd home-assistant   File "/config/custom_components/xiaomi_vacuum/miio/miot_device.py", line 64, in <dictcomp>
Neonox31 commented 3 years ago

OK my mistake.. my token has changed 🤦‍♂️ This comment was a clue : https://github.com/rytilahti/python-miio/issues/669#issuecomment-629756565

Sorry for the noise.