Load saved maps using Home Assistant - hagenuck1/Valetudo GitHub Wiki
This feature isn't implemented in valetudo yet and is EXPERIMENTAL!
Load saved maps using Home Assistant
With the help of this manual it is possible to load previously manually saved maps using a shell_command in home assistant to run a script on the Roborock S5.
Requirements
- Roborock S5 (Xiaomi mi robot doesn't have persistent maps!)
- ssh keypair WITHOUT a password!
- Home Assistant
- SSH-Access to the Roborock
- SSH-Access to Home Assistant
Save the Roborock maps
Best Practice is to start a full cleaning with all doors open, so you always could revert to a map without closed doors!
-
Start a full cleaning
-
Draw No-Go Zones & walls if needed.
-
When the robot is back at the dock connect to it using SSH.
-
Save the following files to
mnt/data/valetudo/maps/floor1/, floor2/,...
:mnt/data/rockrobo/last_map
saved mapmnt/data/rockrobo/PersistData_1
virtual zones and wallsmnt/data/rockrobo/PersistData_2
virtual zones and wallsmnt/data/rockrobo/ChargerPos.data
named positions > ONLY for maps containing a charger! -
Create an sh-script for the current floor in
mnt/data/valetudo/maps/
e.g.floor1.sh
(user_map0 and StartPos.data have to be deleted, to let the robot search it's position after starting a cleanup, if you don't do this you risk a factory reset of the roborock!)
rsync -r ../../../../mnt/data/valetudo/maps/floor1/ ../../../../mnt/data/rockrobo/
rm -f ../../../../mnt/data/rockrobo/user_map0
rm -f ../../../../mnt/data/rockrobo/StartPos.data
service rrwatchdoge restart
- If you'd like to have separate maps for any floor for the mop-mode for example you can now draw the no-go Zones & walls using Valetudo. When finished repeat step 3-5. Use
floor1_mop
as folder andfloor1_mop.sh
as script name.
Optionally save additional floors
These floors do not need a charger! Be patient, where you place the roborock, when creating the map, as the roborock will return there when finishing cleanings on that floor!
- If you'd like to save a different floor you have delete the persistent data using the Valetudo > Settings > Persistent Data > "Reset Map" Button. Then repeat step 1-5.
Loading saved maps
Local test on the Roborock
bash ../mnt/data/valetudo/maps/floor1.sh
Wait 30 seconds and have a look in Valetudo > Map. The new map should be showed then.
Prepare Home Assistant SSH access to the Roborock
- Create a folder called
ssh
in the/config
directory. - Copy the ssh file for example
id_rsa
into this folder. - Access this folder using ssh and set the rights of the file:
chmod +400 id_rsa
Prepare home assistant to reload the map
You have to reload the map from Home Assistant using shell_command.
- create new shell_command
shell_command:
roborock_floor1: 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /config/ssh/id_rsa [email protected] "bash ../mnt/data/valetudo/maps/floor1.sh"'
- Done
Load the map using home assistant
- You only have to run
shell_command.roborock_floor1
in home assistant - WAIT 30 seconds before start a new clean, otherwise the Roborock will reset because it didn’t load the new map completely!!!
Give feedback
Give feedback if you have problems loading/ saving the map or if you see any crashes/ resets while loading a map. If it's confirmed working this PR (https://github.com/Hypfer/Valetudo/pull/317) using this way to save/load maps may be merged.
BACKUP!!!!
To prevent loosing all your data make a backup of the mnt/data/valetudo/maps
Folder. Otherwise this would be gone, when your roborock resets!