python-miio icon indicating copy to clipboard operation
python-miio copied to clipboard

Unsupported model ijai.vacuum.v19

Open Revyen opened this issue 2 years ago • 14 comments

Before submitting a new request, use the search to see if there is an existing issue for the device.

Device information:

  • Name(s) of the device: Xiaomi Robot Vacuum-Mop 2S
  • Link: https://home.miot-spec.com/s/ijai.vacuum.v19

Use miiocli device --ip <ip address> --token <token>.

  • Model: ijai.vacuum.v19
  • Hardware version:
  • Firmware version: 4.1.8_0076

Revyen avatar Apr 12 '22 16:04 Revyen

I just got a Mop 2s and was bummed to see that it wasn't supported by home assistant.

Please do let me know if anyone is working on supporting this device. If that's not the case, I'm happy to give it a try.

garritfra avatar Jun 11 '22 08:06 garritfra

So far I found no working solution or work around. I myself are fairly new to this an la King proper knowledge to implementiert this myself.

If you @garritfra would give it a try I would be gratefull

Revyen avatar Jun 11 '22 12:06 Revyen

@Revyen fyi: after digging around a bit I found out that the Mop 2s is actually not based on miio as this tool implies, but it's built on top of the newer miot protocol/API/software product. I got my vacuum into Homeassistant using this extension in the HACS store:

https://github.com/al-one/hass-xiaomi-miot

Triggering individual functions of the robot is extremely finicky, but once you got the hang of how miot works, you can throw together a script that you can reuse. Let me know if you need any help.

garritfra avatar Jun 12 '22 21:06 garritfra

@Revyen fyi: after digging around a bit I found out that the Mop 2s is actually not based on miio as this tool implies, but it's built on top of the newer miot protocol/API/software product. I got my vacuum into Homeassistant using this extension in the HACS store:

https://github.com/al-one/hass-xiaomi-miot

Triggering individual functions of the robot is extremely finicky, but once you got the hang of how miot works, you can throw together a script that you can reuse. Let me know if you need any help.

Can u post an example of your scripts? I want to integrate my Mop 2S in HA

danichispa avatar Jun 13 '22 20:06 danichispa

Sure. This is a script that cleans a single room:

alias: Clean Kitchen
sequence:
  - service: xiaomi_miot.call_action
    data:
      entity_id: vacuum.ijai_v19_9a2c_robot_cleaner. 
      siid: 7   # Service ID for 'sweep'
      aiid: 3   # Action ID for 'set-room-clean'
      params:
        - '10'   # Room ID to clean. I brute forced these IDs to map it to the rooms, but I'm sure there is a working endpoint for this somewhere. 
        - 0      # 0 = 'Global'
        - 1      # 1 = 'start'
mode: single
icon: mdi:sofa-single

For the siids and aiids, you can refer to the spec.

I'm planning on writing this down in more detail on my blog, but you should be able to get started with this.

You might also be interested in this card. I found that the (probably way superior) vacuum map card didn't work for me out of the box, since extracting the map requires the Vacuum to be on the same LAN as the HA box, which isn't the case for me.

garritfra avatar Jun 14 '22 06:06 garritfra

I'm planning on writing this down in more detail on my blog, but you should be able to get started with this.

You might also be interested in this card. I found that the (probably way superior) vacuum map card didn't work for me out of the box, since extracting the map requires the Vacuum to be on the same LAN as the HA box, which isn't the case for me.

Thank you! Will take a look on your blog to see more detailed instructions. Now I need to figure out how to get room IDs

danichispa avatar Jun 14 '22 15:06 danichispa

I found that the (probably way superior) vacuum map card didn't work for me out of the box, since extracting the map requires the Vacuum to be on the same LAN as the HA box

Are you sure about this? I have vacuum on same Lan than HA, have tried but no luck. https://github.com/PiotrMachowski/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor/issues/259#issuecomment-1155302342

In the other hand do you know some documentation about how to use the API to retrieve room ids?

drunkly avatar Jun 15 '22 11:06 drunkly

Are you sure about this? I have vacuum on same Lan than HA, have tried but no luck.

I at least thought it would be this way. I wasn't aware that ijai vacuums are not supported yet.

In the other hand do you know some documentation about how to use the API to retrieve room ids?

I'm afraid I can't point to anything specifically. AFAIK room IDs start at 10 and go up from there. For me, it was a matter of sending the command with a room id, seeing where the robot went and taking note.

There is the room_ids property (service 2, property 10), but it's neither readable (green badge with chinese text) nor writable (blue badge), so it's more or less useless. I'd love to hear if you get this working though.

garritfra avatar Jun 15 '22 15:06 garritfra

About rooms I maded it work same way like you. just trying numnbers, in my case were (10,11,12). About map extractor was impossible for me. So give up with the map.

drunkly avatar Jun 24 '22 11:06 drunkly

Thanks @garritfra for keeping us posted. I want to integrate the Mop 2 Pro to HomeBridge as well. Current plugin seems to be using older version miio.

Update: I found new MIOT homebridge plugin which allegedly supports new Mop 2 devices -> homebridge-miot. It may help you with implementation to HA.

brancooo1 avatar Jun 28 '22 07:06 brancooo1

It's possible to have other scripts? Like Sweep and Mop function or set water level? Thanks

sirprince95 avatar Jul 08 '22 09:07 sirprince95

It's possible to have other scripts? Like Sweep and Mop function or set water level? Thanks

You should be able to figure out the commands by looking at the spec mentioned in this comment:

https://github.com/rytilahti/python-miio/issues/1394#issuecomment-1154788987

garritfra avatar Jul 08 '22 14:07 garritfra

It's possible to have other scripts? Like Sweep and Mop function or set water level? Thanks

You should be able to figure out the commands by looking at the spec mentioned in this comment:

https://github.com/rytilahti/python-miio/issues/1394#issuecomment-1154788987

sequence:

  • service: xiaomi_miot.set_miot_property data: entity_id: vacuum.ijai_v19_7e89_robot_cleaner siid: 2 piid: 4 value: 1
  • delay: hours: 0 minutes: 0 seconds: 3 milliseconds: 0
  • service: xiaomi_miot.call_action data: entity_id: vacuum.ijai_v19_7e89_robot_cleaner siid: 7 aiid: 3 params: - '12' - 0 - 1 mode: single icon: mdi:fireplace-off alias: Clean Living Room

I've made this script for set the sweep and mop function and then clean the selected room but doesn't work 🥺

sirprince95 avatar Jul 08 '22 18:07 sirprince95

@garritfra Thanks for the tips. 🥇 Got more control on my ijai.vacuum.v3 thanks to you. The card works well too. Now, if I could only distinguish between the three functions of (Sweeping, Sweeping & Mopping, and Moping only) to deploy on scripts. I would be fully integrated.

Seems the siid: 7 command does both (yesterday was Sweeping & Mopping while today its sweeping only). Not sure why. :/

almudawi avatar Jul 23 '22 15:07 almudawi

Sure. This is a script that cleans a single room:

alias: Clean Kitchen
sequence:
  - service: xiaomi_miot.call_action
    data:
      entity_id: vacuum.ijai_v19_9a2c_robot_cleaner. 
      siid: 7   # Service ID for 'sweep'
      aiid: 3   # Action ID for 'set-room-clean'
      params:
        - '10'   # Room ID to clean. I brute forced these IDs to map it to the rooms, but I'm sure there is a working endpoint for this somewhere. 
        - 0      # 0 = 'Global'
        - 1      # 1 = 'start'
mode: single
icon: mdi:sofa-single

For the siids and aiids, you can refer to the spec.

I'm planning on writing this down in more detail on my blog, but you should be able to get started with this.

You might also be interested in this card. I found that the (probably way superior) vacuum map card didn't work for me out of the box, since extracting the map requires the Vacuum to be on the same LAN as the HA box, which isn't the case for me.

Hello garritfra,

i have a short question: You have on the params - '10' is that the actual Room (e.g. Livingroom, Kitchen), or is it that the Vacuum will start for all Rooms and the Room ID is the - '0'?

Form my point of View the Specs you mentioned is not so clear from my side.

MacVille avatar Nov 04 '22 12:11 MacVille

AFAIK it's the first room. My apartment only has 3 rooms in total. Not sure why it's "10", and not "0".

Sure. This is a script that cleans a single room:

alias: Clean Kitchen
sequence:
  - service: xiaomi_miot.call_action
    data:
      entity_id: vacuum.ijai_v19_9a2c_robot_cleaner. 
      siid: 7   # Service ID for 'sweep'
      aiid: 3   # Action ID for 'set-room-clean'
      params:
        - '10'   # Room ID to clean. I brute forced these IDs to map it to the rooms, but I'm sure there is a working endpoint for this somewhere. 
        - 0      # 0 = 'Global'
        - 1      # 1 = 'start'
mode: single
icon: mdi:sofa-single

For the siids and aiids, you can refer to the spec.

I'm planning on writing this down in more detail on my blog, but you should be able to get started with this.

You might also be interested in this card. I found that the (probably way superior) vacuum map card didn't work for me out of the box, since extracting the map requires the Vacuum to be on the same LAN as the HA box, which isn't the case for me.

Hello garritfra,

i have a short question: You have on the params - '10' is that the actual Room (e.g. Livingroom, Kitchen), or is it that the Vacuum will start for all Rooms and the Room ID is the - '0'?

Form my point of View the Specs you mentioned is not so clear from my side.

-- Reply to this email directly or view it on GitHub: https://github.com/rytilahti/python-miio/issues/1394#issuecomment-1303411998 You are receiving this because you were mentioned.

Message ID: @.***>

garritfra avatar Nov 04 '22 13:11 garritfra

AFAIK

Ahhh know I understand why you wrote "Brute-forced" the Rooms ☜(゚ヮ゚☜) Thank you for the quick responce!

Best Regards from Southern Germany Stefan

MacVille avatar Nov 04 '22 13:11 MacVille

AFAIK it's the first room. My apartment only has 3 rooms in total. Not sure why it's "10", and not "0".

Maybe an stupid Question, did you know how to active the vacuum for two room? Do I need to use - “10,11“ or

  • “11“
  • “12“

MacVille avatar Nov 04 '22 18:11 MacVille

I couldn't figure that out either. My solution was to call the routine twice. The downside being that the robot drives back to the station in between rooms. Do keep me posted if you find something out though!

garritfra avatar Nov 04 '22 19:11 garritfra

Are you sure about this? I have vacuum on same Lan than HA, have tried but no luck.

I at least thought it would be this way. I wasn't aware that ijai vacuums are not supported yet.

In the other hand do you know some documentation about how to use the API to retrieve room ids?

I'm afraid I can't point to anything specifically. AFAIK room IDs start at 10 and go up from there. For me, it was a matter of sending the command with a room id, seeing where the robot went and taking note.

There is the room_ids property (service 2, property 10), but it's neither readable (green badge with chinese text) nor writable (blue badge), so it's more or less useless. I'd love to hear if you get this working though.

I tried to send the robot from room "10" and up to "12", but it is always cleaning the same room, very strange. Any suggestion appreciated.

srodighiero avatar Nov 23 '22 08:11 srodighiero

@MacVille @garritfra @srodighiero this syntax works for me: params: ['11,13', 0, 1] (11 and 13 being room ids)

It may or may not be equivalent to: (not tested)

params:
  - '11,13'
  - 0
  - 1

chocomega avatar Nov 23 '22 09:11 chocomega

@MacVille @garritfra @srodighiero this syntax works for me: params: ['11,13', 0, 1] (11 and 13 being room ids)

It may or may not be equivalent to: (not tested)

params:
  - '11,13'
  - 0
  - 1

That sounds great! I will give it a try. Than the big question is how to implement that into the HA GUI and start the Script.

Something like that: n- input_bools for the rooms dropdown for the Sweaping or Mopping --> Possible and defined dropdown for Vaccum power --> Possible and defined and a dropdown for Water amount --> Possible and defined

But i think the rooms to define is a bit hard and define and bring into the Script.

like: if input_boolean_kitchen is true 12 end if input_boolean_hallway is true 14 end

and the result should be than ['12,14']

But this could be an new project to test ;)

MacVille avatar Nov 23 '22 12:11 MacVille

Hello , Sorry its a closed post . but the above instructions are still valid ? because after adding the device i am getting the device unavailable . can some one help me ?

thanks

raviteja9494 avatar Nov 09 '23 10:11 raviteja9494