merdok / homebridge-miot

Homebridge plugin for devices supporting the Xiaomi miot protocol
MIT License
394 stars 62 forks source link

Support for viomi.vacuum.v10 #43

Closed yogiee closed 3 years ago

yogiee commented 3 years ago

Please add support for viomi.vacuum.v10 device.

merdok commented 3 years ago

Should be straight forward! Will add support for that vacuum in the next update!

merdok commented 3 years ago

@yogiee can you tell me what the official name of that vacuum is?

yogiee commented 3 years ago

@yogiee can you tell me what the official name of that vacuum is?

It's called Mi Robot Vacuum Mop P.

https://www.mi.com/in/mi-robot-vacuum-mop-p/

merdok commented 3 years ago

Perfect! Thanks!

merdok commented 3 years ago

Added in version 0.9.4. Please try it out and let me know if everything works.

yogiee commented 3 years ago

Awesome, will test it out.

yogiee commented 3 years ago

Okay, so the device shows up in the homekit as it did before, but still not functional. Initially it shows battery low (robovac is on the charging dock and full battery), when powered on, following error is generated in Homebridge log. Also attaching the screenshots from homekit app.

[6/20/2021, 2:56:18 AM] [miot] [Mi Robovac] Poll failed 4 times in a row! Stopping polling and trying to reconnect! [6/20/2021, 2:56:18 AM] [miot] [Mi Robovac] Connected to device: viomi.vacuum.v10 [6/20/2021, 2:56:18 AM] [miot] [Mi Robovac] Setting up device! [6/20/2021, 2:56:18 AM] [miot] [Mi Robovac] Doing device specific setup [6/20/2021, 2:56:18 AM] [miot] [Mi Robovac] Doing initial property fetch [6/20/2021, 2:56:18 AM] [miot] [Mi Robovac] Device setup finished! Device ready, you can now control your device! [6/20/2021, 2:56:40 AM] [miot] [Mi Robovac] Poll failed 4 times in a row! Stopping polling and trying to reconnect! [6/20/2021, 2:56:40 AM] [miot] [Mi Robovac] Connected to device: viomi.vacuum.v10 [6/20/2021, 2:56:40 AM] [miot] [Mi Robovac] Setting up device! [6/20/2021, 2:56:40 AM] [miot] [Mi Robovac] Doing device specific setup [6/20/2021, 2:56:40 AM] [miot] [Mi Robovac] Doing initial property fetch [6/20/2021, 2:56:40 AM] [miot] [Mi Robovac] Device setup finished! Device ready, you can now control your device!

screenshot screenshot

merdok commented 3 years ago

You need to provide a homebridge debug log, ideally with the deepDebugLog property enabled. Without that there is no way for me to know what is wrong...

yogiee commented 3 years ago

deepDebugLog

I enabled deep debug log, but not sure where exactly to find it? I'm running homebridge in docker setup and I checked the volume where homebridge settings are stored. I could only find standard homebridge log file.

merdok commented 3 years ago

deepDebugLog will only work when you start homebridge in debug mode. So you need to start your homebridge as described in the README with the -D flag: homebridge -D

yogiee commented 3 years ago

Yeah, figured that out while exploring homebridge settings. Here's the log.

log file

merdok commented 3 years ago

Seems like the device is most probably not a miot device but a an older miio device, for that reason you need to use MiCloud. You need to specify your MiCloud credentials, the country where your device is located and enable the "Force MiCloud connection" button. If that will work, then i will mark your device as a MiCloud device in the next update.

yogiee commented 3 years ago

Seems like the device is most probably not a miot device but a an older miio device, for that reason you need to use MiCloud. You need to specify your MiCloud credentials, the country where your device is located and enable the "Force MiCloud connection" button. If that will work, then i will mark your device as a MiCloud device in the next update.

Aha, I see. Checked MiCloud connection, however, my country (in, and i2) is not listed in the supported countries on this plugin.

merdok commented 3 years ago

You would need to temporary move your vacuum to the china server then and test it out.

yogiee commented 3 years ago

You would need to temporary move your vacuum to the china server then and test it out.

Cool, will try that out and report. Thanks.

merdok commented 3 years ago

Just let me know if it works. If it will then i will mark the device as a MiCloud device and add the in (i suppose India?) server to the list.

yogiee commented 3 years ago

Just let me know if it works. If it will then i will mark the device as a MiCloud device and add the in (i suppose India?) server to the list.

Yes, there are two listings that I saw in token_extracter app. in should be India, but by default the devices were added to i2 servers.

merdok commented 3 years ago

What country are the i2 servers in? A secondary India server?

yogiee commented 3 years ago

What country are the i2 servers in? A secondary India server?

Apparently both in and i2 are for India region, according to OpenHAB doc.

https://www.openhab.org/addons/bindings/miio/#country-servers

merdok commented 3 years ago

👍 Makes sense

yogiee commented 3 years ago

So apparently even after your update and trying to jump between regions in my Mi Home app, I couldn't get the Robovac working. However, I noticed that now by Robovac is listed on 3 different servers (CN, US and i2).

Sorry for the off-topic question, but is there any way to remove devices from different region servers (if not, just remove everything and start over)?

merdok commented 3 years ago

As far as I know adding the device to one server, should remove it from another. Not sure if you can remove all device from a server... maybe in the xiaomi home app?

yogiee commented 3 years ago

So after lot of tinkering and meddling with region, I'm happy to report that I've finally managed to get it working with MiCloud connection option and while the options are limited just a simple starting and stopping the vacuuming run works just fine and should be more than enough to map to HomeAssistant server to set automation schedules. Thanks a lot mate for quick update to the plugin.

merdok commented 3 years ago

Thanks for the info! Good to hear! You should also be able to enable modes with the modeControl property. Anyway in that case I will mark the device as a MiCloud device on the next update!

merdok commented 3 years ago

The device is now marked as MiCloud required as of version 0.9.6!