Roborock binding for robot vacuum cleaners [5.0.0.0;5.1.0.0)

@Paul_Smedley

Do you have any idea how to pause and continue a routine?

If I pause/continue via actions#commands channel it pauses and then starts a whole new “vacuum” of whole appartement.

I just want to continue the previously started routine.

I’m using a Qrevo Slim

Thanks!

I’ll take a look at python-roborock and see how it’s handled.

I assume this works in the app? We currently just sent COMMAND_APP_PAUSE

Thank you!

The pause command works. The vacuum cleaner just stops in the middle of the cleaning process.

I miss something like a “continue” command to continue the process again.

In the app it works yes.

Best regards

Can you try sending an appRoomResume command and see if that does the trick? I should be able to make the ‘Pause’ button confirm the State of the vacuum and use resume if the vac is paused.

Also that state-id = 10 / Paused when the vacuum is Paused.

I will try that and give feedback, thank you!

Is there also something like “appRoutineResume”? I usually use routines.

Where can I find a list of these commands. Then I may explore it myself as well.

Thanks again

I found that command in Hubitat/roborockRobotVacuum/roborockRobotVacuum.groovy at main · bloodtick/Hubitat · GitHub

There are also some resume commands listed in python-roborock/roborock/roborock_typing.py at 3d95a17ab80e84410aa174db663c434e05485969 · Python-roborock/python-roborock · GitHub

A simple app_resume might also work….

app_resume appears to do the trick. I’ll try get this working properly tomorrow.

Hi, first of all thanks a lot fot the awesome binding. I am using it with a Qrevo Edge. I was wondering whether it is possible to start a cleaning run with just vaccuuming (no moping).

app_resume does exactly what I was looking for. Thanks for the support!

You should be able to do this with Routines. On my Qrevo S there is a routine ‘Intensive Sweeping’ that I use when I just want to Vac.

Cool! I’ll look to fix this properly today, ie so that Pause sends app_pause if the vac is running, and app_resume if the state = Paused

Thanks. So how do I start routines using the binding? I didn’t find any obvious commmand in the documentation.

If supported, you’ll have the following channels available:

actions#routine

info#routine-mapping

info#routine-mapping will be a string like: {“10610107”:“Deep”,“10610105”:“Vac followed by Mop”,“10610109”:“Deep+”,“10610111”:“Intensive Sweeping”}

send the ‘number’ corresponding to the routine to actions#routine.

The login-fix PR just got approved, and should make it into 5.1.M4

I didn’t get time this weekend to look at pause/resume, but it should be a simple fix so will try get it in as a bugfix, looks like I have til Friday

1 Like

awesome, works like a charm :slight_smile: Thanks a lot :slight_smile:

BTW:I do not see these channels in the UI. Is there a way to get the complete set of available channels?

Have you ticked the ‘Show Advanced’ checkbox in the UI?

No, I missed that. Now I am seeing the channels (and many more). Thanks :slight_smile:

1 Like

FYI I have a small javascript rule that updates the command options of the actions routine item. This will make it possible to easily select the routines you created in your app via dropdown.

@Paul_Smedley maybe it’s a nice feature to implement this directly for the item linked to actions#routine channel. Sonos binding does something similar with favorite channel.

Items:

String                  actionRoutine         "Start Vacuum Routine"                                                         {channel="roborock:vacuum:account:xyz:actions#routine"}

String                  infoRoutineMapping    "Routine Mapping"                                     (gVacInfo)         {channel="roborock:vacuum:account:xyz:info#routine-mapping"}

Rule:

rules.JSRule({
  name: "Roborock - Update command options of action routine item",
  description:
    "This rule sets and updates the command options of the roborock action routine item to the routines set in the app when they are updated in the app",
  triggers: [triggers.ItemStateUpdateTrigger("infoRoutineMapping")],
  execute: (event) => {
    const actionRoutineItem = items.getItem("actionRoutine");

    try {
      // string from item: e.g. { "6264197": "routine 1", "6363070": "routine 2" }
      const options = Object.entries(
        JSON.parse(items.getItem("infoRoutineMapping").state),
      )
        .map(([routineId, routineName]) => `${routineId}=${routineName}`)
        .join(",");

      // update command options
      actionRoutineItem.replaceMetadata("commandDescription", " ", {
        options: options,
      });
    } catch (error) {
      console.error(error);
    }
  },
  tags: [],
  id: "update_roborock_action_routine_options",
});

That looks cool - are you able to give me more context as to where in Sonos this is? I can go search for the code.

I think might be the Sonos code: openhab-addons/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/handler/ZonePlayerHandler.java at ee974395a8a4e81e7d8a54015de9b617671d8472 · psmedley/openhab-addons · GitHub

I’m not familiar with the code but that looks pretty much like the place in the code.

It’s basically about the channel with id “favorite”. If you link a string item to it then the item will automatically get the favorites defined in sonos app assigned as command options.