Skip to content

Instantly share code, notes, and snippets.

@johnDorian
Last active August 14, 2022 06:01
Show Gist options
  • Save johnDorian/9eca1bfeeb0312a0ff605c6f0fe319bd to your computer and use it in GitHub Desktop.
Save johnDorian/9eca1bfeeb0312a0ff605c6f0fe319bd to your computer and use it in GitHub Desktop.
Rockrobo restore map (gen1)

This gist is an example of how to use home assistant to reload the map of the vacuum

Setup the vacuum

How to setup the vacuum side of things

  1. You will need to copy the recovery_map.shto /mnt/data/valetudo/recovery_map.sh on the vacuum
  2. Create the backup folder mkdir -p /mnt/data/rockrobo/backup/
  3. Run a complete clean or manually steer the vacuum around the entire house. After finishing the tour, return the vacumm to the dock.
  4. Copy the base map to the backup folder cp /mnt/data/rockrobo/last_map /mnt/data/rockrobo/backup/ and the charger pos cp /mnt/data/rockrobo/ChargerPos.data /mnt/data/rockrobo/backup/

Setup Home assistant

In order for home assistant to reload the map, it will need the ssh key to be able to login to the vacuum. To triger the reload map function, use the automation and restore the map once the vacum has been on the dock for a certain amount of time. AFter this time home assistant will run the shell script.

automation:
- alias: 'Reload the map'
trigger:
platform: state
entity_id: vacuum.rockrobo
# Optional
to: "docked"
# If given, will trigger when state has been the to state for X time.
for: "00:00:10"
action:
- service: shell_command.reload_map
shell_command:
reload_map: ssh -i /config/id_rsa -o StrictHostKeyChecking=no 192.168.0.150 sh /mnt/data/valetudo/recovery_map.sh
#!/bin/bash
cp /mnt/data/rockrobo/backup/* /mnt/data/rockrobo/
sync
killall player
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment