Roborock binding for robot vacuum cleaners [5.0.0; 5.0.99]

Thanks for your work on this Paul!
Your explanation also explains what I saw. Initially all worked fine, but after sometime I did notice that the robot was offline not only in openhab but also in the roborock app. I first thought this is because my vacuum is on a different VLAN… For now I have uninstalled the binding.

the latest drop won’t cause the bots to go offline, and sending commands works even when updates stop. So fo ruse to automate the robot startup, it’s still very useful :slight_smile:

2 Likes

Possible solution to the lack of updates - Client stops receiving messages - #3 by psmedley - HiveMQ Community Edition - HiveMQ Support Forum

Testing this fix overnight :slight_smile:

3 Likes

Hey, I have an issue. I tried to install this Binding but I got an Error:

Exception while installing add-on: Cannot invoke "String.length()" because "this.input" is null

Can someone help me?

I run the latest 5.0.0 Release Build.

same problem here

For OH 5.0 - try https://smedley.id.au/tmp/org.openhab.binding.roborock-5.1.0-SNAPSHOT.jar

TBH I haven’t tested the 4.3 compatible version with OH 5.0

I should probably create a new marketplace entry for a 5.0 compatible version.

I’m also planning to try the eclipse paho mqtt client instead of hivemq, to see if it resolves the issues with a lack of updates.

1 Like

FWIW I seem to have things working with paho mqtt, will see if it keeps receiving messages overnight before declaring victory though. I’ll provide an update in the morning!

:sob: seems after an hour or so messages stopped being received/processed - ie similar behaviour to that with hivemq, which suggests either a problem with my code or with the roborock server. I guess I need to look further into using local connections…

3 Likes

Oh that’s frustrating. But that’s the final nail in the box to have it stable no? Don’t give up!

Well it’s stable already, and even once updates stop flowing, sending commands still works, so you can still start/stop the vac.

Implementing local control should resolve the lack of updates, I just need a spare afternoon to refactor the code and learn how to do socket programming in java :stuck_out_tongue:

OK found a clue:

2025-08-01 18:34:32.215 [TRACE] [orock.internal.RoborockVacuumHandler] - MQTT message output: {"t":1754039071,"dps":{"122":43}}
2025-08-01 18:34:32.216 [TRACE] [orock.internal.RoborockVacuumHandler] - MQTT message processed
2025-08-01 18:34:32.216 [TRACE] [rock.internal.RoborockAccountHandler] - MQTT message processed - from AccountHandler
2025-08-01 18:36:32.141 [WARN ] [rock.internal.RoborockAccountHandler] - MQTT connection lost: Connection lost. Automatic reconnect is enabled.

So the connection dropped and reconnected, but it hasn’t resubscribed. I need to find how to trigger a resubscribe when paho reconnects. There is supposed to be an ‘on_connect’ function - I just need to find the documentation or an example…

Edit: it’s connectComplete in Java. I’ll implement it in the morning. Meanwhile, I changed connOpts.setCleanSession(true); to connOpts.setCleanSession(false); which may also help

1 Like

Well it’s now morning and with connOpts.setCleanSession(false) I’m still receiving updates :slight_smile:

I’ll still implement connectComplete, then I’ll get back to working out if I can learn something that gets hivemq working too.

1 Like

OK, https://smedley.id.au/tmp/org.openhab.binding.roborock-5.1.0-SNAPSHOT-paho.jar uses connectComplete and also has the changes to setCleanSession. This one is built only for OH5.0+

Edit: I’ve also made some changes to the code using hivemq and have that running on another install. Fingers crossed.

Both versions have been receiving updates for about 6 hours now :slight_smile:

The version with the changes to hivemq to match what I’m using in paho is at https://smedley.id.au/tmp/org.openhab.binding.roborock-5.1.0-SNAPSHOT.jar

If people need a build compatible with OH 4.3.x let me know.

I’ll let this keep running overnight, then start working on cleaning up some of the logging. I added a LOT of logging to try and work out what was going wrong.

3 Likes

I would be very grateful to get a version for oh 4.3.x, but can only test it in 2 weeks :smiley:

https://smedley.id.au/tmp/org.openhab.binding.roborock-5.1.0-SNAPSHOT-OH-4.3.x.jar is built with java 17 and OH 4.3.x compatibility.

1 Like

I just gave it another try. Initially it worked, I was able to start some actions using the binding, but then no more updates and the robot also did not respond to any commands anymore. After that also in the app the robot is again shown as offline. Maybe this is because the robot is on a different VLAN?

For now I have uninstalled the binding again. I will reset the robot and repair it with the app to get it online again in the app.

I’m going to need logs to be able to further diagnose this. A different VLAN shouldn’t matter right now as we’re using cloud control. Are you certain you removed the old marketplace binding including removing any jar files it installed? The filename is different, so it’s possible the old code was loaded (I’ve been bitten by this before :slight_smile: )

I know that this is not the point here but just to let you know in case you’re looking into local control: The blocking across VLANs can be circumvented by SNAT rules on your router to masquerade the source address. That’s what I do for roborock and other Xiaomi devices (yeelight lamps for example).

local control is on the ‘todo’ list - the initial code I get submitted into OH will be only cloud control.

FWIW I’ve had the latest code running for 72 hours straight now with continued updates :slight_smile: Anyone else?

2 Likes