Coder Social home page Coder Social logo

xiaomi_vacuum's Introduction

Home Assistant integration: Xiaomi Vacuum v1 & v2

If you're here probably you want to integrate Xiaomi Vacuum v1 & v2 with Home Assistant without loosing some useful functions such as live maps.

On the Vacuum

Root the vacuum

If you don't know how to gain SSH access to your vacuum please read the article on dustcloud:

Install on the vacuum
  • Create SSH keypair with the command: ssh-keygen

  • Copy the SSH public key to the Home Assistant host with the command: ssh-copy-id -p ##HOMEASSISTANT_SSHPORT## homeassistant@##HOMEASSISTANT_IPADDRESS##

  • Copy the file vacuum/etc/rc.local to your vacuum, replacing the existing /etc/rc.local.

  • Copy the file vacuum/opt/rockrobo/scripts/maps_to_ha.sh to your vacuum, at the destination /opt/rockrobo/scripts/maps_to_ha.sh.

    • Fill RHOST with ##HOMEASSISTANT_IPADDRESS##
    • Fill RPORT with ##HOMEASSISTANT_SSHPORT##
  • Make sure to give to the file the right permissions with the command: chown 755 /opt/rockrobo/scripts/maps_to_ha.sh.

Install on Home Assistant

We can assume that you're executing your Home Assistant istance using the user homeassistant in the Home Assistant configuration directory /home/homeassistant/.homeassistant. If not please fix the directories specified to the top of the given scripts.

We can assume you're using a RedHat like system (CentOS, Fedora, RedHat, SuSe, ...) as destination host.

  • Ensure that you've installed python-pillow package. On RedHat like systems you can issue the command yum install python-pillow

  • Ensure that you've installed incrond package. On RedHat like systems you can issue the command yum install incron

  • Copy vacuum/etc/incron.d/vacuum_maps to /etc/incron.d/vacuum_maps.

  • Create the directories /home/homeassistant/.homeassistant/scripts, /home/homeassistant/.homeassistant/www, /home/homeassistant/.homeassistant/vacuum if not exist.

  • Make sure to fix the ownership of these directories to the user homeassistant.

  • Copy the script homeassistant/home/homeassistant/scripts/build_maps.py to /home/homeassistant/.homeassistant/scripts/build_maps.py.

  • Copy the script homeassistant/home/homeassistant/scripts/incrond_vacuum_maps.sh to /home/homeassistant/.homeassistant/scripts/incrond_vacuum_maps.sh.

  • Make sure to give to the file the right permissions with the command: chown 755 /home/homeassistant/.homeassistant/scripts/incrond_vacuum_maps.sh.

Show the map on Home Assistant

Add the following component to your HA configuration file:

camera:
  - platform: generic
    name: Vacuum Map
    still_image_url: http://127.0.0.1:8123/local/navmap.png
    content_type: image/png
    framerate: 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.