jghaanstra / com.xiaomi-miio

Homey app to control Mi Home devices that implement the miIO protocol and Xiaomi gateway child devices
GNU General Public License v3.0
452 stars 83 forks source link

All issues related to vacuum cleaners #165

Closed blexter closed 1 year ago

blexter commented 1 year ago

Would much appreciate the "Roomcleaning" feature to be implemented.

This applies to (at least, probably many more models) Roborock S5 In the app provided by the manufacture (not Homey app, "phone"-app), there is an function to map your home and divide it in "Rooms", then its possible to clean a specific room.

In the "background" every room gets an Id which is possible to use when starting a Roomcleaning by API (or simular). The "old" app "Roborock" (Homeyapp) has this feature and the function is solved by sending this "RoomId" as identifier for which room that should be cleaned. See picture for instructions from the "old app".

image

Feel free to reach out if any details is missing or so.

shaarkys commented 1 year ago

If I may suggest, having also coordinates (go to coordinates) , that would be something useful as well - unfortunately not sure if the original app allowed it and also Roborock app, which supported that, the source code is not disclosed and original developer is pissed of on Athom, so he is probably even not willing to transfer source code ;-(

The concept is explained here - "Going to target point:" - https://community.homey.app/t/app-pro-roborock-vacuum-cleaners/49521

Also Room ID is described in section "Find room ID’s for room cleanup"

As I'm also using ioBroker for information about cleaned value (parsing via MQTT and then then "full trash" sending to coordinated so I can clean the robot ;-) - so that integration might help to provide some insights...

https://github.com/iobroker-community-adapters/ioBroker.mihome-vacuum/blob/master/README.md

obrazek

shaarkys commented 1 year ago

If that would be added, you can count with another small coffee from me for sure ;-) Yep, I know it doesn't mean anything, just inspiring others ;-)

jghaanstra commented 1 year ago

If I may suggest, having also coordinates (go to coordinates) , that would be something useful as well - unfortunately not sure if the original app allowed it

This has been available since one of the first releases of the app. See https://github.com/jghaanstra/com.xiaomi-miio/blob/master/docs/mirobot_zonecleanup.md

As I'm also using ioBroker for information about cleaned value (parsing via MQTT and then then "full trash" sending to coordinated so I can clean the robot ;-) - so that integration might help to provide some insights...

The dedicated drivers of the supported drivers hold this information under the device settings in the test version. This was implemented in the Mi Homey app and has been merged into the Mi Home app now. The original and generic vacuum driver does not have this.

Implementing a room clean up action card does not seem to complicated. I'll look into it.

jghaanstra commented 1 year ago

The next release will add a "Clean Room" action card allowing to enter the room ID's which need to be cleaned. The driver voor the v1, 1S and S5 models and for the T6 model will have the current room ID's saved under the device settings. All is explained in further detail here: https://github.com/jghaanstra/com.xiaomi-miio/wiki/Vacuum-cleaners#using-the-clean-room-action-card

Everything is created without having a device to test with, limited documentation and limited understanding of how this should work so please test it thoroughly.

I'll keep this ticket open as I'm not expecting it to work smoothly right away.

shaarkys commented 1 year ago

I can test, but I have S6 :-)

jghaanstra commented 1 year ago

I can test, but I have S6 :-)

It will probably work with the v1, 1S, S5 driver.

shaarkys commented 1 year ago

Thank you, almost there for S6 - after I added it, it start loading values but after a while :

d4dd21ee-ae43-4759-8da5-4e807c9dec59

Device is unreachable: invalid_setting_type

blexter commented 1 year ago

0850ed68-8df2-40d2-ba24-71c477d97f0d

shaarkys commented 1 year ago

@blexter please always include diag. code... (unless you sent it from the app already)

jghaanstra commented 1 year ago

Device is unreachable: invalid_setting_type

Hope to have fixed this in the next release.

I have tried the latest version, if I from "chargingposition" try to change to status "zone cleaning" nothing happens. If i start a > "regualar" cleaning and than change to "zone cleaning" when the robot left the charging it possible to start. But not directly > from charging position I tried to use the "room cleaning" function, but only found "start zone cleaning" (with parameter), that doesnt work as I wish. Flow as attached picture.

Please re-pair your robot with the Mi Roborock Vacuum v1 / 1s / s5 instead of the generic Mi Robot driver and test again on the new release (3.1.3).

blexter commented 1 year ago

Seems I didnt got the robot docked yesterday, so its offline and not reachable now when im at work, so no updates from me (at least) coming 8h.

shaarkys commented 1 year ago

Hope to have fixed this in the next release.

THANK YOU - yep, it is...unfortunately there are some other issues (at least for S6).

What works :

What doesn't work

obrazek

Diag > 71e8777c-fd1f-4b2c-887b-ca9947e059a7

Do you think you can include also Error, Cleaned area , Mop ? I can create eventually feature request - also make sense if it's easy to implement, not sure how the integration works and if my inputs from iOBroker actually have added value....

obrazek

IoBroker screenshot (ignore differences 1) obrazek

jghaanstra commented 1 year ago

sending cleaner to coordinates - does nothing (seems to be Go.To function in iOBroker)

Probably fixed with next release

DIM to action starts cleaning - also diming is probably Volume ? Still the Volume is not changing (checked in the ioBroker after modifying in Homey app)

It's fan speed but that might not work for the S6 on this driver.

set POWER do not work (robot sounds like accepting command but it visibly does nothing) - also checked in iOBroker, it did not modify the value of fun_power / level.suction

Sound specific to the S6 as well. This device is not supported (yet).

status always shows CHARGING even when cleaning, even when battery fully charged and even when returning to DOCK

There is still something wrong with parsing vacuum statuses, this needs further investigation

room segments looks weird now after last update - see screenshot

It's supposed to, see the Wiki on how to use it for getting the ID's for the room cleaning action card.

total work time is some strange value not updated - eg. see my vacuum, after 3 years it reports 9min ;-) (it's also not the last cleaning time, it was in my case 1min during testing) - but seems it's just calculated incorrectly from reported value of 9915 min ? (see ioBroker)

I just copied this code from Mi Homey. Not gonna look into it now but removed conversion which suggests it was in milliseconds. For now it will report a raw value from the next release.

Total area should be with m2 unit

I'll add it to the label, if added to the value I cant compare it as a numeric value anymore. Also copied code by the way.

jghaanstra commented 1 year ago

Do you think you can include also Error, Cleaned area , Mop ? I can create eventually feature request - also make sense if it's easy to implement, not sure how the integration works and if my inputs from iOBroker actually have added value....

Make seperate feature request, I'm first trying to make the app stable and not focus on new (for most users not very important) features.

shaarkys commented 1 year ago

Hi,

ecb9c616-7689-46e7-9157-5b70eb1ce134

again Invalid settings type :-(

jghaanstra commented 1 year ago

again Invalid settings type :-(

Should be fixed with 3.1.7

shaarkys commented 1 year ago

sending cleaner to coordinates Probably fixed with next release

Fixed indeed, thx 3.1.7

It's fan speed but that might not work for the S6 on this driver.

Strange, even original app didn't have FAN speed, also in IoBroker I see only states below. Let's see what S5 users will say.

"type": "state", "common": { "name": "Suction power", "type": "number", "role": "level.suction", "read": true, "write": true, "min": 101, "max": 106, "states": { "101": "QUIET", "102": "BALANCED", "103": "TURBO", "104": "MAXIMUM", "105": "OFF", "106": "CUSTOM"

status always shows CHARGING even when cleaning, even when battery fully charged and even when returning to DOCK

There is still something wrong with parsing vacuum statuses, this needs further investigation

Partially fixed in 3.1.7 - now when launched from APP, Robot does as required (Stop, Docks, start cleaning) etc. I'm not sure though if when not charging anymore, if the state shall be still Charging and not Docked.

Also the states are not updated when launched directly from robot - eg. polling ? Diag. e8b29b8c-385d-4b76-8c06-90b7b7c347ce

room segments looks weird now after last update - see screenshot

It's supposed to, see the Wiki on how to use it for getting the ID's for the room cleaning action card.

Ah, OKay, never used it, I was just compering Room indexes from IoBroker integration, where I see it's "Integer" not Fraction ... if it's OKay, then perfect. ;-)

obrazek

total work time is some strange value not updated - eg. see my vacuum, after 3 years it reports 9min ;-) (it's also not the last cleaning time, it was in my case 1min during testing) - but seems it's just calculated incorrectly from reported value of 9915 min ? (see ioBroker)

I just copied this code from Mi Homey. Not gonna look into it now but removed conversion which suggests it was in milliseconds. For now it will report a raw value from the next release.

Raw value is OKay for me, even just simply dividing "Total work time" value by 60 will get minutes instead of seconds ;-)

Total area should be with m2 unit

I'll add it to the label, if added to the value I cant compare it as a numeric value anymore. Also copied code by the way.

Sure, I meant label only, same as total working time now in secs, but that's okay. Thank you for everything !

jghaanstra commented 1 year ago

I'm not sure though if when not charging anymore, if the state shall be still Charging and not Docked.

The vacuum doesnt have a charged state. If other integrations show the difference between charging and charged it has been manually implemented but this has never been added in the Mi Home or Mi Homey app.

shaarkys commented 1 year ago

doesnt have a charged state.

Just an idea - maybe battery = 100% --> charged ?

A pity that Justin is not willing to share his code... (https://community.homey.app/t/app-pro-roborock-vacuum-cleaners/49521)

jghaanstra commented 1 year ago

Just an idea - maybe battery = 100% --> charged ?

Sure, but as mentioned for now I'm mostly porting the current code. New features is for later.

shaarkys commented 1 year ago

New features is for later.

I have updated the feature request also with some parts I found in MaxMudjon implementations, if it will later help anyhow or not, you will see. Thank you.

shaarkys commented 1 year ago

Sound specific to the S6 as well. This device is not supported (yet).

https://community.homey.app/t/app-pro-xiaomi-mi-home-app-for-wifi-devices/118/368?u=sharkys

;-) ~3 years ago you added it (still I don't know what was the difference, so rather take it as attempt for joke

blexter commented 1 year ago

Testing on the S5:

My usecases seems to work now (primary - room cleaning)

What i outside that found thats a bit "sketchy",

I tested all availible cards, and that not mentioned above seems to work what i can understand.

5cff606d-b277-4f24-9f88-52d11236998b

jghaanstra commented 1 year ago

From charging position "Spotcleaning" cant start, gets error that i should move the robot to the spot first, seems to be as design of the robot?!

Yes, that's how it works.

Status Dock and Charge seems to do exact the same thing, at least for my robot.

Correct, both will send the robot back to the dock. Its related to the weird implementation of the vacuumcleaner_state capability in Homey where you can set the state to docked (which is not an active state to assign on the vacuum cleaner)

The onoff button status not seems to get updated if a status change was made

Hope to have improved this on the next release.

Not sure what the "volume" slider does at all Dim to 50% set fanpower to "Balanced", but 100% doesnt change it at all. Not sure how/why this function works like this, might be "error" on me Set relative dim-level 50%, same as above. Set fan power only can set "Balanced" like the dim-behaviour above

It's was implemented by the previous developer and is supposed to set the fanspeed but it's very inconsistent. I might remove it all together.

jghaanstra commented 1 year ago

Version 3.1.8 contains a rewrite of the vacuumcleaner, please re-test.

Breaking change: Completely reworked the code for the vacuum cleaners. This means devices that where paired after the release of version 3.1.0. Need to be repaired. You can choose between a basic vacuum cleaner driver that should support most cleaners and an advanced driver that should support more advanced models. Please test and report on Github.

shaarkys commented 1 year ago

From mobile, sorry to be brief

S6 Roborock, added as advanced Wifi

👍

😞

Did not test the cleaning room - not using

Diag : 937e3fee-bb94-4870-87e9-c7abfc0b478f (old devices not removed yet because of the flows repair required)

pictures like on : https://community.homey.app/t/app-pro-xiaomi-mi-home-app-for-wifi-devices/118/1085?u=sharkys

jghaanstra commented 1 year ago

All the above should be fixed with the next release (3.1.9). Please let me know if there are more issues with the vacuum cleaner or if this ticket can be closed.

shaarkys commented 1 year ago

Just minor one, still kind of enhancement related - https://github.com/jghaanstra/com.xiaomi-miio/issues/173#issuecomment-1465289835

Also tested re-added Goto coordinates and it works fine for me, thank you.

blexter commented 1 year ago

Find one thing, my status; Sensors dirty remaining says -110% (a warning/notice in Xiaomi iphone app). It in the device view says Sensor Alert: No

6430ddbc-b6ed-4dd3-b296-c1dc7a54c8ce

image image

jghaanstra commented 1 year ago

Find one thing, my status; Sensors dirty remaining says -110% (a warning/notice in Xiaomi iphone app). It in the device view says Sensor Alert: No

6430ddbc-b6ed-4dd3-b296-c1dc7a54c8ce

Should be fixed with the next release (3.1.10).

blexter commented 1 year ago

Seems the same "error" there. Restarted the app and also delete/readded the device to "force" update.

1ed8509b-74df-41a9-a652-e7a4cd59b3d1

image image

jghaanstra commented 1 year ago

Seems the same "error" there. Restarted the app and also delete/readded the device to "force" update.

1ed8509b-74df-41a9-a652-e7a4cd59b3d1

image image

Hopefully fixed with the next release (3.1.12).

blexter commented 1 year ago

Havnt tried "everything" again, by the "warning" part (above) is now solved.

jghaanstra commented 1 year ago

Thanx, I'm closing this now.

blexter commented 1 year ago

Thank you so much!!

Gizmopower1 commented 1 year ago

Is s6 maxv Supported? I get an handshake error when trying to connect

jghaanstra commented 1 year ago

Is s6 maxv Supported? I get an handshake error when trying to connect

It is, handshake error means incorrect token is used.

Gizmopower1 commented 1 year ago

Well. Look at that. Installed the test version and yes it works!

Thank you! Donation made :)