Roborock binding for robot vacuum cleaners [5.0.0.0;5.1.0.0)

Hi,

first of all: thank you for all the effort!
I noticed the Binding and was very excited to try it out. It would really be great.
But somehow i cant get it to work.

For some context: I have Openhab 5 running in a Docker container

I installed the binding and added the account thing. So far it worked. The roborockapp even notified me about the new login.

If i press the scan button the progress bar moves and then nothing happens. In the log i see the following:
“17:11:54.924”,“ERROR”,“org.openhab.core.config.discovery.internal.DiscoveryServiceRegistryImpl”,“Cannot trigger scan for thing types ‘[roborock:vacuum, roborock:account]’ on ‘RoborockVacuumDiscoveryService’!”

Aditional info:

Level

ERROR

Logger Class

org.openhab.core.config.discovery.internal.DiscoveryServiceRegistryImpl


Message

Cannot trigger scan for thing types '[roborock:vacuum, roborock:account]' on 'RoborockVacuumDiscoveryService'!


Stack Trace

com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 120 path $.data.deviceListOrder

See https://github.com/google/gson/blob/main/Troubleshooting.md#unexpected-json-structure

at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:520)

at 

Any help is highly appreciated
Greetings

Thanks for testing. Increase logging to trace for the roborock binding and try again. I need to see the full log.

Edit: I was able to reproduce here if I hit Scan straight after creating the Account Thing. If I wait a short while after creating the Thing, the robots appear in the Inbox. I understand why this is the case - it’s a timing thing with the initAPI() function not having been run yet. I’ll fix when I get a moment.

I’m having issues right now building a .jar that’s compatible with OH 5.0 :frowning:

Building with just ‘mvn clean install’ results in a jar that won’t load due to not having the right gson version; building with OH 5.0 compatability is failing.

Hey Paul, thanks for your fix. I can confirm, that it works.

I used this syntax:

items.getItem('Execute_Command').sendCommand('app_segment_clean,[{"segments": [1,3], "repeat": 2}]');

We do not need an escaping of the inner squared brackets.

Thanks :slight_smile:

Heads up to folks, as the review process of the PR has commenced, there will be some BREAKING changes in the next build. You will need to remove the Account and Vacuum things and re-configure. Unless there are any serious bugs, I won’t do any more public releases until things are stabilised to avoid people having to reconfigure twice.

2 Likes

I saw this in my logs a couple days ago. I’m not sure what caused the name resolution issue, but it was only temporary. I had to restart the binding to get it working again.

2025-09-03 02:10:38.773 [WARN ] [b.binding.roborock.internal.RoborockAccountHandler] - MQTT connection lost: Connection lost. Automatic reconnect is enabled.
2025-09-03 02:10:40.298 [DEBUG] [b.binding.roborock.internal.RoborockAccountHandler] - MQTT connection established. Reconnect: true, Server URI: ssl://mqtt-us.roborock.com:8883
2025-09-03 02:10:40.320 [DEBUG] [b.binding.roborock.internal.RoborockAccountHandler] - Subscribed to topic rr/m/o/5h3clpsfZdaHPeMc7GwL7h/c5c6a6ec/#
2025-09-03 02:12:40.201 [WARN ] [b.binding.roborock.internal.RoborockAccountHandler] - MQTT connection lost: Connection lost. Automatic reconnect is enabled.
2025-09-03 02:12:41.695 [DEBUG] [b.binding.roborock.internal.RoborockAccountHandler] - MQTT connection established. Reconnect: true, Server URI: ssl://mqtt-us.roborock.com:8883
2025-09-03 02:12:41.718 [DEBUG] [b.binding.roborock.internal.RoborockAccountHandler] - Subscribed to topic rr/m/o/5h3clpsfZdaHPeMc7GwL7h/c5c6a6ec/#
2025-09-03 02:13:38.691 [DEBUG] [ab.binding.roborock.internal.RoborockVacuumHandler] - Running pollData for: 7XHY0nuRvSJEqYBJDn4meY
2025-09-03 02:13:38.691 [DEBUG] [enhab.binding.roborock.internal.RoborockWebTargets] - Calling url: https://usiot.roborock.com/api/v1/getHomeDetail
2025-09-03 02:13:48.703 [DEBUG] [ab.binding.roborock.internal.RoborockVacuumHandler] - Bridge status changed to OFFLINE (CONFIGURATION_ERROR): Error java.net.UnknownHostException: usiot.roborock.com:
Temporary failure in name resolution
2025-09-03 02:26:57.072 [DEBUG] [.internal.discovery.RoborockVacuumDiscoveryService] - Starting device discovery
2025-09-03 02:26:57.072 [DEBUG] [enhab.binding.roborock.internal.RoborockWebTargets] - Calling url: https://usiot.roborock.com/api/v1/getHomeDetail
2025-09-03 02:26:57.531 [DEBUG] [enhab.binding.roborock.internal.RoborockWebTargets] - Calling url: https://api-us.roborock.com/v3/user/homes/1501342
2025-09-03 02:56:57.831 [DEBUG] [.internal.discovery.RoborockVacuumDiscoveryService] - Starting device discovery
2025-09-03 02:56:57.831 [DEBUG] [enhab.binding.roborock.internal.RoborockWebTargets] - Calling url: https://usiot.roborock.com/api/v1/getHomeDetail
2025-09-03 02:56:58.341 [DEBUG] [enhab.binding.roborock.internal.RoborockWebTargets] - Calling url: https://api-us.roborock.com/v3/user/homes/1501342
2025-09-03 03:26:58.708 [DEBUG] [.internal.discovery.RoborockVacuumDiscoveryService] - Starting device discovery
2025-09-03 03:26:58.708 [DEBUG] [enhab.binding.roborock.internal.RoborockWebTargets] - Calling url: https://usiot.roborock.com/api/v1/getHomeDetail
2025-09-03 03:26:59.313 [DEBUG] [enhab.binding.roborock.internal.RoborockWebTargets] - Calling url: https://api-us.roborock.com/v3/user/homes/1501342

Interesting, I can’t say I’ve seen that here.

First time I saw it as well. I think there was a hiccup in my Internet connection that caused a DNS lookup failure.

The question is whether this failure should cause the binding’s scheduled job to end. Since it is potentially a temporary failure, I would argue that the scheduled job should continue to run. One of two things will happen… The problem will clear on the next scheduled run, or the problem will persist causing the user to investigate the reason why the bridge thing is OFFLINE.

WDYT?

I don’t disagree, I’ll have to look at the code. I think I got paranoid with the roborock mqtt server banning the token and potentially the IP for repeated failed calls, that I may have gone too far the other way in going offline as a precaution.

2025-09-03 02:13:48.703 [DEBUG] [ab.binding.roborock.internal.RoborockVacuumHandler] - Bridge status changed to OFFLINE (CONFIGURATION_ERROR): Error java.net.UnknownHostException: usiot.roborock.com:
Temporary failure in name resolution

Interestingly, I’ve seen this occur in two geographically different locations. Same ISP (Comcast) but the locations are 600 miles apart.

Did you have a chance to look at this? It really is an annoying problem because the thing goes offline and requires a binding restart to get it back online?

Unfortunately not. I’ve had some health issues, so the only current priority is trying to get the PR approved, I cna focus on other fixes after that. Interestingly, I had to replace my cable modem yesterday, which causes some connectivity issues, yet my binding is still online.

The PR is just about complete. I’ve built a 5.0 compatible version, at https://smedley.id.au/tmp/org.openhab.binding.roborock-5.0.2-SNAPSHOT.jar

note the file name difference if you’ve installed a marketplace build. As mentioned earlier, this has BREAKING changes to channel names, so you need to remove all things and re-create them.

PR is now merged!! I’m updating the link is Post #1 - will add a note about breaking changes.

OK I had a quick look this evening, easy enough to see why it fails, see:

I guess the question is how best to handle this, perhaps I just remove the line and just return null in the event of an error? (for the calls to update routines, home details, home)

btw openHAB 5.1.M1 includes the Roborock binding :slight_smile:

3 Likes

Anyone tried the build in 5.1.M1?

Yes, I’m running the latest snapshot. It’s been running smoothly in 2 different locations.

And, I think I got my DNS issue sorted out so I’ve not seen the UnknownHostException in quite a while.

1 Like

I’ve been testing the add-on over the past few days with my Qrevo S, and most channels are running. Thank you!

For me, the best way was to read the routine ID via “Routine Mapping” and then send it as a command to “start vacuum Routine.”

1 Like

Hey Patrick!

FYI - I’ve added a switch on my sitemap for routines:

                Switch item=Roborock_Qrevo_S_Vacuum_Routine_routine mappings=["3582307"="Vac followed by Mop","3582305"="Deep","3600238"="Deep+","3582309"="Intensive Sweeping"] label="QRevo S Routine"

Glad it’s working for you :slight_smile:

There is some progress over at python-roborock for the ‘newer’ API - however, at the moment, they only have it working for local commands, not cloud commands.

At some point I want to support local commands, but I need to get my head around how best to factor this code in.

FWIW - Homey/python-roborock are making progress on the B01 protocol - see https://community.homey.app/t/app-pro-roborock-cloud-intelligent-robot-vacuum-cleaners/128559/520?page=22

Initially it will only be read-only support - will implement commands once they are worked out.

1 Like

Hi, I’ve been configuring my robot in milestone version of binding and noticed few things when using Saros 10 robot:

Other than that, bindings seems to work. I configured routines and I was able to execute them from Openhab so kudos for the hard work! I’m also looking forward to see local control.