Roborock S50 with Valetudo RE firmware and MQTT integration

Hi,

with latest Valetudo RE I can use HAPPanel to load a map, select which rooms to clean and issue the clean command. I do this via a tablet, which is attached to the wall.

Unfortunately the HABPanel widgets are all hardcoded (like number of rows, item names etc) but of course that’s something which can be changed.

Shout if you are interessted and I’ll share more details.

best regards

Stefan

3 Likes

Hey cool, that’s exactly what I plan to do! I saw that it sends the maps image data in the mqtt topic. Did you manage to display it in HABPanel? Mind to share some code?

Not yet using the map. Would love to see this too. Maybe it’s possible to load the HTML page into habpanel?

Will share the code tomorrow when I’m back at the PC

We’d have to add some JS as custom widget to HABPanel. The corresponding code from the Valetudo web client to draw the map is here:

not sure what you’re really interessted in. Unfortunately most of the things are hardcoded.
This is my selection box at the top https://pastebin.com/UcHgJ5Sp
This is the room selection, depening on the floor you selected: https://pastebin.com/4eXmjCdu

Here my items:
https://pastebin.com/YhrT5EGJ

Here my rules:
https://pastebin.com/uL6ba4aq

Actually my rules are still under construction. Especially the clean and resume actions.
Hope it helps

Stefan

Hm, so I managed to create a (hackish) widget which draws the map using the data from the MQTT topic but it seems its a little bit too much for my poor Raspberry. The java process got 100% CPU load and OOMed.
I have to sit and think about a more efficient way to do it or to decrease the update interval.

Hi,

you may want to take a look at Valetudo Mapper. It is a companion service for Valetudo which generates a PNG of the map.
I use this since some time to generate a PNG of the map and use the PNG in Habpanel via the image widget. Works pretty well.

Here a screenshot

Hope that helps

4 Likes

Hey Stefan,

Thanks for sharing your rules.
I also installed Valetudo hoping my robot wouldn’t lose the map / change the orientation every now and then.
However, when I try zone cleanup in the same way you did, nothing happens for me.

Items:

Switch vacLivingroom    "Wohnzimmer"    (gVacuumRooms)

Rules:

val mqttActions12 = getActions("mqtt","mqtt:broker:mqttv2")
var json = "{\"command\": \"segmented_cleanup\",\"segment_ids\": ["
gVacuumRooms.members.filter[r|r.state == ON].forEach[ room |
    json += "\"" + room.label + "\","
    logInfo("valetudo.rules", "..." + room.label)
]
json = json.substring(0, json.length -1)
json += "],\"repeats\": 1}"
mqttActions12.publishMQTT("valetudo/rockrobo/custom_command",json)

logInfo does give me the correct name that’s set up in Valetudo (“Wohnzimmer”).
Using “mqttActions12.publishMQTT(“valetudo/rockrobo/command”,“pause”)” pauses the robot, but custom_command doesn’t do anything.

Do you have any thoughts on this?

Alex

well, I would first try to send the mqtt commands manually, outside of openHAB. does this work? have you enabled multi map support in the valetudo UI?

So in the UI I enabled “Provide Map Data” if that’s what you mean.
When try to send a command through SSH to the robot (e.g. mosquitto_pub -h 192.168.178.61 -t “valetudo/rockrobo/command” -m “pause” -d) I get “Error: Connection refused”. Pause does work from OH with mqttPublish though…

I meant Settings - Web Interface - Show multimap buttons, but I don’t think this will solve your problem.
If you get “Connection refused” you are probably a) connecting to wrong ip address b) connecting to wrong port or c) facing a firewall issue.

I don’t have that Web Interfacing setting - probably because I got a v1 and not a v5…
Since I can’t use the “persistant map” feature with v1 anyway, I think I’ll probably go back to OFW again and make sure the robot doesn’t lose the map that often… :wink:
Thanks for you help though, maybe Valetudo will get an OH implementation the way it got HA implementation…