Coder Social home page Coder Social logo

marcelrv / xiaomirobotvacuumprotocol Goto Github PK

View Code? Open in Web Editor NEW
347.0 28.0 75.0 1.2 MB

Attempt to describe the Xiaomi Robot Vacuum Protocol

License: GNU General Public License v3.0

Java 69.29% Kaitai Struct 30.71%
xiaomi-smart-home xiaomi-robot xiaomi protocol vacuum

xiaomirobotvacuumprotocol's Issues

roborock.vacuum.m1s available features

Hi,
I checked functionality of some endpoints for roborock.vacuum.m1s with software version 3.5.4_0948:

  • app_segment_clean;
  • get_room_mapping.

They worked for me. Can you please add m1s to list of available devices?

I will continue to inform you about the availability of endpoints.

Thank you so much for your work!

Multi floor via api

Would it be possible currently using the api to change maps on a S5 Max and implement multi floor support before its official?
In a 3 floor house I would use something to trigger the api when the floor is changed then send the new map to the robot.

Persistent maps, virtual walls, and forbidden zones

Hello,

I came upon the following commands on a gen2 vacuum with v001780 firmware:

set_lab_status
start_edit_map
end_edit_map
save_map
reset_map
use_new_map
use_old_map
get_persist_map_v1

mirobo raw-command set_lab_status 1 allows the robot to "remember" maps after a reboot.
The start_edit_map, end_edit_map, and save_map appear to be related to the virtual walls and forbidden zones functionality. I believe a JSON is expected as parameters for the function.
I do not have the xiaomi app, and I was not able to figure out the format of these parameters.

Note that calling start_edit_map, end_edit_map, or save_map without first enabling the lab_status will result in the following response: The Lab Status is disable.

Not sure what the use_new_map, use_old_map, and get_persist_map do.

Unable to change map

Hello,
I've implemented my custom android app for sending commands to the vacuum Roborock S5 Max.
Many of the commands listed in this protocol are working, but I miss the option to switch map (to get the vacuum know that he has been moved into map 3 instead of 1). I tried also commands like:

reset_map
use_new_map
use_old_map
recover_map
get_recover_map
get_recover_maps

but I'm getting response "{'result': 'unknown_method', 'id': ...}"
My lab-status is 3
For enabling lab status (setting to 1, not sure if this should solve the issue) I'm getting: Error: {'code': -10005, 'message': 'Invalid parameters'}

Do you have any idea?
Or do you have even other solution to send the vacuum message "use map Nr. 3"?

empty array when trying get room mapping

hi, 1st. pretty good job with that node & support 4 those Vacuum cleaners.

  1. everytime if i try to get the room mappings for programming room or zone cleaning i get as output an empty array.
    Do u have any idea whats wrong with that?

I'm running a roborock s50 with latest firmware.

PROBLEM: Start room cleaning

Hi,

I have Roborock S7 device.

I want try start room cleaning command.
When I inject message with this payload to command node
{"method":"app_segment_clean","params":[16,22],"id":6764}

Node return this warning
"Miio Roborock error on command 'app_segment_clean': Param is not an array"

I don't understand warning text, because "params" IS an array.
Can you help me?

Thx.

Zone CleanUp

How to start cleaning in the specified zone.(area)
If I set this mode through mobile app I receive status=17. (getStatus)

S5 max - distance_off not worked as in docu described

Hi, I have a s5max and get your docu for distance_off. https://github.com/marcelrv/XiaomiRobotVacuumProtocol/blob/master/water_box_custom_mode.md

For the S5max you can't set the level with
method": "set_water_box_custom_mode", "params": {"water_box_mode": 207, "distance_off": 60},
the mode will set, but the level (distance_off) not.

I checked the network traffix and found out, that is done by
'method': 'set_water_box_distance_off', 'params': {'distance_off': 105}}

The calculation works as expected.

So perhaps you wan't to adapt this to your docu?

Question: Retrieve installed sound pack?

I spent time a few years back to create a custom voice pack for my Mi Robot Vacuum, but lost the original files. Is there any possibility to download the currently installed voice from the vacuum? I am afraid of loosing it if something someday goes wrong and I have to reset it...

Hello from xiaomiRobot

hi Marcel,
very great job,
thank you for your interest in our robot .
please be free to contact me when you have question about xiaomiRobot(Roborock).

Impossible to execute commands with arguments

It is impossible to execute any commands that contain arguments. It does not matter how arguments are submitted ā€“ with message.payload or in the node settings

All other commands are executed well.

My configuration :
node-red ver.0.18.4
node-red node: node-red-contrib-xiaomi-roborock 0.0.1
roborock commands: https://github.com/marcelrv/XiaomiRobotVacuumProtocol
roborock fw_ver: "3.3.9_001518"
roborock model: "roborock.vacuum.s5"

Could you please explain how to configure commands with arguments.

node setting
payload

'Get Room Mapping' for S5

Is there any chance to get the "get_room_mapping" also available for the S5 ? The method 'app_segment_clean' does actually work for the S5 when i transmit the id of the segment. But i have to find them by try and error... There for it would be great to have the "get_room_mapping" available for the S5. That would be awesome!
Thanks for your time.

get current coordinates and send to coordinates

Hello,

this is not a bug report, more like a query or feature reequest.

sorry if it is my fault, but could not find out how to get the current coordinates of the vac and how to send to specific coordinates.

Is there a way already developed or this would be a feature request?

thanks in advance

Ability to Empty dustbin.

In the app there's an Empty Dustbin (S7/S7MaxV here) that would be extremely useful to be able to run automation against.

Roborock S7 - Command to auto-empty in Dock

Hi,

I have the S7+ (with auto-empty dock) and i'm looking for the command to start the emptying.

Could you guide me in the process of reverse engineering it (if the command is not allready known) ?

Thanks for the great work !

Unable to get info using vacuum.send_command

Hello I am trying to get some info from my Roborock with Node-Red.

I used call service node and debug node to get the return information.

When I try f. ex

{
"command": "get_status",
"params": "battery"
}

or any other command which should return information I only get back payload with random string of numbers.

Q: Clean Segment multiple times.

I'd like to emulate the app functionality to allow multiple passes for rooms.
Could this be achieved by chaining sements ids?

{
    "method": "app_segment_clean",
    "params": [16, 16, 16],
    "id": 6764
}

Start Selective Room Cleaning

Roborock S6 and S5 Max and perhaps other models have the selective room cleaning.

Which command can I use to start cleaning a specific room?

The command app_zoned_clean is only for a square zone. Is there a command e.g. like this?

For example:

{
  "id": 8338,
  "method": "app_room_clean", // ????
  "params":[
    "Kitchen", // Room name, as they were named in the app
    "Living room" // further rooms
  ]
}

How to use voice command to instruct no of cycles

Right now voice command is just used to clean the zones/rooms.
But i wpould like to instruct the no of cyles too (ex Roborock, Clean my bedroom twice (2 cycles) ).
Also i cannot add the cycles in app after voice command to clean a room

Read Status dustbin

Hello,

is it possible to recognize the status of the dustbin? I do not mean the level, but whether the dustbin was removed or was used again ...

add basic support for viomi vacuum v7

I've been texting several times in the openhab community but i was ignored.
I got the basic commands for the Viomi vacuum v7. It would be nice to have them in openhab to test them out
{ "deviceMapping": { "id": [ "viomi.vacuum.v7" ], "channels": [ { "property": "battary_life", "friendlyName": "Battery Level", "channel": "battery", "type": "Number", "refresh": true, "ChannelGroup": "Status", "actions": [] }, { "property": "run_state", "friendlyName": "Vacuum State", "channel": "state", "type": "Number", "refresh": true, "ChannelGroup": "Status", "actions": [] }, { "property": "box_type", "friendlyName": "Vacuum Status", "channel": "boxtype", "type": "Number", "refresh": true, "ChannelGroup": "Status", "actions": [] }, { "property": "mop_type", "friendlyName": "Vacuum Mop Type", "channel": "moptype", "type": "Number", "refresh": true, "ChannelGroup": "Status", "actions": [ { "command": "set_mop", "parameterType": "NUMBER" } ] }, { "property": "suction_grade", "friendlyName": "Vacuum Power", "channel": "suctiongrade", "type": "Number", "refresh": true, "ChannelGroup": "Status", "actions": [ { "command": "set_suction", "parameterType": "NUMBER" } ] }, { "property": "water_grade", "friendlyName": "Vacuum Mop Type", "channel": "watergrade", "type": "Number", "refresh": true, "ChannelGroup": "Status", "actions": [ { "command": "set_suction", "parameterType": "NUMBER" } ] }, { "property": "err_state", "friendlyName": "Error State", "channel": "errorstate", "type": "Number", "refresh": true, "ChannelGroup": "Status", "actions": [] }, { "property": "is_mop", "friendlyName": "Vacuum Type", "channel": "ismop", "type": "Number", "refresh": true, "ChannelGroup": "Status", "actions": [ { "command": "set_mop", "parameterType": "NUMBER" } ] }, { "property": "set_charge", "friendlyName": "Send to Dock", "channel": "setcharge", "type": "Switch", "refresh": true, "ChannelGroup": "Actions", "actions": [ { "command": "set_charge", "parameterType": "ONOFF" } ] }, { "property": "set_language", "friendlyName": "Set Language", "channel": "setlanguage", "type": "Number", "refresh": true, "ChannelGroup": "Actions", "actions": [ { "command": "set_language", "parameterType": "NUMBER" } ] }, { "property": "set_light", "friendlyName": "Set Light", "channel": "setlight", "type": "Switch", "refresh": true, "ChannelGroup": "Actions", "actions": [ { "command": "set_light", "parameterType": "ONOFF" } ] }, { "property": "set_mode_withroom", "friendlyName": "Set Mode", "channel": "setlanguage", "type": "String", "refresh": true, "ChannelGroup": "Actions", "actions": [ { "command": "set_mode_withroom", "parameterType": "STRING" } ] } ] } }

New status code

Hi,

I have just bought the Xiaomi vacuum cleaner and I noticed a state that wasn't created
state: 16, this is in respone of the "Go to" command"

Kind regards
Koen

S7 - water level Low

Hi,

I have the S7 (roborock.vacuum.a15), this also shows a message in the app when the water is running low (water level low).

Is it possible to query this?

How can I get to the map?

It may be a very stupid question, but could you please describe how I can get my hands on the current map file? I really don't want to simply screenshot my android app screen, there must be a better way. Can I get access to the map without rooting the robot itself? I have the first version of the robot and I want to use it to create a floor plan of my house.
I think you mentioned that maps are stored in robot.db inside the device itself, but that file can only be accessed once the device via rooted, correct? Is there anything on the android device or on the cloud I can use?

How can i find coordinates to use in "app_goto_target" and "app_zoned_clean"

Hi,

i use NodeRed and i can trigger a room cleaning and so on.
I would love to use my triggers as well for "app_zoned_clean".
But im unable to guess which coordinates are mine.
Since i dont see "get_map_v1" in the NodeRed pulldown, im a bit clueless how to obtain my coordinates.

I use node-red-contrib-miio-roborock 2.3.2

I tried to Pin-and-Go in the App and hoped to get the position back, but without any luck.

Would use it for physical buttons to trigger small cleaning jobs.

At least one coordinate would be usefull, because the rest i could manage myself with try&error. But since it seems im way off with my guesses, im clueless.

Thanks
Erich

Reverse engineering

It looks like all commands are reverse engineered. Maybe this can help somehow to get the commands out of the vacuum that are still unknown or unclear.

I came across a page pointed out to me by a dev that made the integration for the mi heater. It seems like Xiaomi has hidden pages on the internet with all info per device. The challenge would be to find the right one for the job...

This page has all the commands for the za1 heater:
https://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:heater:0000A01A:zhimi-za1:1

Replacing the last part A:zhimi-za1:1 with A:zhimi-zb1:1

You will get the smart heater zb1's commands

Me as a n00b have managed to successfully turn my heater on and off just using node red commands. Even Timers and stuff can be read. So I guess If you find the page for the vacuums and other devices. You can do everything and even more the Xiaomi app can do

I guess there is a page like this for every Xiaomi device out there. The challenge would be to get all pages from that website

Question: Send command to Dreame D9

Hello,

I bought a Dreame D9 and was hoping I can send commands like app_start by using openhab, but nothing happens. Iā€˜m not sure if this is related to the binding or because the Dreame is not listed here as compatible device. Any idea how I can try to fix it?

Bye,
Christian

Mopping mode on Xiaomi Robot Vacuum 2

Mopping mode is set in the same section as suction power (fan level) in Mi Home app. It also says that it decreases suction a lot (it warns that it will be only set for the next cleaning session and then will change to previous mode). I guess it also changes the way robot moves to mop efficiently.

I wonder how would you set it through protocol. I will update this issue once I'll get any info about mopping mode and how to set it using miio protocol.

Any tips on capturing Mi Home app traffic on non-rooted device?

Resume zoned cleanup

Hi,

What command should I pass to resume a zoned cleanup?
Thanks for reverse engineering xiaomi vacuum protocol!

How can control the mop_mode

Hi,

msg.payload.mop_mode can't be changed. How do I have to do it. I would like to change it from 300 to 301.

Best Regards

Chris

Roborock S7 MaxV Firmware Features

An FYI: I have run the "get features" command on my Roborock S7 MaxV (a27 model number) and received the following:

array[15]
[0 ā€¦ 9]
0: 111
1: 112
2: 113
3: 114
4: 115
5: 116
6: 117
7: 118
8: 119
9: 120
[10 ā€¦ 14]
10: 121
11: 122
12: 123
13: 124
14: 125

Feel free to update documentation to express compatibility with this new device.

Set cleaning "strength"?

Hi,
the Xiaomi-App supports a setting to switch between Quiet, Normal and Turbo. This worked on Roborock S5 at least, also with a forced firmware upgrade to 5S, seems to be a standard thing. Is there an API call i can make to switch the vacuum to "Quiet" for example?

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.