Home

Awesome

Logo

ioBroker mihome-vacuum adapter

Paypal Donation

Number of Installations Number of Installations NPM version

Test and Release Translation status Downloads

Deutsche beschreibung hier

This adapter allows you to control the Xiaomi vacuum cleaner.

This adapter uses Sentry libraries to automatically report exceptions and code errors to the developers. For more details and for information how to disable the error reporting see Sentry-Plugin Documentation! Sentry reporting is used starting with js-controller 3.0.

Content

Supported Devices and Features

DeviceBasic Controlhistoryroomsmap
viomi.vacuum.v6:heavy_check_mark::x::x::x:
viomi.vacuum.v7:heavy_check_mark::x::x::x:
viomi.vacuum.v8:heavy_check_mark::x::x::x:
rockrobo.vacuum.v1:heavy_check_mark::heavy_check_mark::x::heavy_check_mark:
roborock.vacuum.s4:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
roborock.vacuum.s5:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
roborock.vacuum.s5e:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
roborock.vacuum.m1s:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
roborock.vacuum.a10:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
roborock.vacuum.a15:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
dreame.vacuum.r2205:heavy_check_mark::heavy_check_mark::x::x:
dreame.vacuum.r2216o:heavy_check_mark::heavy_check_mark::x::x:
dreame.vacuum.r2228o:heavy_check_mark::heavy_check_mark::x::x:
dreame.vacuum.p2008:heavy_check_mark::heavy_check_mark::x::x:
dreame.vacuum.p2009:heavy_check_mark::heavy_check_mark::x::x:
dreame.vacuum.p2027:heavy_check_mark::heavy_check_mark::x::x:
dreame.vacuum.p2028:heavy_check_mark::heavy_check_mark::x::x:
dreame.vacuum.p2029:heavy_check_mark::heavy_check_mark::x::x:
dreame.vacuum.p2036:heavy_check_mark::heavy_check_mark::x::x:
dreame.vacuum.p2041o:heavy_check_mark::heavy_check_mark::x::x:
dreame.vacuum.p2114a:heavy_check_mark::heavy_check_mark::x::x:
dreame.vacuum.p2148o:heavy_check_mark::heavy_check_mark::x::x:
dreame.vacuum.p2156o:heavy_check_mark::heavy_check_mark::x::x:

Known Errors

Error at installation

if your installation runs in error. The canvas package could not be installed

npm ERR! canvas@2.6.1 install: node-pre-gyp install --fallback-to-build npm ERR! Exit status 1

Please install canvas and the libs manually with: sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev

switch into : cd /opt/iobroker/node_modules/iobroker.mihome-vacuum then npm install canvas

HTTP error when getting token cookie{}

Sometimes you can't connect to the xiaomi cloud. Please open Browser, go to Mihome and login. Enter the code you received via mail. After that, the connection should work.

Gets only Helo message Timeout

PLease be sure, that you robot is connected with the Mihome App and NOT with the Roborock App

No connection with S7

Currently there is a problem, if the robot and ioBroker are not use the same subnet.

Configuration

Currently, finding the token is the biggest problem. One option to extract the token is using this utility: https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor

Otherwise please follow the instruction in the Link:

Token tutorial.

Adapter Configuration

Control over Alexa

The special control state clean_home will be created for Alexa. It is a switch which starts at true the sucker and at false it goes home. It becomes automatically a smart device in the cloud Adapter created with the name "vacuum cleaner", which can be changed in the cloud adapter.

Resume paused zone-cleaning with start button

With this option enabled, the Vacuum will resume the zone-cleaning when setting the "start" state to true if it was paused during a running zone-clean. If this option is disabled, the vacuum will start a new "normal cleaning" when you send the start command, even if it was paused during a running zone-clean.

Second robot

If two robots are to be controlled via ioBroker, two instances must be created. For the second robot the own port (default: 53421) for IoBroker must changed, so that both robots can archieve ioBroker via different ports.

Map Config

There are two ways to get the map. The first get the map from the cloud. Therefore, you have to log in and select the right robot from the list

Second way is the map from valetudo (only local connection). Therefore, you have to root and install valetudo to your device. You can use Valetudo RE or normal Valetudo.

Config

- #2211FF
- rbg(255,200,190)
- rgba(255,100,100,0.5) //for Transparent
- green

Map Usage

The map is stored either as base64-raw or as PNG.

You can find the map image in the following data points:

You can use both images as image source in the VIS you want. In HTML-style you can use the image in this way:

<img src="mihome-vacuum.0.cleanmap.map64">

With additional style-tags you can resize and/or format the map style.

To use the map in jarvis just use one of the data points as URL of the DisplayImage-Widget. There you can resize the image or the whole widget. In case of the responsive design of jarvis the Map will resize in case of the display size.

To display the map in ioBroker VIS you can use a normal html Widget e.g:

[{"tpl":"tplHtml","data":{"g_fixed":false,"g_visibility":false,"g_css_font_text":false,"g_css_background":false,"g_css_shadow_padding":false,"g_css_border":false,"g_gestures":false,"g_signals":false,"g_last_change":false,"visibility-cond":"==","visibility-val":1,"visibility-groups-action":"hide","refreshInterval":"0","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0,"html":"{mihome-vacuum.0.map.map64}"},"style":{"left":"0","top":"0","width":"100%","height":"100%"},"widgetSet":"basic"}]

The use of the base64-map is faster and will display the position of the robot nearby in realtime.

Functions

Commands of the S50 (second generation)

The card size is always 52000mm x 52000mm thus values from 0 to 51999mm are possible. Unfortunately, the position and location of the card can not be queried, this can change from suction to suction. Used as a basis is always the last suction card, as well as in the app. If the robot only picks up one area and always builds the map the same way, you can reliably send it to places or have the area vacuumed.

GoTo

In order to drive the vacuum cleaner to a point, the "goTo" object must be filled as follows:

xVal, yval

The values must satisfy the above scope and indicate the x and y coordinates on the map.

Example:

24,850.26500

Zone cleaning

To vacuum a zone, ZoneClean must be filled as follows:

[X1, y1, x2, x2, count]

Where x and y are the coordinates of the rectangular area and "count" the cleaning operations. You can also let several areas suck at once:

[X1, y1, x2, x2, count], [x3, y3, x4, x4, count2]

Example:

[24117,26005,25767,27205,1], [24320,24693,25970,25843,1]

Rooms

newer vacuum cleaner with the latest Home App supports the definition of rooms, see Video

Each room in the current map has an index, which is then assigned to the room from the app. From the robot we only get a mapping with room number and index. The adapter queries these rooms every time the adapter starts and creates a channel for each room, which then knows the current room index. The same happens manually with the button loadRooms. This channel can then be assigned to the ioBroker rooms. If the button roomClean is pressed, the index of the card is determined and sent to the robot, so that it can then vacuum this room. Before that the FAN power is set for single room suction. If you don't have the possibility to name the rooms in the app yet, there is also the possibility to create such a channel manually by specifying the map index. It is also possible to add zone coordinates instead of mapIndex. If you want to clean several rooms spontaneously, you can do this via multiRoomClean by assigning the ioBroker rooms to this data point and then pressing the button.

Timer

As soon as the vacuum cleaner supports the room function (see above), it is also possible to create timers, which then trigger the corresponding room channels or determine their mapIndexes. The timer could trigger via rooms and/or room channels directly. The timers themselves are created via the config area, but then become a data point. There, each timer can be activated/deactivated or skipped once. A direct start is also possible. The advantage of the ioBroker timers is that they can be displayed and used in the VIS and you can disconnect the robot from the internet, because the timers of the app are triggered from China.

Send your own commands

NOTE: This function should only be used by experts, as the sucker might be damaged by wrong commands

The robot distinguishes between the commands in methods (methods) and parameters (params) which serve to specify the methods. Under the object mihome-vacuum.X.control.X_send_command you can send your own commands to the robot. The object structure must look as follows: method; [params], eg app_segment_clean;[18,20]

Under the object mihome-vacuum.X.control.X_get_response, the response is entered by the robot after sending. If parameters were queried, they appear here in the JSON format. If only one command was sent, the robot responds only with "0".

The following methods and parameters are supported:

methodparamsDescription
get_timerReturns the set timerSetting the suction times BSp. 12 o'clock 30 in 5 days
set_timer[["TIME_IN_MS",["30 12 * * 1,2,3,4,5",["start_clean",""]]]]Enable / disable timer
upd_timer["1481997713308","on/off"]
Rescues the times of the Do Not Disturb
get_dnd_timerDelete DND times
close_dnd_timerDND Setting h, min, h, min
set_dnd_timer[22,0,8,0]
app_rc_startStart Remote Control
app_rc_endFinish Remote Control
app_rc_move[{"seqnum":'0-1000',"velocity":VALUE1,"omega":VALUE2,"duration":VALUE3}]Move. Sequence number must be continuous, VALUE1 (speed) = -0.3-0.3, VALUE2 (rotation) = -3.1-3.1, VALUE3 (duration)
app_segment_clean[12,15]clean romm with Index 12 and 15

more methods and parameters you can find here (Link).

Send custom commands with sendTo

You can also send those custom commands from other adapters with sendTo. Usage with method_id and params as defined above:

sendTo("mihome-vacuum.0", "sendCustomCommand", 
    {method: "method_id", params: [...] /* optional*/}, 
    function (response) { /* do something with the result */}
);

The response object has two properties: error and (if there was no error) result.

A couple of predefined commands can also be issued this way:

sendTo("mihome-vacuum.0", 
    commandName, 
    param, 
    function (response) { /* do something with the result */}
);
sendTo("mihome-vacuum.0", 
    commandName, 
    {param1: value1, param2: value2, ...}, 
    function (response) { /* do something with the result */}
);

if only a single param is possible, you can send a string only otherwise you have to use an object with expected params, eg:

sendTo("mihome-vacuum.0", 
    "setFanSpeed", 
    "105", 
    function (response) { /* do something with the result */}
);
sendTo("mihome-vacuum.0", 
    "setFanSpeed", 
    {"fanSpeed" : 105}, 
    function (response) { /* do something with the result */}
);

The supported commands are:

DescriptioncommandNameRequired paramsRemarks
Start the cleaning processstartVacuuming- none -
Stop the cleaning processstopVacuuming- none -
Pause the cleaning processpause- none -
Clear waiting jobsclearQueue- none -
Clean a small area around the robotcleanSpot- none -
Go back to the basecharge- none -
Say "Hi, I'm over here!"findMe- none -
Check status of consumables (brush, etc.)getConsumableStatus- none -
Reset status of consumables (brush, etc.)resetConsumablesconsumableString: filter_work_time, filter_element_work_time, sensor_dirty_time, main_brush_work_time, side_brush_work_time
Get a summary of all previous cleaning processesgetCleaningSummary- none -
Get a detailed summary of a previous cleaning processgetCleaningRecordrecordId
Get a mapgetMap- none -Unknown what to do with the result
Get the current status of the robotgetStatus- none -
Retrieve the robot's serial numbergetSerialNumber- none -
Get detailed device informationgetDeviceDetails- none -
Retrieve the do not disturb timergetDNDTimer- none -
Set a new do not disturb timersetDNDTimerstartHour, startMinute, endHour, endMinute
Delete the do not disturb timerdeleteDNDTimer- none -
Retrieve the current fan speedgetFanSpeed- none -
Set a new fan speedsetFanSpeedfanSpeedfanSpeed is a number between 1 and 100
Retrieve the current waterbox modegetWaterBoxMode- none -
Set a mop modesetMopModemopModemopMode is a number between 300 and 303
Retrieve the current mop modegetMopMode- none -
Set a waterbox modesetWaterBoxModewaterBoxMode| {waterBoxMode:waterBoxMode,waterBoxLevel:waterBoxLevel}waterBoxMode is a number between 200 and 204 or 207 -> then you have to provede also waterBoxLevel as number between 1 - 30
Start the remote control functionstartRemoteControl- none -
Issue a move command for remote controlmovevelocity, angularVelocity, duration, sequenceNumberSequence number must be sequentially, Duration is in ms
End the remote control functionstopRemoteControl- none -
clean room/roomscleanRoomsroomsrooms is a comma separated String with enum.rooms.XXX
clean segmentcleanSegmentsrooms | {rooms:rooms,waterBoxMode:waterBoxMode,mopMode:mopMode,fanSpeed:fanSpeed}rooms is a number or an Array with mapIndex or comma separated String with mapIndex
clean zonecleanZonecoordinates | {coordinates:coordinates,waterBoxMode:waterBoxMode,mopMode:mopMode,fanSpeed:fanSpeed,repeat:iterations}coordinates is a String with coordinates and count, see zoneClean
start Dust collectingstartDustCollect- none -
stop Dust collectingstopDustCollect- none -
start Mop washingstartWashMop- none -
stop Mop washingstopWashMop- none -

Widget

Widget

Bugs

Changelog

<!-- Placeholder for the next version (at the beginning of the line): ### **WORK IN PROGRESS** * () -->

WORK IN PROGRESS

4.2.0 (2024-04-01)

4.1.1 (2024-01-06)

4.1.0 (2023-10-31)

4.0.0 (2023-08-15)

3.11.0 (2023-05-12)

3.10.1 (2023-04-10)

3.10.0 (2023-04-07)

3.9.5 (2023-01-13)

3.9.4 (2023-01-11)

3.9.3 (2023-01-11)

3.9.2 (2023-01-06)

3.9.1 (2023-01-06)

3.9.0 (2023-01-04)

3.8.8 (2022-11-30)

3.8.7 (2022-11-26)

3.8.6 (2022-11-12)

3.8.5 (2022-11-10)

3.8.4 (2022-11-07)

3.8.3 (2022-11-01)

3.8.2 (2022-10-31)

3.8.1 (2022-10-30)

3.8.0 (2022-10-30)

3.7.0 (2022-10-28)

3.6.0 (2022-07-07)

3.5.0 (2022-06-29)

3.4.2 (2022-06-24)

3.4.1 (2022-05-31)

3.4.0 (2022-05-28)

3.3.6 (2022-05-03)

3.3.5 (2022-02-07)

3.3.3 (2022-01-20)

3.3.1 (2021-10-02)

3.3.0 (2021-10-01)

3.2.2 (2021-07-16)

3.2.1 (2021-07-02)

3.2.0 (02.06.2021)

3.1.10 (23.05.2021)

3.1.6 (05.05.2021)

3.1.5 (03.05.2021)

3.1.1 (18.4.2021)

2.2.5 (2021-04-02)

2.2.4 (2020-09-15)

2.2.3 (2020-08-20)

2.2.0 (2020-08-13)

2.1.1 (2020-07-10)

2.0.10 (2020-07-05)

2.0.9 (2020-03-05)

2.0.8 (2020-02-26)

2.0.7 (2020-02-25)

2.0.6 (2020-02-17)

2.0.4 (2020-02-13)

1.10.5 (2020-02-11)

1.10.4 (2020-02-06)

1.10.1 (2020-01-20)

1.10.0 (2020-01-17)

1.1.6 (2018-12-06)

1.1.5 (2018-09-02)

1.1.4 (2018-08-24)

1.1.3 (2018-07-11)

1.1.2 (2018-07-05)

1.1.1 (2018-04-17)

1.1.0 (2018-04-10)

1.0.1 (2018-01-26)

0.6.0 (2017-11-17)

0.5.9 (2017-11-03)

0.5.7 (2017-08-17)

0.5.6 (2017-07-23)

0.5.5 (2017-06-30)

0.3.2 (2017-06-07)

0.3.1 (2017-04-10)

0.3.0 (2017-04-08)

0.0.2 (2017-04-02)

0.0.1 (2017-01-16)

License

The MIT License (MIT)

Copyright (c) 2023-2024 iobroker community developers iobroker-community-adapters@gmx.de
Copyright (c) 2017-2023 bluefox dogafox@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.