This custom integration provides a way to present a live view of a map for Xiaomi (Roborock/Viomi/Roidmi/Dreame) vacuums without a need for rooting.
This custom integration provides a way to present a live view of a map for Xiaomi (Roborock/Viomi/Roidmi/Dreame) vacuums without a need for rooting.
[![Ko-Fi][ko_fi_shield]][ko_fi]
[![buycoffee.to][buycoffee_to_shield]][buycoffee_to]
[![PayPal.Me][paypal_me_shield]][paypal_me]
[![Revolut.Me][revolut_me_shield]][revolut_me]
This custom integration provides a way to present a live view of a map for Xiaomi, Roborock, Viomi, Roidmi and Dreame vacuums. (Supported devices)
This integration can be installed using HACS.
To do it search for Xiaomi Cloud Map Extractor in Integrations section.
To install this integration manually you have to download xiaomi_cloud_map_extractor.zip and extract its contents 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://github.com/PiotrMachowski/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor/releases/latest/download/xiaomi_cloud_map_extractor.zip
unzip xiaomi_cloud_map_extractor.zip
rm xiaomi_cloud_map_extractor.zipAfter 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 (ignore "not recommended" message, as it applies only to built-in Xiaomi Miio integration).
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.
After modification of camera's configuration you can reload its settings in Configuration or using xiaomi_cloud_map_extractor.reload service.
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_passwordcamera:
- 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| This configuration's purpose is to show all available options, do not use it unless you know what you are doing. |
|---|
…| 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. (see below) |
store_map_raw |
boolean | false | default: false |
Enables storing raw map data in store_map_path directory (more info). Xiaomi map can be opened with RoboMapViewer. |
store_map_image |
boolean | false | default: false |
Enables storing map image in store_map_path path with name map_image_<device_model>.png |
store_map_path |
string | false | default: /tmp |
Storing map data directory |
force_api |
string | false | One of: xiaomi, viomi, roidmi, dreame |
Forces usage of specific API. |
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_carpets |
Carpets fill, in checkboard pattern |
color_charger |
Charger fill |
color_charger_outline |
Charger outline |
color_cleaned_area |
Fill of area that already has been cleaned |
color_goto_path |
Path for goto mode |
color_grey_wall |
Obstacles (e.g. chairs, table legs) |
color_ignored_obstacle_with_photo |
Ignored obstacle with photo mark on a map |
color_ignored_obstacle |
Ignored obstacle mark on a map |
color_map_inside |
Map inside (for software without rooms support) |
color_map_outside |
Map outside |
color_map_wall_v2 |
Walls (for software with rooms support) |
color_map_wall |
Walls (for software without rooms support) |
color_new_discovered_area |
Newly discovered areas |
color_no_carpet_zones_outline |
Outline of no-carpet zones |
color_no_carpet_zones |
Fill of no-carpet zones |
color_no_go_zones_outline |
Outline of no-go zones |
color_no_go_zones |
Fill of no-go zones |
color_no_mop_zones_outline |
Outline of no-mopping zones |
color_no_mop_zones |
Fill of no-mopping zones |
color_obstacle_with_photo |
Obstacle with photo mark on a map |
color_obstacle |
Obstacle mark on a map |
color_path |
Path of a vacuum |
color_mop_path |
Mopped path of a vacuum (for vacuums that support mopping) |
color_predicted_path |
Predicted path to a point in goto mode |
color_robo |
Vacuum fill |
color_robo_outline |
Vacuum outline |
color_room_names |
Room names (if available) |
color_scan |
Areas not assigned to any room (for software with rooms support) |
color_unknown |
Other areas |
color_virtual_walls |
Virtual walls |
color_zones_outline |
Outline of areas selected for zoned cleaning |
color_zones |
Fill of areas selected for zoned cleaning |
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.
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:
chargercleaned_areagoto_pathignored_obstacles_with_photoignored_obstaclesmop_pathno_carpet_zonesno_go_zonesno_mopping_zonesobstacles_with_photoobstaclespathpredicted_pathroom_namesvacuum_positionvirtual_wallszonesEach 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 |
| 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 of image size in a given dimension. Available keys: [left, right, top, bottom] |
| Parameter | Type | Required | Default value | Description |
|---|---|---|---|---|
charger_radius |
float | false | 6 | Radius of a charger circle. |
vacuum_radius |
float | false | 6 | Radius of a vacuum semi-circle. |
obstacle_radius |
float | false | 3 | Radius of an obstacle circle. |
ignored_obstacle_radius |
float | false | 3 | Radius of an ignored obstacle circle circle. |
obstacle_with_photo_radius |
float | false | 3 | Radius of an obstacle with photo circle. |
ignored_obstacle_with_photo_radius |
float | false | 3 | Radius of an ignored obstacle with photo circle. |
path_width |
float | false | 1 | Width of path |
No open issues yet, or sync has not completed.