All Projects → PiotrMachowski → Home Assistant Custom Components Xiaomi Cloud Map Extractor

PiotrMachowski / Home Assistant Custom Components Xiaomi Cloud Map Extractor

Licence: mit
This custom integration provides a way to present a live view of a map for a Xiaomi (and Roborock) vacuums.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Home Assistant Custom Components Xiaomi Cloud Map Extractor

Ble monitor
Xiaomi Mijia BLE MiBeacon monitor
Stars: ✭ 611 (+92.14%)
Mutual labels:  home-assistant, xiaomi
Python Miio
Python library & console tool for controlling Xiaomi smart appliances
Stars: ✭ 1,995 (+527.36%)
Mutual labels:  home-assistant, xiaomi
Xiaomigateway3
Control Zigbee, BLE and Mesh devices from Home Assistant with Xiaomi Gateway 3 (ZNDMWG03LM) on original firmware
Stars: ✭ 617 (+94.03%)
Mutual labels:  home-assistant, xiaomi
Rest980
REST interface to control your iRobot Roomba 980 via local server on your lan.
Stars: ✭ 186 (-41.51%)
Mutual labels:  robot, cloud
xiaomiplug
Xiaomi Mi Smart WiFi Socket integration for Home Assistant
Stars: ✭ 99 (-68.87%)
Mutual labels:  home-assistant, xiaomi
Miflora Mqtt Daemon
Linux service to collect and transfer Xiaomi Mi Flora plant sensor data via MQTT to your smart home system, with cluster support 🌱🌼🥀🏡🌳
Stars: ✭ 409 (+28.62%)
Mutual labels:  home-assistant, xiaomi
Hass Xiaomi Miot
Auto integrate xiaomi devices by miot-spec for HomeAssistant
Stars: ✭ 93 (-70.75%)
Mutual labels:  home-assistant, xiaomi
Home Assistant Config
Home Assistant Configuration & Documentation for my Smart House.
Stars: ✭ 1,115 (+250.63%)
Mutual labels:  home-assistant, xiaomi
Xiaomi airpurifier
Xiaomi Mi Air Purifier and Xiaomi Mi Air Humidifier integration for Home Assistant
Stars: ✭ 230 (-27.67%)
Mutual labels:  home-assistant, xiaomi
Openmqttgateway
MQTT gateway for ESP8266, ESP32, Sonoff RF Bridge or Arduino with bidirectional 433mhz/315mhz/868mhz, Infrared communications, BLE, Bluetooth, beacons detection, mi flora, mi jia, LYWSD02, LYWSD03MMC, Mi Scale, TPMS, BBQ thermometer compatibility, SMS & LORA.
Stars: ✭ 2,413 (+658.81%)
Mutual labels:  home-assistant, xiaomi
Dorita980
Unofficial iRobot Roomba and Braava (i7/i7+, 980, 960, 900, e5, 690, 675, m6, etc) node.js library (SDK) to control your robot
Stars: ✭ 523 (+64.47%)
Mutual labels:  robot, cloud
homebridge-mi-robot vacuum
XiaoMi robot vacuum plugins for HomeBridge.
Stars: ✭ 53 (-83.33%)
Mutual labels:  robot, xiaomi
Yi Hack V4
New Custom Firmware for Xiaomi Cameras based on Hi3518e Chipset. It features RTSP, SSH, FTP and more!
Stars: ✭ 1,183 (+272.01%)
Mutual labels:  cloud, xiaomi
Lovelace Xiaomi Vacuum Map Card
This card enables you to specify a target or start a zoned cleanup using live or static map, just like in Xiaomi Home app. Additionally you can define a list of zones and choose the ones to be cleaned.
Stars: ✭ 433 (+36.16%)
Mutual labels:  home-assistant, xiaomi
Lovelace Xiaomi Vacuum Card
Simple card for various robot vacuums in Home Assistant's Lovelace UI
Stars: ✭ 137 (-56.92%)
Mutual labels:  home-assistant, xiaomi
VacuumZones
Control zone cleaning for Xiaomi vacuum cleaners from voice assistants and Home Assistant
Stars: ✭ 39 (-87.74%)
Mutual labels:  home-assistant, xiaomi
Xiaomi airconditioningcompanion
Xiaomi Mi and Aqara Air Conditioning Companion integration for Home Assistant
Stars: ✭ 304 (-4.4%)
Mutual labels:  home-assistant, xiaomi
Cdndrive
☁️ CDNDrive = BiliDrive + SuperBed,支持任意文件的全速上传与下载
Stars: ✭ 310 (-2.52%)
Mutual labels:  cloud
Com.xiaomi Miio
Homey app to control Mi Home devices that implement the miIO protocol and Xiaomi gateway child devices
Stars: ✭ 318 (+0%)
Mutual labels:  xiaomi
My Links
Knowledge seeks no man
Stars: ✭ 311 (-2.2%)
Mutual labels:  cloud

hacs_badge Community Forum buymeacoffee_badge paypalme_badge

Xiaomi Cloud Map Extractor

This custom integration provides a way to present a live view of a map for a Xiaomi vacuum.

Installation

Using HACS (recommended)

This integration can be added to HACS as a custom repository:

  • URL: https://github.com/PiotrMachowski/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor
  • Category: Integration

After adding a custom repository you can use HACS to install this integration using user interface.

Manual

To install this integration manually you have to download following files:

to config/custom_components/xiaomi_cloud_map_extractor directory:

mkdir -p custom_components/xiaomi_cloud_map_extractor
cd custom_components/xiaomi_cloud_map_extractor
wget https://raw.githubusercontent.com/PiotrMachowski/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor/master/custom_components/xiaomi_cloud_map_extractor/camera.py
wget https://raw.githubusercontent.com/PiotrMachowski/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor/master/custom_components/xiaomi_cloud_map_extractor/const.py
wget https://raw.githubusercontent.com/PiotrMachowski/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor/master/custom_components/xiaomi_cloud_map_extractor/image_handler.py
wget https://raw.githubusercontent.com/PiotrMachowski/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor/master/custom_components/xiaomi_cloud_map_extractor/manifest.json
wget https://raw.githubusercontent.com/PiotrMachowski/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor/master/custom_components/xiaomi_cloud_map_extractor/map_data_parser.py
wget https://raw.githubusercontent.com/PiotrMachowski/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor/master/custom_components/xiaomi_cloud_map_extractor/xiaomi_cloud_connector.py

Configuration

After installation of the custom component, it needs to be configured in configuration.yaml file. To do so, add a camera entry to your configuration with at least a basic or recommended configuration. Vacuum token can be extracted by following this guide. You also need to enter your Xiaomi Cloud username and password. These are the credentials used for the Xiaomi Home app (not ones from Roborock app).

After installation and a reboot of your Home Assistant instance, you should get a camera entity which shows the vacuum map. This might take a few minutes after a first restart. If you have a problem with configuration validation you have to remove camera from configuration.yaml, restart Home Assistant, add camera config and restart HA again.

Available configuration parameters

Key Type Required Value Description
platform string true xiaomi_cloud_map_extractor Name of a platform
host string true 192.168.0.123 IP address of a vacuum
token string true ghjhca3ykg8o2zyyj7xb5adamhgsypel Token of a vacuum
username string true [email protected] Username (email or user ID) used to connect to Xiaomi cloud (the account used in the Xiaomi Home app)
password string true aVerySecretPassword Password used to connect to Xiaomi cloud (the account used in the Xiaomi Home app)
name string false Desired name of camera entity
country string false One of: cn, de, us, ru, tw, sg, in, i2 Server used in Xiaomi cloud. Leave empty if you are not sure.
colors map false Colors configuration (see below)
room_colors map false Room colors configuration (see below)
draw list false List of elements to draw on a map (see below)
texts list false List of texts to draw on a map (see below)
map_transformation map false Parameters of map transformation (see below)
sizes map false Sizes of map's elements (see below)
attributes list false List of desired entity attributes (see below)
scan_interval interval false default: 5 seconds Interval between map updates (documentation)
auto_update boolean false default: true Activation/deactivation of automatic map updates. If disabled use service homeassistant.update_entity to update map manually.

Colors configuration

Each color is represented by a list of 3 or 4 parameters: [red, green, blue] or [red, green, blue, alpha]. Each parameter is a number from a range 0-255 and can be also provided as a HEX value: [0x12, 0xAF, 0xC5] matches #12AFC5.

Color name Description
color_map_inside Map inside (for software without rooms support)
color_map_outside Map outside
color_map_wall Walls (for software without rooms support)
color_map_wall_v2 Walls (for software with rooms support)
color_grey_wall Obstacles (e.g. chairs, table legs)
color_path Path of a vacuum
color_goto_path Path for goto mode
color_predicted_path Predicted path to a point in goto mode
color_zones Fill of areas selected for zoned cleaning
color_zones_outline Outline of areas selected for zoned cleaning
color_virtual_walls Virtual walls
color_no_go_zones Fill of no-go zones
color_no_go_zones_outline Outline of no-go zones
color_no_mop_zones Fill of no-mopping zones
color_no_mop_zones_outline Outline of no-mopping zones
color_charger Charger position
color_robo Vacuum position
color_scan Areas not assigned to any room (for software with rooms support)
color_unknown Other areas

Room colors configuration

This section contains mapping between room numbers and colors. Each color is represented by a list of 3 or 4 parameters: [red, green, blue] or [red, green, blue, alpha]. Each parameter is a number from a range 0-255 and can be also provided as a HEX value: [0x12, 0xAF, 0xC5] matches #12AFC5.

Draw configuration

A list of features to be drawn on a map. If all features should be drawn it can be replaced with:

  draw: ["all"]

Available values:

  • charger
  • path
  • goto_path
  • predicted_path
  • no_go_zones
  • no_mopping_zones
  • vacuum_position
  • virtual_walls
  • zones

Texts configuration

Each list entry must obey a following schema. You can get a list of available fonts by executing this command:

fc-list | grep ttf | sed "s/.*\///"| sed "s/ttf.*/ttf/"
Parameter Type Required Default value Description
text string true Text to draw on a map
x float true X position of a text (in percents)
y float true Y position of a text (in percents)
color list false black Desired color of a text, formatted like here
font string false Name of a font to use
font_size int false Size of a font

Map transformation configuration

Parameter Type Required Default value Description
scale float false 1 Scaling factor for a map.
rotate integer false 0 Angle of map rotation. Available values: [0, 90, 180, 270]
trim map false 0 Map trimming configuration. Each trimming direction is in percents: value 25 means trimming of quarter in a given dimension. Available keys: [left, right, top, bottom]

Sizes configuration

Parameter Type Required Default value Description
charger_radius float false 4 Radius of a charger circle.
vacuum_radius float false 4 Radius of a vacuum circle.

Attributes configuration

A list of attributes that an entity should have. Available values:

  • calibration_points - Calculated calibration points for Lovelace Xiaomi Vacuum Map card.

  • charger

  • country

  • goto

  • goto_path

  • goto_predicted_path

  • image

  • is_empty

  • map_name

  • no_go_areas

  • no_mopping_areas

  • obstacles

  • path

  • room_numbers

  • rooms

  • vacuum_position

  • vacuum_room

  • walls

  • zones

Examples

Basic

camera:
  - platform: xiaomi_cloud_map_extractor
    host: !secret xiaomi_vacuum_host
    token: !secret xiaomi_vacuum_token
    username: !secret xiaomi_cloud_username
    password: !secret xiaomi_cloud_password

Recommended

camera:
  - platform: xiaomi_cloud_map_extractor
    host: !secret xiaomi_vacuum_host
    token: !secret xiaomi_vacuum_token
    username: !secret xiaomi_cloud_username
    password: !secret xiaomi_cloud_password
    draw: ['all']
    attributes:
      - calibration_points    

Full

camera:
  - platform: xiaomi_cloud_map_extractor
    host: !secret xiaomi_vacuum_host
    token: !secret xiaomi_vacuum_token
    username: !secret xiaomi_cloud_username
    password: !secret xiaomi_cloud_password
    country: "de"
    name: "My Vacuum Camera"
    colors:
      color_map_inside: [32, 115, 185]
      color_map_outside: [19, 87, 148]
      color_map_wall: [100, 196, 254]
      color_map_wall_v2: [93, 109, 126]
      color_grey_wall: [93, 109, 126]
      color_path: [147, 194, 238]
      color_goto_path: [0, 255, 0]
      color_predicted_path: [255, 255, 0, 0]
      color_zones: [0xAD, 0xD8, 0xFF, 0x8F]
      color_zones_outline: [0xAD, 0xD8, 0xFF]
      color_virtual_walls: [255, 0, 0]
      color_no_go_zones: [255, 33, 55, 127]
      color_no_go_zones_outline: [255, 0, 0]
      color_no_mop_zones: [163, 130, 211, 127]
      color_no_mop_zones_outline: [163, 130, 211]
      color_charger: [0x66, 0xfe, 0xda, 0x7f]
      color_robo: [75, 235, 149]
      color_unknown: [0, 0, 0]
      color_scan: [0xDF, 0xDF, 0xDF]
    room_colors:
      1: [240, 178, 122]
      2: [133, 193, 233]
      3: [217, 136, 128]
      4: [52, 152, 219]
      5: [205, 97, 85]
      6: [243, 156, 18]
      7: [88, 214, 141]
      8: [245, 176, 65]
      9: [252, 212, 81]
      10: [72, 201, 176]
      11: [84, 153, 199]
      12: [133, 193, 233]
      13: [245, 176, 65]
      14: [82, 190, 128]
      15: [72, 201, 176]
      16: [165, 105, 18]
    draw:
      - charger
      - path
      - goto_path
      - predicted_path
      - no_go_zones
      - no_mopping_zones
      - vacuum_position
      - virtual_walls
      - zones
    texts:
      - text: "Room 1"
        x: 25
        y: 25
        color: [125, 20, 213]
      - text: "Room 2"
        x: 25
        y: 75
        color: [125, 20, 213, 127]
        font: "FreeSans.ttf"
        font_size: 25
    map_transformation:
      scale: 2
      rotate: 180
      trim:
        top: 10
        bottom: 20
        left: 30
        right: 40
    sizes:
      charger_radius: 4
      vacuum_radius: 6.5
    attributes:
      - calibration_points
      - charger
      - country
      - goto
      - goto_path
      - goto_predicted_path
      - image
      - is_empty
      - map_name
      - no_go_areas
      - no_mopping_areas
      - obstacles
      - path
      - room_numbers
      - rooms
      - vacuum_position
      - vacuum_room
      - walls
      - zones
    scan_interval:
      seconds: 10
    auto_update: true

Supported devices

This integration was tested on following vacuums:

  • Xiaomi Vacuum Gen 1 (Mi Robot Vacuum/SDJQR01RR/SDJQR02RR)
  • Xiaomi Mi Robot 1S
  • Roborock S4 (software with rooms support)
  • Roborock S5 (software without rooms support)
  • Roborock S5 (software with rooms support)
  • Roborock S5 Max
  • Roborock S6
  • Roborock S6 MaxV
  • Roborock S6 Pure

Unsupported devices

At this moment this integration is known to not work with following vacuums:

  • Roborock E50
  • Xiaomi Mi Robot Vacuum Mop Pro (STYJ02YM)

Buy Me A Coffee

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].