I have been trying for the past few weeks to get Dustcloud to talk to my V2 Vacuum (Roborock S50)
I have never connected her to the cloud, as soon as I bought her I rooted Rosie (Yes she is called Rosie)
I have given up on Dustcloud but I have found an alternative!
Valetudo is very new at under two months old, but so far I am enjoying it.
It is hosted on the Vacuum it’s self and offers a web interface where you can check stats, control the vacuum as a remote and also get your lovely real time maps.
It does need a rooted Vacuum, but rooting it is really easy esp compared to YAML!!!
How to Root
I still have Rosie configured in the normal Xiaomi way on HASS
configuration.yaml
vacuum:
- platform: xiaomi_miio
host: 192.168.x.x
token: xxxx
name: Rosie
So I can still send normal commands and zoned cleaning through HASS as I am still using the standard interface at the moment.
For live images from Valetudo there in an API and how it works at the moment is to send an API request to the Vacuum and you get a data string back.
The most simple form is:
ipaddress/api/remote/map
You will then get something like:
{“scale”:4,“border”:8,“doCropping”:true,“drawPath”:true,“mapsrc”:"/maps/2018-08-29_15-57-24.png",“drawCharger”:true,“charger”:[516,588],“drawRobot”:true,“robot”:[516,573],“robotAngle”:270}
Every time you send a request a new image is made.
So how I added this into HASS is as follow:
configuration.yaml
sensor:
- platform: rest
resource: http://192.168.x.x/api/remote/map
name: RosiesMap
value_template: '{{ value_json.mapsrc }}'
The part value_template: ‘{{ value_json.mapsrc }}’ basically filters all the other bits out and returns the image path minus the actual IP address.
I then have a generic camera setup piecing together the IP address of the Vacuum and the value of RosiesMap into a complete address to the current map image.
configuration.yaml
camera:
- platform: generic
name: Vacuum Map
still_image_url: http://192.168.x.x{{states.sensor.rosiesmap.state | string }}
content_type: image/png
framerate: 1
Obviously the sensor name needs to match the name of the “rest sensor” you have created previously.
This is only a very basic setup so far, I need to improve on it quite a bit. There are probably more elegant ways of doing this with scripting perhaps and conditions. As at default the rest sensor polls the Vacuum every 30 seconds for a new Image even if it’s sat idle.
So going forward I will probably request a new Image upon HASS Startup in case you need to reload and then only update the image when in run mode, but more often like 2 -5 seconds so you can get a real time map of the progress.