External Integration - Roborock

Hello everyone and @Lokkye in particular.
I was dreaming of testing your Roborock integration… but my device is set up with the Roborock app and not the Xiaomi one (because I found the Roborock app much better at the time).

Do you think it’s possible to evolve this integration to support devices like mine?

In the meantime, a big congratulations on your work!

Hi @guim31, I’ll see if this is possible but I’ll probably need your help to test. I’ll take care of it next week.

Thanks for your reply, I’d be delighted!

I’m also interested in the Roborock config :slight_smile:

I saw that the repo was moving :face_savoring_food: hate

Roborock 2.1.1 :rocket:

I decided to separate the two integrations.

So the Roborock integration is only for users of the Roborock app

https://plus.gladysassistant.com/dashboard/integration/device/external/ext-callemand-gladys-roborock

I was only able to test the connection and not the device addition and control because I don’t have any Roborock devices on my Roborock account

And I just created a new Xiaomi Home integration that currently allows you to control Roborock devices linked to this app, but later, we can add other devices.

https://plus.gladysassistant.com/dashboard/integration/device/external-install/callemand/gladys-xiaomi-home?search=Xia&from=%2Fdashboard%2Fintegration

I’ll test this as soon as possible!!

It’s quite nice but it lacks essential features that HA can do for example.

On roborock you can create routines (shortcuts) with actions like the type of cleaning etc.

Via HA you can launch these routines and currently on gladys you can’t. By the way, there is also a system for mapping rooms between HA and roborock etc. Here’s what I have for example on HA.

Do you think it would be possible to at least have these shortcuts as push buttons on gladys?

It would be necessary to retrieve the Roborock routines during discovery, create a Gladys feature of the push button type for each one, then execute the routine from its identifier when pressed. This would also allow them to be used directly as actions in Gladys scenes.

I forked your repo @Lokkye to add the routines but I’m having a technical issue.

@pierre-gilles I wanted to add the routines available via the API to the robot in push-button mode
I created it like this:

for (const routine of routines) {
features.push({
name: `Routine - ${routine.name}`,
external_id: ids.feature(`${FEATURE_CODES.ROUTINE_PREFIX}${routine.id}`),
read_only: false,
has_feedback: false,
keep_history: false,
min: 0,
max: 1,
category: DEVICE_FEATURE_CATEGORIES.BUTTON,
type: DEVICE_FEATURE_TYPES.BUTTON.PUSH,
});

I actually have a push button that was created (I tested it and my routine starts well)
But when adding it to the dashboard I have this:

Why in the selector do we not have the feature.name but the type of functionality?
In my case, I only have one routine but potentially I could have several.
What should I do in this case?
One device per routine?
Wouldn’t it be better to display the feature.name with the type for this kind of case?

Thanks for your time :slight_smile:

Depending on this, I’ll try to add other features:

etc

And see about room mapping like on HA (to say clean room x in scenes for example?)

I wanted to add the routines available via the API to the robot in push-button mode

@pierre-gilles

In the end, wouldn’t it be the same feature for automatic selection as for LGwebos applications?

Hi @spenceur, hi @Lokkye,

First of all, kudos to both of you: @Lokkye for releasing the two integrations so quickly and without even having the hardware on hand, and @spenceur for going as far as forking with working code. That’s exactly how the ecosystem moves forward :clap:

Regarding your selector issue @spenceur: This is not a bug, and most importantly, it’s not a problem you need to work around in your code.

Two things:

  1. When you add a feature to a dashboard widget, you can give it the name you want directly in the widget editing screen. This name overrides everything else. This is the historical answer to this topic, and it covers your case: you can call your line « Kitchen Cleaning » even if the feature is named differently.
  2. In places where this renaming doesn’t apply (scene selectors, for example), Gladys automatically switches to the feature name as soon as there are multiple of the same type on the same device. If you only saw « Push Button », it’s because you only had one routine; with two or more routines, your names will display automatically. And with just one, there’s no possible ambiguity.

So to answer your question: definitely not one device per routine. Keep everything on a single device, your current code is good.

A small detail by the way: for a push button in actuator mode, use rather min: 1, max: 1 (this is the convention used elsewhere in Gladys). With min: 0, the scene action displays a slider from 0 to 1, which doesn’t make much sense for a button.

A more important point, for both of you: Gladys has had a native VACUUM_CLEANER category in the core for a while now (added for the Matter integration), with the features state, run-mode, clean-mode, and dock, their values, their translations, and dedicated display in the dashboard. It’s in server/utils/constants.js if you want to take a look.

Does the Roborock integration rely on it for basic functions? If so, perfect. If not, it’s really worth switching before going further: without it, a vacuum cleaner brought up by Matter and a vacuum cleaner brought up by Roborock will not be controlled in the same way in the same dashboard, even though it’s the same robot. The routines, on the other hand, remain quite legitimately push buttons.

Regarding room mapping: This is the most interesting request in the topic. Today, all of Gladys’ choice lists (ventilation modes, pilot wire, air conditioning…) are frozen in the code with a translation per value. It can’t accommodate rooms defined by the user in the Roborock app.

In the short term, the solution that already works: one push button feature per room (« Clean - Kitchen », « Clean - Living Room »…). This is directly usable in scenes, and it also solves the name display issue since there are multiple.

Otherwise, I think a special feature type would be needed for this in vacuum cleaners. It’s a core-side project, and it goes far beyond this integration!

Could you create a specific feature request to start development on this topic? :slight_smile:

Keep going, it’s great work :slightly_smiling_face:

I’ll take note of this part, thanks :slight_smile:

@Lokkye I’ll make you a PR as soon as possible

Good evening,

I am currently discovering the Roborock integration, and I thank you for it.

However, I allow myself a few questions: I have a Q7 Max, with mapping function and declaration of zones/rooms, which do not appear in the device properties. So, when I select a cleaning, it’s off for the whole house :slight_smile:

It would also be practical to be able to have the status of the robot (sensors, brushes, etc…).

At your disposal if I can perform other test cases, or others that could help to evolve this integration :slight_smile:

Have a nice end of the day,

Jean

Hi, I started adding the returns from the different sensors.
I also added the dock because it itself has information depending on the vacuum cleaner.

For some features, I went through the unknown category and the unknown type
Until this evolution:


Regarding the room mapping @pierre-gilles, what exactly are you expecting?

Can this request do the trick?

I’m currently watching this from afar because I’m on vacation, but I’m really happy that it’s moving forward!

I think this integration would benefit from offering a start/pause button rather than a dropdown. What do you think, @spenceur? (By the way, I don’t think Pause exists yet)

@guim31 I’m just helping @Lokkye but I’d prefer if he answered you :slight_smile:

Little tease :eyes:

I updated the integration to 0.12

It now supports consumables for the dock and the robot as well as room selection for cleaning

@Lokkye the PR is here, it’s waiting for you :slight_smile: :

This makes me want to get one of these devices…

The thing has always been « there are only cloud devices, you have to choose one that you can flash with Valudeto and what if it fails? »

Now, it’s only the dog hair that scares and tempts me… You know what I mean?

@spenceur Great work, I just merged the PR and the version is in progress. I need to do the same work in the Xiaomi home integration now :slight_smile:

@guim31 Not wrong! I need to figure out how to do it

@GBoulvin Go for it, it’s a game changer on my side. It runs several times a week and I no longer have any problems with hair and other :slight_smile:

@GBoulvin I also add that I have been equipped for several years (first a Roborock S6, then an S8 Ultra) and it runs every day, I have children and cats… and it’s REALLY very useful and effective.