home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
70.06k stars 29.13k forks source link

roborock.vacuum.a15 data: byte indices must be integers or slices, not str #106410

Open perseus177 opened 7 months ago

perseus177 commented 7 months ago

The problem

Error in log file

What version of Home Assistant Core has the issue?

2023.11.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Xiaomi Miio

Link to integration documentation on our website

https://www.home-assistant.io/integrations/xiaomi_miio/

Diagnostics information

config_entry-xiaomi_miio-3779a226794e7e95a594bbcba77fa8b1.json.txt

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.xiaomi_miio
Source: helpers/update_coordinator.py:290
Integration: Xiaomi Miio (documentation, issues)
First occurred: 25. decembra 2023 o 23:01:54 (1 occurrences)
Last logged: 25. decembra 2023 o 23:01:54

Unexpected error fetching roborock.vacuum.a15 data: byte indices must be integers or slices, not str
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 246, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 274, in update_async
    return await execute_update()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 269, in execute_update
    state = await hass.async_add_executor_job(update)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 254, in update
    device.last_clean_details(),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/miio/click_common.py", line 184, in _wrap
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/miio/integrations/vacuum/roborock/vacuum.py", line 529, in last_clean_details
    return self.clean_details(last_clean_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/miio/click_common.py", line 184, in _wrap
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/miio/integrations/vacuum/roborock/vacuum.py", line 538, in clean_details
    details = self.send("get_clean_record", [id_])
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/miio/device.py", line 107, in send
    return self._protocol.send(
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/miio/miioprotocol.py", line 202, in send
    self.__id = payload["id"]
                ~~~~~~~^^^^^^
TypeError: byte indices must be integers or slices, not str

Additional information

No response

home-assistant[bot] commented 7 months ago

Hey there @rytilahti, @syssi, @starkillerog, mind taking a look at this issue as it has been labeled with an integration (xiaomi_miio) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `xiaomi_miio` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign xiaomi_miio` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


xiaomi_miio documentation xiaomi_miio source (message by IssueLinks)

perseus177 commented 6 months ago

Any update ?

serlinGi commented 5 months ago

same issue here; Mi Air Purifier Pro H. "Unexpected error fetching Mi Air Purifier Pro H data: byte indices must be integers or slices, not str"

miszczur commented 4 months ago

same issue with: Mi Smart Antibacterial Humidifier: "Unexpected error fetching Mi Smart Antibacterial Humidifier data: byte indices must be integers or slices, not str"

Strixx76 commented 2 months ago

Same here.

Device: zhimi.airpurifier.mb3 Home Assistant: 2024.4.3

Unexpected error fetching Mi Air Purifier 3/3H data: byte indices must be integers or slices, not str
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 315, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 271, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 185, in update
    return await _async_fetch_data()
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 180, in _async_fetch_data
    state = await hass.async_add_executor_job(device.status)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/miio/click_common.py", line 184, in _wrap
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/miio/integrations/airpurifier/zhimi/airpurifier_miot.py", line 522, in status
    self.set_property("aqi_realtime_update_duration", 5)
  File "/usr/local/lib/python3.12/site-packages/miio/miot_device.py", line 152, in set_property
    return self.send(
           ^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/miio/device.py", line 107, in send
    return self._protocol.send(
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/miio/miioprotocol.py", line 202, in send
    self.__id = payload["id"]
                ~~~~~~~^^^^^^
TypeError: byte indices must be integers or slices, not str
perseus177 commented 1 month ago

Any update ?