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

Add support for Roborock S6 MaxV #92142

Closed
RubenKelevra opened this issue Apr 27, 2023 · 36 comments · Fixed by #92547
Closed

Add support for Roborock S6 MaxV #92142

RubenKelevra opened this issue Apr 27, 2023 · 36 comments · Fixed by #92547

Comments

@RubenKelevra
Copy link

RubenKelevra commented Apr 27, 2023

The problem

While setting up my Roborock S6 MaxV I got the following error message in the UI:

Retrying setup: 207 is not a valid RoborockMopIntensityCode

The mop intensity can be switched to certain presets and also to a manual slider. I use the manual slider:

Screenshot_2023-04-27-22-06-57-913-edit_com roborock smart

What version of Home Assistant Core has the issue?

2023.5 beta

What was the last working version of Home Assistant Core?

none

What type of installation are you running?

Home Assistant OS

Integration causing the issue

roborock

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.roborock.coordinator
Source: components/roborock/coordinator.py:67
Integration: Roborock (documentation, issues)
First occurred: 23:01:06 (7 occurrences)
Last logged: 23:05:32

Unexpected error fetching roborock data: 207 is not a valid RoborockMopIntensityCode
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/components/roborock/coordinator.py", line 77, in _async_update_data
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/components/roborock/coordinator.py", line 67, in _update_device_prop
    device_prop = await self.api.get_prop(device_info.device.duid)
  File "/usr/local/lib/python3.10/site-packages/roborock/api.py", line 276, in get_prop
    [status, dnd_timer, clean_summary, consumable] = await asyncio.gather(
  File "/usr/local/lib/python3.10/site-packages/roborock/api.py", line 179, in get_status
    return Status.from_dict(status)
  File "/usr/local/lib/python3.10/site-packages/roborock/containers.py", line 45, in from_dict
    return from_dict(cls, decamelize_obj(data), config=Config(cast=[Enum]))
  File "/usr/local/lib/python3.10/site-packages/dacite/core.py", line 64, in from_dict
    value = _build_value(type_=field_type, data=field_data, config=config)
  File "/usr/local/lib/python3.10/site-packages/dacite/core.py", line 95, in _build_value
    data = _build_value_for_union(union=type_, data=data, config=config)
  File "/usr/local/lib/python3.10/site-packages/dacite/core.py", line 113, in _build_value_for_union
    return _build_value(type_=types[0], data=data, config=config)
  File "/usr/local/lib/python3.10/site-packages/dacite/core.py", line 105, in _build_value
    data = type_(data)
  File "/usr/local/lib/python3.10/enum.py", line 385, in __call__
    return cls.__new__(cls, value)
  File "/usr/local/lib/python3.10/enum.py", line 710, in __new__
    raise ve_exc
ValueError: 207 is not a valid RoborockMopIntensityCode

Additional information

No response

@home-assistant
Copy link

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
Copy link
Contributor

Lash-L commented Apr 27, 2023

Are the first four modes "off", "mild", "moderate", and "intense?"

I'm surprised we haven't run into this issue before.

@Lash-L
Copy link
Contributor

Lash-L commented Apr 27, 2023

If you were to change to one of the lower modes, will it let you set up?

@humbertogontijo
Copy link
Contributor

Isn't the message correct? Looks like you set up a custom slider with invalid values.
Is this a standard card?

@Lash-L
Copy link
Contributor

Lash-L commented Apr 27, 2023

@humbertogontijo I believe that is inside the Roborock App. I've never see it have so few options before, just General and Customize

@humbertogontijo
Copy link
Contributor

@Lash-L If you have a fix for it you can revert version 8.2 as you mentioned. And release a new one

@RubenKelevra
Copy link
Author

@Lash-L wrote

I believe that is inside the Roborock App. I've never see it have so few options before, just General and Customize

That's correct. This is the bottom popup which opens if I select the button on the bottom right:

Screenshot_2023-04-27-23-12-39-876-edit_com roborock smart

@RubenKelevra
Copy link
Author

@Lash-L wrote:

Are the first four modes "off", "mild", "moderate", and "intense?"

They are "Close", "Low", "Medium" and "High".

And for the custom slider:

1-6 are called "Tiny"
7 is called "Small"
8-15 is called "Relatively small"
16 is called "Medium"
17-26 is "Relatively large"
27 is called "Large"
28-30 is called "Very large"

So I assume that 7, 16 and 27 are equal to the normal presets.

@RubenKelevra
Copy link
Author

I've tried setting it to other numbers, including 16 and 27. And it always shows the code 207 in the HA UI.

So the code 207 seems to state, that “custom” is selected. The actual value selected seems to be stored somewhere else.

@Lash-L
Copy link
Contributor

Lash-L commented Apr 27, 2023

Very odd - your settings are completely different from the other Roborocks we have worked with (Edit seems below s7 may follow this pattern). We will have to do something special for the s6 maxv i supposed. Your vacuum always worked like this I assume? You didn't change anything?

Can you send me a screenshot of what the Customize page looks like?

And are you vacuum modes something along these lines?

        105: "off",
        101: "silent",
        102: "balanced",
        103: "turbo",
        104: "max",
        108: "max_plus",
        106: "custom",

@RubenKelevra
Copy link
Author

RubenKelevra commented Apr 27, 2023

Your vacuum always worked like this I assume?

No. When I got it it just had the normal presets. They later added the "custom" button with the slider.

You didn't change anything?

Not sure what you mean... I've used the Vacuum a while with the Roborock app, then I started with HA and had to switch to the "Xiaomi Home" app.

Now I wanna switch back and installed the Roborock app again.

Can you send me a screenshot of what the Customize page looks like?

Sure:

Screenshot_2023-04-28-00-22-31-333-edit_com roborock smart

(Yes there's really no slider for the custom level there - the custom level can only be set outside of the Customize page, and then used there)

@RubenKelevra
Copy link
Author

RubenKelevra commented Apr 27, 2023

@Lash-L wrote:

And are you vacuum modes something along these lines?

        105: "off",
        101: "silent",
        102: "balanced",
        103: "turbo",
        104: "max",
        108: "max_plus",
        106: "custom",

Well, they is "Gentle" (which is not completely off and marked for "single use only" - like the "Close" level for the mop). The rest is: Quite, Balanced, Turbo and Max.

@Lash-L
Copy link
Contributor

Lash-L commented Apr 27, 2023

@home-assistant rename Add support for Roborock S6 MaxV

@home-assistant home-assistant bot changed the title Roborock setup issue: "207 is not a valid RoborockMopIntensityCode" Add support for Roborock S6 MaxV Apr 27, 2023
@Lash-L
Copy link
Contributor

Lash-L commented Apr 27, 2023

Okay if I have time tomorrow I will try to add functionality for this vacuum - I'm not sure if this will be included in the official release Wednesday - but I will try to get it done

You don't happen to have a mac + an iphone do you?

We have a method of 'recording' actions in the roborock app but it is only functional for iphones and macs, would make my life a good bit easier trying to add support

@RubenKelevra
Copy link
Author

@Lash-L wrote:

If you were to change to one of the lower modes, will it let you set up?

A bit hard to test, as HA just locks up after some minutes since I've updated to the 23.5 beta.

But no it does not. It logs a warning and an error and shows an error in the UI:

Logger: roborock.cloud_api
Source: runner.py:179
First occurred: 01:34:50 (6 occurrences)
Last logged: 01:36:10

Roborock mqtt client disconnected (rc: 0)
Logger: homeassistant.components.roborock.coordinator
Source: components/roborock/coordinator.py:67
Integration: Roborock
First occurred: 01:34:50 (6 occurrences)
Last logged: 01:36:10

Unexpected error fetching roborock data: name
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/components/roborock/coordinator.py", line 77, in _async_update_data
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/components/roborock/coordinator.py", line 67, in _update_device_prop
    device_prop = await self.api.get_prop(device_info.device.duid)
  File "/usr/local/lib/python3.10/site-packages/roborock/api.py", line 289, in get_prop
    dock_summary = await self.get_dock_summary(device_id, status.dock_type)
  File "/usr/local/lib/python3.10/site-packages/roborock/api.py", line 251, in get_dock_summary
    if RoborockDockTypeCode.name != "RoborockDockTypeCode":
  File "/usr/local/lib/python3.10/enum.py", line 437, in __getattr__
    raise AttributeError(name) from None
AttributeError: name

You don't happen to have a mac + an iphone do you?

Nope, just Linux and Android here.

I'm not sure if this will be included in the official release Wednesday - but I will try to get it done

At least don't crash with the value would be enough, I guess :)

@Lash-L
Copy link
Contributor

Lash-L commented Apr 28, 2023

A bit hard to test, as HA just locks up after some minutes since I've updated to the 23.5 beta.

I'd just remove the Roborock integration for now. I'll let you know when I have something resembling a fix

At least don't crash with the value would be enough, I guess :)

Haha that should be coming. I'll let you know. It should theoretically start returning "unknown" whenever there is data it doesn't have mapped. I'll keep you updated

@Lash-L Lash-L mentioned this issue Apr 28, 2023
20 tasks
@Lash-L
Copy link
Contributor

Lash-L commented Apr 28, 2023

Okay PR is up. Fingers crossed it will get merged and will be included in beta2.

@RubenKelevra
Copy link
Author

@Lash-L someone else noticed that HA will lock up:

#92148

@Lash-L
Copy link
Contributor

Lash-L commented Apr 28, 2023

Commented on there as well. Thanks for pointing it out to me @RubenKelevra not sure why I didn't originally get notified for it

@Lash-L
Copy link
Contributor

Lash-L commented Apr 28, 2023

@RubenKelevra please try the latest beta (b2) and let me know if you're still crashing

@RubenKelevra
Copy link
Author

Hey @Lash-L,

thanks for the work. Setup can now complete with the Roborock set to "custom" mode for the mopping intensity.

However the mode for mopping as well as the intensity are not populated:

Screenshot_2023-04-29-04-50-13-791-edit_io.homeassistant.companion.android.jpg

I think mop mode is not available on the S6 MaxV (at least never heard of that) so I guess it should be hidden.

intensity is weirdly named, as its the water level. HA is also configured to be English as well as my phone, but the naming here is German (guess the Roborock account is set to German) including the naming of the entity:

Screenshot_2023-04-29-04-53-48-312-edit_io.homeassistant.companion.android.jpg

I would recommend to use English entity names, to avoid that scripting etc. has to be adopted to different entity names.

@RubenKelevra
Copy link
Author

Ah I see, the "Wisch Intensität" (Mop intensity?) is set to custom if the per room function is used in the Roborock.

I would avoid this, as its a name clash.

Maybe use something like "per Room" and for the "Custom" level with the slider "User profile" or similar.

@Lash-L
Copy link
Contributor

Lash-L commented Apr 29, 2023

However the mode for mopping as well as the intensity are not populated:

This is to be expected right now. I'm working on adding support for specific models that have different options. Right now this solution was just to get it so you wouldn't crash.

I would recommend to use English entity names

All entities are in english the device itself gets its name directly from Roborock. You can change that in your Roborock's apps settings

Maybe use something like "per Room" and for the "Custom" level with the slider "User profile" or similar.

When the fine-tuned support comes out, it will only populate selects and other entities based on what the vacuum supports, it will be better named.

@RubenKelevra
Copy link
Author

Choosing max_plus makes the robot turn off it's vacuum and the app to go "off the charts:

Screenshot_2023-04-29-05-09-25-513-edit_io.homeassistant.companion.android.jpg

Screenshot_2023-04-29-05-08-20-118-edit_com.roborock.smart.jpg

@RubenKelevra
Copy link
Author

Another issue: Setting the vacuum to custom does nothing, only if I also set the mop intensity to custom the vacuum is switched.

Same the other way around: If set to Max, while in custom the vacuum stays in custom until I switch the mop intensity to something different.

I would recommend to make a bool which enables/disables "per Room" (custom) and if disabled the levels chosen in the settings get pushed.

@RubenKelevra
Copy link
Author

There's also no action for "per Room" cleaning offered in the device's actions. Is that a S6 MaxV bug, or a general limitation?

@Lash-L
Copy link
Contributor

Lash-L commented Apr 29, 2023

Choosing max_plus makes the robot turn off it's vacuum and the app to go "off the charts:

Just from a quick glance of my changes on my side adding the functionality to support your device - these modes that you have on yours correspond to the following modes in the ui. (Yours will directly correspond to your modes in the future)

silent = silent
balanced = standard
turbo = medium
max = turbo
gentle = off
auto = does not exist

And for mopping intesnity - all should work right now except for your custom/levels.

There's also no action for "per Room" cleaning offered in the device's actions. Is that a S6 MaxV bug, or a general limitation?

Kind of both

@frenck frenck added this to the 2023.5.0 milestone Apr 29, 2023
@tinkerberlin
Copy link

Awesom job @Lash-L ! May I ask, are you looking to enable room selection capabilities within HA? So that I can say "clean the kitchen" in HA and have the vaccume clean, well, the kitchen? The kitchen area would be determined in the Roborock app. Alternatively, having the ability to create "zones" in HA for the vaccume would be great (and naming the zones "kitchen", "living room", etc). That's kinda how the "old" Xiaomi integration solved this, if I'm not mistaken (plus it had the camera extractor, etc.) :-) Not complaining at all!! Just curious as to the roadmap for this integration. :-)

@Lash-L
Copy link
Contributor

Lash-L commented Apr 29, 2023

Room selection cleaning is something we are actively working on. We have been trying to find an approach that works with HA. We have the room mapping and the functionality, we just need to figure out the best way to do it.

Camera extractor will be coming in the future (both map and probably the actual camera as well)

I may throw together an actual roadmap to show what features will be added at some point

@tinkerberlin
Copy link

AMAZING! Thank you 👍

@Lash-L
Copy link
Contributor

Lash-L commented Apr 29, 2023

@tinkerberlin or anyone else who has a vacuum that is not fully supported

If you would like to help out with features by providing information about what functionality you have,

Please check here humbertogontijo/homeassistant-roborock#261

This is my current task and will be taking up most of my time until I fix it

@Lash-L
Copy link
Contributor

Lash-L commented May 4, 2023

My latest PR will add this support :)

It cannot add water levels yet as I need to do another PR to add a number platform - but I will add that in the future

@crafty184
Copy link

Came here to see if rooms support was coming, glad to see it is. I can't wait to be able to have it automatically vaccuum two rooms each time I leave the house (as an automation). Just for the record, I always intended to get this integration set up through the Xiomi process but never did, am SO GLAD you integrated this in such an easy way now. Thank you for your work.

@Lash-L
Copy link
Contributor

Lash-L commented May 5, 2023

So the downside to room mapping -

There is not a conceptual way in home assistant (that I have come across) that allows for selecting multiple items.

So room mapping will support cleaning one room at a time with a select entity, but then multiple at a time with the services(but you have to reference them by their id and not their name which is annoying

@tinkerberlin
Copy link

Couldn't one have it, where I can (as the user) create a helper or group that combines the individual room selection entities? So for example, if I have the kitchen, the living room, and the downstairs bathroom in the first floor of my building (ground floor) then I could combine those three "entities" into a "downstairs" entity and have the vaccume reference that entity and do all three in sequence?

It wouldn't achieve what is possible through the Roborock app - i.e. determine which room to do first based on restrictions on mopping etc. but it would be a start, no?

But this might just not be possible - not that much of a coding wiz.

thanks for your work!

@tinkerberlin
Copy link

That said: Even just being able to do one room at a time would already be great! Frankly I either do all rooms or one specific room, so this would cover most of - at least my - use-cases.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants