core icon indicating copy to clipboard operation
core copied to clipboard

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

Open perseus177 opened this issue 1 year ago • 1 comments

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

perseus177 avatar Dec 26 '23 13:12 perseus177

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)

home-assistant[bot] avatar Dec 26 '23 13:12 home-assistant[bot]

Any update ?

perseus177 avatar Jan 19 '24 14:01 perseus177

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"

serlinGi avatar Jan 29 '24 12:01 serlinGi

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

miszczur avatar Mar 04 '24 10:03 miszczur

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

Strixx76 avatar May 24 '24 06:05 Strixx76

Any update ?

perseus177 avatar Jun 11 '24 10:06 perseus177