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
73.32k stars 30.63k forks source link

Roborock S7 with some issues #94933

Closed solarssk closed 1 year ago

solarssk commented 1 year ago

The problem

When starting the device (to clean the rooms) I notice a very large error dump.

image

What version of Home Assistant Core has the issue?

2023.06.2

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

Roborock

Link to integration documentation on our website

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

Diagnostics information

{ "home_assistant": { "installation_type": "Home Assistant OS", "version": "2023.6.2", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.11.4", "docker": true, "arch": "x86_64", "timezone": "Europe/Warsaw", "os_name": "Linux", "os_version": "6.1.29", "supervisor": "2023.06.2", "host_os": "Home Assistant OS 10.2", "docker_version": "23.0.6", "chassis": "vm", "run_as_root": true }, "custom_components": { "xiaomi_cloud_map_extractor": { "version": "v2.2.0", "requirements": [ "pillow", "pybase64", "python-miio", "requests", "pycryptodome" ] }, "hacs": { "version": "1.32.1", "requirements": [ "aiogithubapi>=22.10.1" ] }, "auth_header": { "version": "1.4", "requirements": [] }, "fullykiosk": { "version": "1.1.0", "requirements": [ "python-fullykiosk==0.0.11" ] }, "browser_mod": { "version": "2.2.2", "requirements": [] }, "powercalc": { "version": "v1.6.6", "requirements": [ "numpy>=1.21.1" ] } }, "integration_manifest": { "domain": "roborock", "name": "Roborock", "codeowners": [ "@humbertogontijo", "@Lash-L" ], "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/roborock", "iot_class": "local_polling", "loggers": [ "roborock" ], "requirements": [ "python-roborock==0.23.4" ], "is_built_in": true }, "data": { "config_entry": { "username": "REDACTED", "user_data": { "uid": "REDACTED", "tokentype": "", "token": "REDACTED", "rruid": "REDACTED", "region": "eu", "countrycode": "48", "country": "PL", "nickname": "Xtx4348691", "rriot": { "u": "7Een72RrMMFneyXoknbBjz", "s": "H93RyT", "h": "5Gvca4qeSy", "k": "hkxDFKFI", "r": { "r": "EU", "a": "https://api-eu.roborock.com", "m": "ssl://mqtt-eu-5.roborock.com:8883", "l": "https://wood-eu.roborock.com" } }, "tuyaDeviceState": 0, "avatarurl": "https://files.roborock.com/iottest/default_avatar.png" }, "base_url": "https://euiot.roborock.com" }, "coordinators": { "REDACTED-0": { "roborock_device_info": { "device": { "duid": "REDACTED", "name": "Roborock S7", "localKey": "REDACTED", "fv": "02.16.12", "activeTime": 1683649941, "timeZoneId": "Europe/Warsaw", "iconUrl": "", "productId": "4oT3mL3dB7GpIS77ZADOLs", "share": false, "online": true, "pv": "1.0", "tuyaMigrated": false, "sn": "R14E5S11803284", "featureSet": "0", "newFeatureSet": "0000000000002000", "deviceStatus": { "121": 8, "122": 100, "123": 102, "124": 203, "125": 98, "126": 96, "127": 95, "120": 0 }, "silentOtaSwitch": false }, "network_info": { "ip": "XXX.XXX.XX.XXX", "ssid": "XXXXXXXXXXXX IoT", "mac": "REDACTED", "bssid": "REDACTED", "rssi": -62 }, "product": { "id": "4oT3mL3dB7GpIS77ZADOLs", "name": "Roborock S7", "model": "roborock.vacuum.a15", "capability": 0, "category": "robot.vacuum.cleaner", "schema": [ { "id": "101", "name": "rpc_request", "code": "rpc_request", "mode": "rw", "type": "RAW" }, { "id": "102", "name": "rpc_response", "code": "rpc_response", "mode": "rw", "type": "RAW" }, { "id": "120", "name": "\u9519\u8bef\u4ee3\u7801", "code": "error_code", "mode": "ro", "type": "ENUM" }, { "id": "121", "name": "\u8bbe\u5907\u72b6\u6001", "code": "state", "mode": "ro", "type": "ENUM" }, { "id": "122", "name": "\u8bbe\u5907\u7535\u91cf", "code": "battery", "mode": "ro", "type": "ENUM" }, { "id": "123", "name": "\u6e05\u626b\u6a21\u5f0f", "code": "fan_power", "mode": "rw", "type": "ENUM" }, { "id": "124", "name": "\u62d6\u5730\u6a21\u5f0f", "code": "water_box_mode", "mode": "rw", "type": "ENUM" }, { "id": "125", "name": "\u4e3b\u5237\u5bff\u547d", "code": "main_brush_life", "mode": "rw", "type": "VALUE" }, { "id": "126", "name": "\u8fb9\u5237\u5bff\u547d", "code": "side_brush_life", "mode": "rw", "type": "VALUE" }, { "id": "127", "name": "\u6ee4\u7f51\u5bff\u547d", "code": "filter_life", "mode": "rw", "type": "VALUE" }, { "id": "128", "name": "\u989d\u5916\u72b6\u6001", "code": "additional_props", "mode": "ro", "type": "RAW" }, { "id": "130", "name": "\u5b8c\u6210\u4e8b\u4ef6", "code": "task_complete", "mode": "ro", "type": "RAW" }, { "id": "131", "name": "\u7535\u91cf\u4e0d\u8db3\u4efb\u52a1\u53d6\u6d88", "code": "task_cancel_low_power", "mode": "ro", "type": "RAW" }, { "id": "132", "name": "\u8fd0\u52a8\u4e2d\u4efb\u52a1\u53d6\u6d88", "code": "task_cancel_in_motion", "mode": "ro", "type": "RAW" }, { "id": "133", "name": "\u5145\u7535\u72b6\u6001", "code": "charge_status", "mode": "ro", "type": "RAW" }, { "id": "134", "name": "\u70d8\u5e72\u72b6\u6001", "code": "drying_status", "mode": "ro", "type": "RAW" } ] }, "props": { "status": { "msgVer": 2, "msgSeq": 1712, "state": 8, "battery": 100, "cleanTime": 1915, "cleanArea": 31150000, "squareMeterCleanArea": 31.1, "errorCode": 0, "mapPresent": 1, "inCleaning": 0, "inReturning": 0, "inFreshState": 1, "labStatus": 1, "waterBoxStatus": 1, "fanPower": 102, "dndEnabled": 0, "mapStatus": 3, "isLocating": 0, "lockStatus": 0, "waterBoxMode": 203, "waterBoxCarriageStatus": 1, "mopForbiddenEnable": 1, "adbumperStatus": [ 0, 0, 0 ], "waterShortageStatus": 0, "dockType": 0, "dustCollectionStatus": 0, "autoDustCollection": 1, "mopMode": 300, "debugMode": 0, "dockErrorStatus": 0, "unsaveMapReason": 0, "unsaveMapFlag": 0 }, "dndTimer": { "startHour": 22, "startMinute": 0, "endHour": 8, "endMinute": 0, "enabled": 0, "startTime": "2023-06-20T22:00:00+02:00", "endTime": "2023-06-21T08:00:00+02:00" }, "cleanSummary": { "cleanTime": 694580, "cleanArea": 5712042500, "squareMeterCleanArea": 5712.0, "cleanCount": 325, "dustCollectionCount": 0, "records": [ 1687258801, 1687172399, 1687086001, 1686999601, 1686913201, 1686826801, 1686662194, 1686560499, 1686555436, 1685896707, 1685530601, 1685283337, 1685281937, 1685016357, 1684917546, 1684860899, 1684431831, 1684418765, 1684415045, 1684061220 ] }, "consumable": { "mainBrushWorkTime": 40020, "sideBrushWorkTime": 40020, "filterWorkTime": 40020, "filterElementWorkTime": 0, "sensorDirtyTime": 40020, "dustCollectionWorkTimes": 0, "mainBrushTimeLeft": 1039980, "sideBrushTimeLeft": 679980, "filterTimeLeft": 499980, "sensorTimeLeft": 67980 }, "lastCleanRecord": { "begin": 1687258801, "end": 1687260716, "duration": 1915, "area": 31150000, "squareMeterArea": 31.1, "error": 0, "complete": 1, "startType": 2, "cleanType": 1, "finishReason": 52, "dustCollectionStatus": 0 } } }, "api": { "get_dnd_timer": { "params": [], "response": { "start_hour": 22, "start_minute": 0, "end_hour": 8, "end_minute": 0, "enabled": 0 }, "error": null }, "get_clean_summary": { "params": [], "response": { "clean_time": 694580, "clean_area": 5712042500, "clean_count": 325, "dust_collection_count": 0, "records": [ 1687258801, 1687172399, 1687086001, 1686999601, 1686913201, 1686826801, 1686662194, 1686560499, 1686555436, 1685896707, 1685530601, 1685283337, 1685281937, 1685016357, 1684917546, 1684860899, 1684431831, 1684418765, 1684415045, 1684061220 ] }, "error": null }, "get_consumable": { "params": [], "response": { "main_brush_work_time": 40020, "side_brush_work_time": 40020, "filter_work_time": 40020, "filter_element_work_time": 0, "sensor_dirty_time": 40020, "dust_collection_work_times": 0 }, "error": null }, "unknown": { "params": null, "response": null, "error": null }, "get_status": { "params": [], "response": { "msg_ver": 2, "msg_seq": 1712, "state": 8, "battery": 100, "clean_time": 1915, "clean_area": 31150000, "error_code": 0, "map_present": 1, "in_cleaning": 0, "in_returning": 0, "in_fresh_state": 1, "lab_status": 1, "water_box_status": 1, "fan_power": 102, "dnd_enabled": 0, "map_status": 3, "is_locating": 0, "lock_status": 0, "water_box_mode": 203, "water_box_carriage_status": 1, "mop_forbidden_enable": 1, "adbumper_status": [ 0, 0, 0 ], "water_shortage_status": 0, "dock_type": 0, "dust_collection_status": 0, "auto_dust_collection": 1, "mop_mode": 300, "debug_mode": 0, "dock_error_status": 0, "unsave_map_reason": 0, "unsave_map_flag": 0 }, "error": null }, "get_clean_record": { "params": [ 1687258801 ], "response": { "begin": 1687258801, "end": 1687260716, "duration": 1915, "area": 31150000, "error": 0, "complete": 1, "start_type": 2, "clean_type": 1, "finish_reason": 52, "dust_collection_status": 0 }, "error": null }, "get_child_lock_status": { "params": [], "response": { "lock_status": 0 }, "error": null }, "get_flow_led_status": { "params": [], "response": { "status": 1 }, "error": null }, "app_start": { "params": [], "response": null, "error": null }, "set_water_box_custom_mode": { "params": [ 200 ], "response": null, "error": null } } } } } }

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.helpers.entity
Source: components/roborock/device.py:37 
First occurred: June 16, 2023 at 3:41:56 AM (223 occurrences) 
Last logged: 1:15:59 PM

Update for switch.roborock_s7_child_lock fails
Update for switch.roborock_s7_status_indicator_light fails
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/roborock/local_api.py", line 64, in async_connect
    self.transport, _ = await self.loop.create_connection(  # type: ignore
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1069, in create_connection
    sock = await self._connect_sock(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 973, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 634, in sock_connect
    return await fut
           ^^^^^^^^^
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/roborock/local_api.py", line 62, in async_connect
    async with async_timeout.timeout(QUEUE_TIMEOUT):
  File "/usr/local/lib/python3.11/site-packages/async_timeout/__init__.py", line 129, in __aexit__
    self._do_exit(exc_type)
  File "/usr/local/lib/python3.11/site-packages/async_timeout/__init__.py", line 212, in _do_exit
    raise asyncio.TimeoutError
TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/roborock/device.py", line 35, in send
    response = await self._api.send_command(command, params)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/roborock/local_api.py", line 133, in send_command
    response = (await self.send_message(roborock_message))[0]
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/roborock/local_api.py", line 190, in send_message
    await self.validate_connection()
  File "/usr/local/lib/python3.11/site-packages/roborock/api.py", line 197, in validate_connection
    await self.async_connect()
  File "/usr/local/lib/python3.11/site-packages/roborock/local_api.py", line 70, in async_connect
    raise RoborockConnectionException(f"Failed connecting to {self.host}") from e
roborock.exceptions.RoborockConnectionException: Failed connecting to 192.168.162.77

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 559, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 784, in async_device_update
    await self.async_update()
  File "/usr/src/homeassistant/homeassistant/components/roborock/switch.py", line 152, in async_update
    await self.entity_description.get_value(self)
  File "/usr/src/homeassistant/homeassistant/components/roborock/device.py", line 37, in send
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Error while calling GET_CHILD_LOCK_STATUS with None

***********

Logger: homeassistant.helpers.entity
Source: components/roborock/switch.py:69 
First occurred: June 16, 2023 at 4:42:40 PM (2 occurrences) 
Last logged: 1:15:55 PM

Update for switch.roborock_s7_status_indicator_light fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 559, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 784, in async_device_update
    await self.async_update()
  File "/usr/src/homeassistant/homeassistant/components/roborock/switch.py", line 151, in async_update
    self._attr_is_on = self.entity_description.evaluate_value(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/roborock/switch.py", line 69, in <lambda>
    evaluate_value=lambda data: data["status"] == 1,
                                ~~~~^^^^^^^^^^
KeyError: 'status'

***********

Logger: homeassistant
Source: /usr/src/homeassistant/homeassistant/runner.py:137 
First occurred: June 16, 2023 at 4:42:40 PM (8 occurrences) 
Last logged: 1:15:55 PM

Error doing job: Exception in callback Future.set_result(({'status': 1}, None))
Error doing job: Exception in callback Future.set_result(({'dust_collection_work_times': 0, 'filter_element_work_time': 0, 'filter_work_time': 34952, 'main_brush_work_time': 34952, ...}, None))
Error doing job: Exception in callback Future.set_result(({'dust_collection_work_times': 0, 'filter_element_work_time': 0, 'filter_work_time': 36461, 'main_brush_work_time': 36461, ...}, None))
Error doing job: Exception in callback Future.set_result(({'dust_collection_work_times': 0, 'filter_element_work_time': 0, 'filter_work_time': 36605, 'main_brush_work_time': 36605, ...}, None))
Error doing job: Exception in callback Future.set_result((None, None))
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
asyncio.exceptions.InvalidStateError: invalid state

Additional information

Router: Mikrotik RB3011 (Main VLAN for everyone in house + separated VLAN for IoT) AP: Ubiquiti Unifi UAP-AC-Lite Hardware: Synology DS920+ (HA OS on Virtual Machine) Home Assistant OS has two virtual network cards connected (first for main LAN and second VLAN IoT) in VM.

home-assistant[bot] commented 1 year ago

Hey there @humbertogontijo, @lash-l, mind taking a look at this issue as it has been labeled with an integration (roborock) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `roborock` 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 roborock` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


roborock documentation roborock source (message by IssueLinks)

Lash-L commented 1 year ago

Gotcha - I think the problem is that I use send_command() on the api, rather than send() on the entity and it isn't error catching correctly. I should be able to fix this, but we are currently going through a rather large backend change, so it will have to be once that is finished

solarssk commented 1 year ago

No problem! :) thanks!

Lash-L commented 1 year ago

Are you still have these issues in 2023.7?

solarssk commented 1 year ago

These no, only:

2023-07-10 23:50:19.398 WARNING (MainThread) [roborock.api] [Errno 104] Connection reset by peer
2023-07-10 23:52:04.785 ERROR (MainThread) [homeassistant.components.roborock.coordinator] Error fetching roborock data: id=18514 Timeout after 4 seconds
2023-07-10 23:52:51.399 WARNING (MainThread) [roborock.api] [Errno 104] Connection reset by peer
2023-07-10 23:53:12.382 ERROR (MainThread) [roborock.local_api] id=1 Timeout after 4 seconds
2023-07-10 23:55:58.750 ERROR (MainThread) [homeassistant.components.roborock.coordinator] Error fetching roborock data: id=14976 Timeout after 4 seconds
2023-07-10 23:56:50.241 WARNING (MainThread) [roborock.api] [Errno 104] Connection reset by peer
2023-07-11 03:41:47.283 ERROR (MainThread) [homeassistant.components.roborock.coordinator] Error fetching roborock data: Failed connecting to 192.168.162.77
2023-07-11 04:11:26.039 ERROR (MainThread) [homeassistant.components.roborock.coordinator] Error fetching roborock data: id=18944 Timeout after 4 seconds
2023-07-11 04:25:41.295 ERROR (MainThread) [homeassistant.components.roborock.coordinator] Error fetching roborock data: id=18269 Timeout after 4 seconds
2023-07-11 05:30:07.284 ERROR (MainThread) [homeassistant.components.roborock.coordinator] Error fetching roborock data: id=13710 Timeout after 4 seconds
2023-07-11 08:56:17.283 ERROR (MainThread) [homeassistant.components.roborock.coordinator] Error fetching roborock data: id=31659 Timeout after 4 seconds
2023-07-11 09:05:23.284 ERROR (MainThread) [homeassistant.components.roborock.coordinator] Error fetching roborock data: id=24672 Timeout after 4 seconds