Support of Xiaomi vacuum mop 2 pro (ijai.vacuum.v3)

Could you please add support of Xiaomi vacuum mop 2 pro (ijai.vacuum.v3) - it has been added within python-miio lib, that seems used to xiaomi-vacuum platform, so probably it is not so complicated to add.

+1 here, original issue on GitHub is closed

python miio merged support for it, is there anything we can do to help?

1 Like

Just got my device, and seems to work just fine with HASS.

  • add device to Xiaomi Home app as usual
  • install Xiaomi Miot Auto from HACS (LINK)
  • extract token from Xiaomi Cloud (LINK)
  • configure device to work over cloud or local. I configured local connection

I got 1 new device and 12 new entities.
Didn’t try to run it from HASS yet, but status is updated fine and I can see various modes to select.

So maybe not out of the box, but this device can work with HASS just fine.

EDIT: Map Extractor and room selection currently does not work.

2 Likes

Thanks for the guide here. I got it running fine. One note for anyone else is that it only appeared when I did the local setup.

The map extractor is definitely not working. The map format is different. There’s an issue open on the github for this family of devices,

@shax you’re right, python-miio indeed added support for ijai.vacuum.v3

Though there wasn’t any release yet (latest release was in July 2022).
I just wonder how much time it’ll take for them to release and then for HA core to update the version.

I doubt it’s coming anytime soon.
I was able to run the latest python-miio version from current source but there is only basic functionality (ie. no list of rooms, no room support etc…).
But as far as I could tell, problem is with lack of support in Xiaomi API for this specific device.
python-miio allows you to send raw commands and using official API specification I didn’t have any success in getting any of “ROOM” functions to work (I did get some info in the end but failed to make any use of it to send it as a parameter to vacuum).
Most of the other features that actually work are implemented in python-miio, I suppose those left out are the ones that don’t actually work.

Currently I’ve just build the virtual walls in my map, and made automation in HASS for daily vacuum.

1 Like

I managed to get “point” cleaning to work.
That’s limited to a 2m x 2m area but that’s the only way to somehow clean a particular area without calling a global cleanup… (I tested the whole API like @shax, trying to get ‘rooms’ without any other success).

To set up that correctly:

  • open the mobile app and select a “target point” to clean 2x2m,
    and run the command get_property_by 9 5 to read the point coordinates. The output will be for example: [{'value': '2.333,-2.145', 'did': '9-5', 'siid': 9, 'piid': 5, 'code': 0}]
  • Set the point (if you want to use more points you have to set them before starting cleaning): set_property_by 9 5 '2.333,-2.145'
  • start the “point cleaning”: call_action_by 9 1

*Today, I additionally had to make sure to disable “mopping”, I added set_property by 2 4 0 to my automation.

I’m using appdaemon, so my code looks like this:


def init_vacuum():
    return MiotDevice(ip="192.168.*.*", token="*********")  # paste your IP & token :)


def run_vacuum_point(vacuum, target):
    vacuum.set_property_by(siid=2, piid=4, value=0)
    vacuum.set_property_by(siid=9, piid=5, value=target)
    vacuum.call_action_by(siid=9, aiid=1)


def run_vacuum_point_door(vacuum):
    target = '2.333,-2.145'
    run_vacuum_point(vacuum, target)


def run_vacuum_point_kitchen(vacuum):
    target = '-0.008,-6.234'
    run_vacuum_point(vacuum, target)

In the Appdaemon addon, add python-miio to python packages in the configuration

Else enable miot cloud (Config account in YAML)

then you can send to clean specific rooms

get map

{"did":"dddddd","siid":10,"aiid":1}

reset map

{"aiid":10,"did":"dddddd","in":[1681894220],"siid":7}

set map

{"aiid":15,"did":"1025324792","in":[0],"siid":10}

set name map rooms (parameters taken from the log) these parameters are not obtained in the logs, they are only transmitted, possibly mihome keeps the room id in memory after creation

{"aiid":18,"did":"dddddd","in":[1681894220,"[[\"15391\",14],[\"15478\",13],[\"15479\",15],[\"15497\",11],[\"15528\",12],[\"15794\",10]]"],"siid":10}

clear room 13,11

{"aiid":3,"did":"dddddd","in":["11,13",0,1],"siid":7}

Could someone translate this from Professional-Programmer to Dummy-User?
What do i have to do, where do i have to do it?

My First tutorial :slight_smile:

alias: уберись в прихожей
sequence:
  - service: xiaomi_miot.call_action
    data:
      entity_id: vacuum.ijai_v3_5394_robot_cleaner
      siid: 10
      aiid: 1
      throw: true
  - service: xiaomi_miot.call_action
    data:
      entity_id: vacuum.ijai_v3_5394_robot_cleaner
      siid: 10
      aiid: 18
      throw: true
      params:
        - 1681894220
        - >-
          [["15391",14],["15478",13],["15479",15],["15497",11],["15528",12],["15794",10]]
  - service: xiaomi_miot.set_miot_property
    data:
      entity_id: vacuum.ijai_v3_5394_robot_cleaner
      siid: 2
      piid: 8
      value: 7
  - service: xiaomi_miot.call_action
    data:
      entity_id: vacuum.ijai_v3_5394_robot_cleaner
      siid: 7
      aiid: 3
      throw: true
      params:
        - "12"
        - 0
        - 1
mode: single
icon: mdi:vacuum

Xiaomi vacuum mop 2 pro (ijai.vacuum.v3) Home Assistant API parts 1
Xiaomi vacuum mop 2 pro (ijai.vacuum.v3) Home Assistant API parts 2

1 Like

Hi @dimadima , Thanks, this is working for me.

So if i wanted to clean 2 rooms, i am able to do it like below:

  siid: 7
  aiid: 3
  throw: true
  params:
    - "13,12"
    - 0
    - 1

But just wanted to know, what the - 0 and 1 are for.

Also, when I try to mop and sweep via home assistant without attaching the Mop attachment, it just changes to sweep and then just starts vacuuming, so , i want to show some error when mop attachment is not attached instead of vacuuming.

Edited: (Update)

Never mind, Found the attribute sweep.door_state

0 - Both the dust bin and mop are detached.
1 - Dust Bin attached, Mop detached.
2 - Mop attached, Dust bin detached.
3 - Both Mop and Dust bin attached.

I will now be able to use these for warnings and errors based on the status.

Although I would still like to know what the params - 0 and 1 are in xiaomi_miot.call_action for cleaning rooms.

Hi,

The params are:

  • 24 - clean-room-ids
  • 25 - clean-room-mode
  • 26 - clean-room-oper

You can find all the actions and properties in: MIOT Specs

1 Like

Thanks,

Do you by any chance know what shake-shift property under Sweep is?

tank-shake is the vibration mopping. Not sure what shake-shift is - it is in Mid by default.

I suppose to enter the room id if i use 24 as parameter… How do i do this?

Hi @Herian ,

First you need to know your room id’s, i found my room ids with a script and trial and error test. The homeassistant script is something like:

living_sweep:
  alias: Living sweep
  sequence:
  - service: xiaomi_miot.call_action
    data:
      entity_id: vacuum.aspiradora
      siid: 7 # 'sweep'
      aiid: 3 # action id: 'set-room-clean'
      params:
      - '14' # -> 24 - clean-room-ids: (if you want to sweep many rooms put ids separated by commas)
      - 0 # -> 25 - clean-room-mode: [0=entire room, 1=only borders]
      - 1 # -> 26 - clean-room-oper: [0=stop, 1=start, 2=pause, 3=timeout]
1 Like

I can’t get it work.
This is the script in “call action” in home assistant just to try it out

service: xiaomi_miot.call_action
data:
siid: 7
aiid: 3
entity_id: vacuum.ijai_v3_bb91_robot_cleaner
throw: true
params: 24

In this case i have a “code:0” as answer.

Where i have to insert the rooms id?

+1 indeed the map doesn’t work, please fix it

Hi @Herian ,

You need 3 params, check the example in my other answer. In the example my room id is “14” (24 value in the comments is only an index in the API documentation).

Hi everyone,
does anybody knows how I set the actions for the room (like sweep/mop and fan speed) like the app offers to me?

And fun fact you can get the room ids from the devices file in the ./config/.storage/xiaomi_miot directory

Works perfect for xiaomi robot vacuum s10 ( ijai.vacuum.v17)