Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError in Xiaomi Miio vacuum integration #62903

Closed
dnschnur opened this issue Dec 28, 2021 · 3 comments
Closed

TypeError in Xiaomi Miio vacuum integration #62903

dnschnur opened this issue Dec 28, 2021 · 3 comments

Comments

@dnschnur
Copy link

The problem

The Xiaomi Miio integration periodically logs this error (full stack trace below):

TypeError: byte indices must be integers or slices, not str

The only device using this integration is a Roborock S7 vacuum. The error doesn't correspond to any cleaning activity; it just seems to happen randomly.

What version of Home Assistant Core has the issue?

core-2021.12.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Core

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?

Unexpected error fetching roborock.vacuum.a15 data: byte indices must be integers or slices, not str
Traceback (most recent call last):
  File "/opt/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh
    self.data = await self._async_update_data()
  File "/opt/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/update_coordinator.py", line 147, in _async_update_data
    return await self.update_method()
  File "/opt/homeassistant/lib/python3.9/site-packages/homeassistant/components/xiaomi_miio/__init__.py", line 253, in update_async
    return await execute_update()
  File "/opt/homeassistant/lib/python3.9/site-packages/homeassistant/components/xiaomi_miio/__init__.py", line 248, in execute_update
    state = await hass.async_add_executor_job(update)
  File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/opt/homeassistant/lib/python3.9/site-packages/homeassistant/components/xiaomi_miio/__init__.py", line 222, in update
    timer = device.timer()
  File "/opt/homeassistant/lib/python3.9/site-packages/miio/click_common.py", line 187, in _wrap
    return func(self, *args, **kwargs)
  File "/opt/homeassistant/lib/python3.9/site-packages/miio/integrations/vacuum/roborock/vacuum.py", line 494, in timer
    res = self.send("get_timer", [""])
  File "/opt/homeassistant/lib/python3.9/site-packages/miio/device.py", line 103, in send
    return self._protocol.send(
  File "/opt/homeassistant/lib/python3.9/site-packages/miio/miioprotocol.py", line 199, in send
    self.__id = payload["id"]
TypeError: byte indices must be integers or slices, not str

Additional information

No response

@probot-home-assistant
Copy link

Hey there @rytilahti, @syssi, @starkillerOG, @bieniu, 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!
(message by CodeOwnersMention)


xiaomi_miio documentation
xiaomi_miio source
(message by IssueLinks)

@CMDR-Sloma
Copy link

I have the same problem:

Logger: homeassistant.components.xiaomi_miio
Source: components/xiaomi_miio/__init__.py:233
Integration: Xiaomi Miio (documentation, issues)
First occurred: 01:45:10 (1 occurrences)
Last logged: 01:45:10

Unexpected error fetching Roborock S7 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 187, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 147, in _async_update_data
    return await self.update_method()
  File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 253, in update_async
    return await execute_update()
  File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 248, in execute_update
    state = await hass.async_add_executor_job(update)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 233, in update
    device.last_clean_details(),
  File "/usr/local/lib/python3.9/site-packages/miio/click_common.py", line 187, in _wrap
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/miio/integrations/vacuum/roborock/vacuum.py", line 467, in last_clean_details
    return self.clean_details(last_clean_id)
  File "/usr/local/lib/python3.9/site-packages/miio/click_common.py", line 187, in _wrap
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/miio/integrations/vacuum/roborock/vacuum.py", line 476, in clean_details
    details = self.send("get_clean_record", [id_])
  File "/usr/local/lib/python3.9/site-packages/miio/device.py", line 103, in send
    return self._protocol.send(
  File "/usr/local/lib/python3.9/site-packages/miio/miioprotocol.py", line 199, in send
    self.__id = payload["id"]
TypeError: byte indices must be integers or slices, not str

@github-actions
Copy link

github-actions bot commented Apr 8, 2022

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Apr 8, 2022
@github-actions github-actions bot locked and limited conversation to collaborators May 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants