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
72.67k stars 30.42k forks source link

Roborock integration clean room command does not work in a multi-level configuration #99725

Closed glennvlint closed 10 months ago

glennvlint commented 1 year ago

The problem

Following the guide "How can I clean a specific room", one of the necessary steps is to get the id-to-room mapping using the command: get_room_mapping. Currently this command ignores the room parameter and only returns the 2-digit IDs for the active map, which seems to be the map listed at the top in the app. This causes the robot to not be able to clean the segment for which there is no/incorrect room ID in the active map.

I also noticed the Roborock API is returning duplicate 2-digit IDs after changing the current active map (changing the order in de app). This leads me to believe that multi-level room cleaning is simply a limitation by the Roborock API. The only way I could make this work right now is by first changing the top map in the app, and then sending the known room IDs for that map with the app_segment_clean command.

What version of Home Assistant Core has the issue?

core-2023.8.4

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/#how-can-i-clean-a-specific-room

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Rooms output (on integration reload):
rooms=[HomeDataRoom(id=13728944, name='Wc 2'), HomeDataRoom(id=13728841, name='Gang 1'), HomeDataRoom(id=13728838, name='Badkamer 1'), HomeDataRoom(id=13728830, name='Badkamer 2'), HomeDataRoom(id=13728828, name='Gang 2'), HomeDataRoom(id=13682130, name='Hobby'), HomeDataRoom(id=13682129, name='Kamer 2'), HomeDataRoom(id=13682125, name='Kamer 1'), HomeDataRoom(id=13682124, name='Wasplaats'), HomeDataRoom(id=13682074, name='Slaapkamer'), HomeDataRoom(id=13682056, name='Gang'), HomeDataRoom(id=13682053, name='Trap'), HomeDataRoom(id=13682052, name='Bureau'), HomeDataRoom(id=13682051, name='Badkamer'), HomeDataRoom(id=13666200, name='Keuken'), HomeDataRoom(id=13666188, name='Buiten achter'), HomeDataRoom(id=13666183, name='Buiten voor'), HomeDataRoom(id=13666180, name='Buiten zij'), HomeDataRoom(id=13666162, name='Buiten'), HomeDataRoom(id=13666024, name='Eetkamer'), HomeDataRoom(id=13666019, name='Living'), HomeDataRoom(id=13665937, name='Hal'), HomeDataRoom(id=13665935, name='Wc'), HomeDataRoom(id=13665932, name='Berging')]

Output for command get_room_mapping:
2023-09-06 12:33:02.703 DEBUG (MainThread) [roborock.local_api] [Roborock S8 Pro Ultra] id=19108 Response from method get_room_mapping: [[16, '13665932', 12], [17, '13728955', 12], [18, '13666183', 12], [19, '13666180', 12], [20, '13666019', 12], [21, '13665937', 12], [22, '13666200', 12], [23, '13666188', 12], [24, '13666024', 12]]

Additional information

Tested using Roborock S8 Pro Ultra which also seems to use 8 digit IDs instead of 6 digit IDs for each room, but probably irrelevant for this issue.

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

There is a command you can use to change maps if you use "load_multi_map" as the command with the map flag gotten from the command "get_multi_maps_list" to get the multi map id.

It is not an ideal system and it is not perfect - but that is part of what these architecture discussions aim to change: https://github.com/home-assistant/architecture/discussions/913 https://github.com/home-assistant/architecture/discussions/950

Lash-L commented 10 months ago

Closing for now as there is not an issue - but rather just more functionality should be added to the integration - which is on the roadmap.

Lash-L commented 10 months ago

@home-assistant close