al-one / hass-xiaomi-miot

Automatic integrate all Xiaomi devices to HomeAssistant via miot-spec, support Wi-Fi, BLE, ZigBee devices. 小米米家智能家居设备接入Hass集成
https://miot-spec.com
Apache License 2.0
4.58k stars 650 forks source link

Add missing entities for ijai.vacuum.v19 #786

Closed dieugab closed 2 years ago

dieugab commented 2 years ago

Hi @al-one,

Would it be possible to add missing entities for Xiaomi Robot vacuum-mop 2S (ijai.vacuum.v19)? I recently upgraded from Mi Robot vacuum-mop (dreame.vacuum.mc1808), but it's missing a lot of entities like consumables state, water level, battery charging state and more (also services/buttons like locate).

For comparison:

Mi robot vacuum-mop image

While for Xiaomi Robot vacuum-mop 2S: image

It might be missing other entities as well. For instance, while you can set the mode (sweep, mop), you cannot set the actual fan speed (silent, standard, strong, turbo) like you can with the older Mi robot vacuum-mop. Haven't gotten to testing cleaning specific rooms yet, so not sure if that's implemented.

You can find the spec here I believe: https://home.miot-spec.com/spec/ijai.vacuum.v19

Thanks in advance! I can answer more device info questions if required.

al-one commented 2 years ago

Try master branch.

dieugab commented 2 years ago

@al-one Thanks for getting back to me so fast and it's much improved already. There's still a couple of things I've noticed, I'll post them in messages below:

Fan Speed The new mode entity works well, but vacuum entity fan speed only displays mode, where fan speed would be expected. I think having mode as a separate entity as it currently is and actual fan speed in the entity card would be better image image

There's currently no entity or option to set the actual fan speed, but looking at the entity state it does look like it's being reported. The sweep.suction_state attribute changes when setting the fan speed in the Mi app, as follows:

sweep.suction_state: 0 = Silent sweep.suction_state: 1 = Standard sweep.suction_state: 2 = Strong sweep.suction_state: 3 = Turbo

dieugab commented 2 years ago

Sensors There are now subentities for the consumable % life, but not yet hours remaining: image

Look like those are reported in:

sweep.side_brush_hours sweep.main_brush_hours sweep.hypa_hours sweep.mop_hours

dieugab commented 2 years ago

Sweep Type Main branch contains a new select entity but I'm not sure what it does: image

I've noticed at least one setting corresponds to "Clean up along the edges" in the Mi app. I could do more research if required

al-one commented 2 years ago

There are now subentities for the consumable % life, but not yet hours remaining

Maybe you need to get them via customizing:

# customize.yaml
vacuum.ijai_v19_xxxx:
  sensor_properties: vacuum.status,main_brush_life,side_brush_life,hypa_life,mop_life,main_brush_hours,side_brush_hours,hypa_hours,mop_hours
dieugab commented 2 years ago

@al-one Thank you, the latest commit in main fixes the fan speed: image

And using your comment as a template I added a bunch more controls and sensors, thank you! You can close this one, I might add the most important ones (like water level) as a PR image

dieugab commented 2 years ago

@al-one One last thing I noticed, a typo in the fan_speed. Should be "Silent, not "Slient". Couldn't find where to fix it in the code myself image

al-one commented 2 years ago

image

Slient is from miot-spec.org, we can fix it via translation.

dieugab commented 2 years ago

@al-one I updated to the latest master but the translation isn't coming through:

image image

version c4f19eb

al-one commented 2 years ago

Configuration is required for translation:

# configuration.yaml
xiaomi_miot:
  language: en
dieugab commented 2 years ago

@al-one Looks good, you can close this one

image