Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xiaomi_miio: vacuum.set_fan_speed not working on fw: 3.5.7_002008+ #31268

Closed
gibman opened this issue Jan 29, 2020 · 12 comments · Fixed by #32850
Closed

xiaomi_miio: vacuum.set_fan_speed not working on fw: 3.5.7_002008+ #31268

gibman opened this issue Jan 29, 2020 · 12 comments · Fixed by #32850

Comments

@gibman
Copy link
Contributor

gibman commented Jan 29, 2020

running hass 0.104.3

vacuum.set_fan_speed does no longer work properly on roborock vacuum s5 with FW: 3.5.7_002008

Though I am able to set fanspeed 105 or "Gentle" .. this seems to put it into low fan mode.
If I try any other value 0-100, Medium, Turbo etc etc.. they all put the vacuum speed back to full speed.

The previous FW worked fine on all fan speeds.
Setting the fanspeed within the official mihome app works as well.

@springstan
Copy link
Member

Please fill out the issue template :) you can find it by clicking on New Issue and then choosing an appropriate category.

@probot-home-assistant
Copy link

Hey there @rytilahti, @syssi, mind taking a look at this issue as its been labeled with a integration (xiaomi_miio) you are listed as a codeowner for? Thanks!

@pplucky
Copy link

pplucky commented Feb 8, 2020

running hass 0.104.3

vacuum.set_fan_speed does no longer work properly on roborock vacuum s5 with FW: 3.5.7_002008

Though I am able to set fanspeed 105 or "Gentle" .. this seems to put it into low fan mode.
If I try any other value 0-100, Medium, Turbo etc etc.. they all put the vacuum speed back to full speed.

The previous FW worked fine on all fan speeds.
Setting the fanspeed within the official mihome app works as well.

I had issues with my Xiaomi vacuum 1S and what I did was changing the fan speed on Mi Home and then wait until HA shows the corresponding value in vacuum entity attributes, to map each speed (in my case, 102 corresponds to Balanced):

image

What I do is then using vacuum.set_fan_speed service to change the fan speed properly from HA.

Integration is not perfect but it works until this is fixed in the underlying library python-miio.

@finipini
Copy link

Screenshot_34

You must done this changes, i had the same problem. This is from the release notes.

rytilahti added a commit to rytilahti/python-miio that referenced this issue Mar 15, 2020
This returns a dictionary {name, value} of the available fan speeds,
the main driver being the need to simplify homeassistant integrations for different devices.

For viomi vacuums this is currently straightforward and hard-coded, but we do special handling
for rockrobo devices (based on info() responses):

* If the query succeeds, newer firmware versions (3.5.7+) of v1 are handled as a special case,
  otherwise the new-style [100-105] mapping is returned.

* If the query fails, we fall back to rockrobo v1's percentage-based mapping.
  This happens, e.g., when the vacuum has no cloud connectivity.

Related to #523

Related downstream issues
home-assistant/core#32821
home-assistant/core#31268
home-assistant/core#27268
rytilahti added a commit to rytilahti/home-assistant that referenced this issue Mar 15, 2020
This needs input from Xiaomi vacuum owners to verify that it does not break anything.
I have personally tested this on rockrobo v1 (old mapping).

Related issues/PRs:
home-assistant#32821
home-assistant#31268
home-assistant#27268

This is a WIP as it requires a new upstream release.
The PR is rytilahti/python-miio#643
@rytilahti
Copy link
Member

rytilahti commented Mar 19, 2020

Anyone mind testing #32850 to make sure the special case handling is working for you now? I can then proceed to get this fixed :-)

edit: ping @gibman, @finipini, @pplucky, @benct – I'd like to get this checked and merged, so if you can spare some time, could you please test the upstream PR to see if it is reporting the correct information for your devices?

rytilahti added a commit to rytilahti/python-miio that referenced this issue Mar 27, 2020
* Add fan_speed_presets() for querying available fan speeds

This returns a dictionary {name, value} of the available fan speeds,
the main driver being the need to simplify homeassistant integrations for different devices.

For viomi vacuums this is currently straightforward and hard-coded, but we do special handling
for rockrobo devices (based on info() responses):

* If the query succeeds, newer firmware versions (3.5.7+) of v1 are handled as a special case,
  otherwise the new-style [100-105] mapping is returned.

* If the query fails, we fall back to rockrobo v1's percentage-based mapping.
  This happens, e.g., when the vacuum has no cloud connectivity.

Related to #523

Related downstream issues
home-assistant/core#32821
home-assistant/core#31268
home-assistant/core#27268

* Fix method naming..

* small pre-merge cleanups
@rytilahti
Copy link
Member

I'm planning to make a new release this weekend, which I hope will fix this issue for gen1 vacuums. As I have not heard anyone reporting back whether it works or not, I simply hope it works..

@pplucky
Copy link

pplucky commented Mar 27, 2020

I'm planning to make a new release this weekend, which I hope will fix this issue for gen1 vacuums. As I have not heard anyone reporting back whether it works or not, I simply hope it works..

Unfortunately without a new python-miio release, I can't test it, as my test system is currently running on hass.io over Docker/raspbian.

If new python-miio is released, I can try to set it up as a custom-component and go from there. Do you think it will work?

Sorry for not coming back to you earlier.

@rytilahti
Copy link
Member

If you don't mind, you could simply create a virtual environment and install the PR only for it for testing, see #32850 (comment) . There is no need to involve any tests with homeassistant: if the command there gives the correct information, it will definitely be fixed when this PR gets merged.

@pplucky
Copy link

pplucky commented Mar 28, 2020

If you don't mind, you could simply create a virtual environment and install the PR only for it for testing, see #32850 (comment) . There is no need to involve any tests with homeassistant: if the command there gives the correct information, it will definitely be fixed when this PR gets merged.

Done and result is here.

@rytilahti
Copy link
Member

rytilahti commented Mar 28, 2020

Thanks 👍 Looks like it is working as expected, so the next version of python-miio & version bump will fix this for good!

edit: looks like yours is not the first-gen vacuum though.. Oh well..

balloob pushed a commit that referenced this issue Apr 2, 2020
* Use backend-provided fan speed presets for Xiaomi vacuums

This needs input from Xiaomi vacuum owners to verify that it does not break anything.
I have personally tested this on rockrobo v1 (old mapping).

Related issues/PRs:
#32821
#31268
#27268

This is a WIP as it requires a new upstream release.
The PR is rytilahti/python-miio#643

* Bump version requirement for 0.5.0

* Bump requirements_test_all.txt, too

* Fix linting; missing setup.cfg on local checkout caused wrong settings for black..

* Add tests for both fan speed types

* Remove useless else..

* bump python-miio to 0.5.0.1 due to broken 0.5.0 packaging
@markrennie71
Copy link

this work on the dev branch of .108 but on the latest release it doesn't

@rytilahti
Copy link
Member

@markrennie71 please open a new issue and provide necessary details (model of the vacuum, firmware version, version of python-miio, describe what is not working, ..).

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Apr 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants