With this homebridge plugin can you control the xiaomi vacuum robots as fan in your Apple Home App (HomeKit).
This plugin use the new miio version 0.15.6 or newer, not like the old ones 0.14.1. Timeouts and API errors are a thing of the past!
- Fan as On-/Off-Switch. When switching off, directly back to the charging station.
- Fanspeed levels adjustable via 3D Touch / Force Touch.
- Battery status and condition in the device details. Low battery alert.
- Pause switch (optional).
- Room cleaning (optional): Read Autoroom generation to understand how it works
- Occupancy sensor (similar to motion sensor) for dock status (optional).
- Seconds Fan for water box modes (optional).
- Install git packages first with
sudo apt install git
. - Install the plugin as
root
(sudo su -
) withnpm install -g homebridge-xiaomi-roborock-vacuum@latest --unsafe-perm
. - Customize you homebridge configuration
config.json
. - Restart homebridge, ggf.
service homebridge restart
.
- Example
config.json
with one vacuum and room cleaning:
"accessories": [
{
"accessory": "XiaomiRoborockVacuum",
"name": "Xiaomi Mi Robot Vaccum 1st Generation",
"ip": "192.168.1.150",
"token": "abcdef1234567890abcdef1234567890",
"pause": false,
"dock": true,
"waterBox": false,
"cleanword": "cleaning",
"rooms": [
{
"id": 16,
"name": "Livingroom"
},
{
"id": 17,
"name": "Kitchen"
}
],
"zones": [
{
"name":"Family Room (x2)",
"zone":[[25000,25000,32000,32000,2]]
},
{
"name":"Bedroom",
"zone":[[21000,32000,24000,37000,1]]
},
{
"name":"Bedroom & Family Room",
"zone":[ [21000,32000,24000,37000,1], [25000,25000,32000,32000,1]]
}
]
}
],
- Example
config.json
with two vacuums:
"accessories": [
{
"accessory": "XiaomiRoborockVacuum",
"name": "Xiaomi Mi Robot Vaccum 1st Generation",
"ip": "192.168.1.150",
"token": "abcdef1234567890abcdef1234567890",
"pause": false,
"dock": true,
"waterBox": false
},
{
"accessory": "XiaomiRoborockVacuum",
"name": "Xiaomi Roborock S50 Vaccum 2nd Generation",
"ip": "192.168.1.151",
"token": "1234567890abcdef1234567890abcdef",
"pause": false,
"dock": true,
"waterBox": false
}
],
Name of parameter | Default value | Notes |
---|---|---|
silent |
false | when set to true, it will log only warning and error messages (hiding info and debug messages even when running homebridge -D |
pause |
false | when set to true, HomeKit shows an additional switch for "pause" - switch is on, when pause is possible |
pauseWord |
pause | used for naming the Pause comment |
findMe |
false | when set to true, HomeKit shows an additional switch for "find me" - if switched on, the vacuum will say "Hi, I am over here" |
findMeWord |
where are you | used for autonaming the "find me" command. E.g: Hey Siri, NameOfYourVacuum where are you |
dock |
false | when set to true, HomeKit shows an occupancy sensor, if robot is in the charging dock |
waterBox |
false | when set to true, HomeKit shows an additional slider to control the amount of water released by the robot (only selected models like S5-Max). Currently in a beta state |
cleanword |
cleaning | used for autonaming the Roomselectors |
rooms |
false | Array of ID / Name for a single Room. If set you have another switch for cleaning only this room |
zones |
false | Array of name / zone coordinates for a single zone group. A zone group may contain multiple zone squares, each with its own value for number of cleanings. Coordinates are laid out as bottom-left-x, bottom-left-y, top-right-x, top-right-y, number-of-cleanings. A separate tile in Home will be created for each zone group. Figuring out coordinates will take some trial and error. Each zone should be surrounded by brackets: [], with the entire value also surrounded by brackets |
autoroom |
false | set to true to generate rooms from robot (only S6) or set to array of room name strings (see semi automatic below) |
This feature seems to work with all models which offer room cleaning, but may not work on newer firmware versions (3.5.8_0358 or newer). To use it:
- Set the
autoroom
property in the config to an array of room names (["my room 1", "my room 2", "my room 3"]
. - In the Xiaomi Mi app, setup a timer at midnight (00:00 or 12:00am).
- Enable
Select a room to divide
. - On the map select the rooms in the order as they appear in the config set in step 1. The order is important as this is how the plugin maps the room names to IDs.
- Submit the timer and make sure it's deactivated.
- Restart
homebridge
.
This feature seems to be working on models that support naming the rooms in the Xiaomi / Roborock App. This is known to include the Roborock S6 as well as the S4 with firmware version 3.5.8_0358 or newer.
Even if you have one of these models but you haven't named the Rooms in your App yet, this function will not work! Thanks @domeOo
To use this plugin, you have to read the "token" of the xiaomi vacuum robots. Here are some detailed instructions:
- πΊπΈπ¬π§ - python-miio - Getting started
- π©πͺ - Apple HomeKit Forum - HomeKit.Community
- π©πͺ - Homematic-Guru.de