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 vacuum V2 fan speed is not mapped correctly #17695

Closed
bogdanalexe90 opened this issue Oct 22, 2018 · 16 comments
Closed

Xiaomi vacuum V2 fan speed is not mapped correctly #17695

bogdanalexe90 opened this issue Oct 22, 2018 · 16 comments

Comments

@bogdanalexe90
Copy link

Home Assistant release with the issue:
0.80.3

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.):
Hass on raspberry pi 3b+

Component/platform:
Xiaomi Mi Robot Vacuum
https://www.home-assistant.io/components/vacuum.xiaomi_miio/

Description of problem:
Fan speed are not mapped correctly for the Xiaomi vacuum V2 Correct values are:
Quiet: 101
Balanced: 102
Turbo: 103
Max: 104
Mop: 105

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

vacuum:
  - platform: xiaomi_miio
    host: !secret xiaomi_vacuum_host
    token: !secret xiaomi_vacuum_token

Traceback (if applicable):


Additional information:

@rytilahti
Copy link
Member

See my comment in #17090 - this needs to be fixed in the upstream library (PRs welcome!).

@LordBoos
Copy link
Contributor

It is not a problem - only that Mop is missing.
Xiaomi App started using the 101+ values, but you can still use 0-100 that sets the speed percentually.
90 = 90% speed.

@drndos
Copy link
Contributor

drndos commented Oct 25, 2018

But it is not an issue for the underlying library because it doesn't know about the speeds and it doesn't enumerate them, it just set them by integer value. HA is enumerating the speeds and using library to set them to certain integer value. That would be brand new feature for underlying library to know which type of vacuum it is communicating with and the PR would also need to change the API because now the underyling library would be doing the enumeration of speeds. And then we would also need to change HA.

@poma
Copy link

poma commented Jan 21, 2019

I agree with @drndos, this feature might take a very long time to be implemented in the underlying library.

As a faster fix, we could add a flag in the component yaml config, telling it which mapping it should use (old or new)

@drndos
Copy link
Contributor

drndos commented Jan 21, 2019

@poma
You can actually call service with correct ID in home-assistant so if you create your own GUI it will work. Sample:

elements:
  - type: icon
    style:
      top: 10%
      left: 62%
    icon: 'mdi:clock-outline'
    tap_action: none
  - title: Cleaning time
    style:
      transform: none
      top: 3%
      left: 63%
      color: black
    type: state-label
    entity: sensor.vacuum_cleaning_time
  - type: icon
    style:
      top: 10%
      left: 76%
    icon: 'mdi:border-none-variant'
    tap_action: none
  - title: Cleaned area
    style:
      transform: none
      top: 3%
      left: 77%
      color: black
    type: state-label
    entity: sensor.vacuum_cleaned_area
  - type: icon
    style:
      top: 10%
      left: 89%
    icon: 'mdi:battery'
    tap_action: none
  - title: Battery level
    style:
      transform: none
      top: 3%
      left: 90%
      color: black
    type: state-label
    entity: sensor.vacuum_battery_level
  - icon: 'mdi:play'
    type: icon
    service: vacuum.start
    style:
      top: 81%
      '--iron-icon-height': 60px
      '--iron-icon-width': 60px
      left: 25%
    entity: vacuum.xiaomi_vacuum_cleaner
    tap_action: call-service
  - icon: 'mdi:pause'
    type: icon
    service: vacuum.pause
    style:
      top: 81%
      '--iron-icon-height': 60px
      '--iron-icon-width': 60px
      left: 40%
    entity: vacuum.xiaomi_vacuum_cleaner
    tap_action: call-service
  - icon: 'mdi:stop'
    type: icon
    service: vacuum.stop
    style:
      top: 81%
      '--iron-icon-height': 60px
      '--iron-icon-width': 60px
      left: 55%
    entity: vacuum.xiaomi_vacuum_cleaner
    tap_action: call-service
  - icon: 'mdi:home-map-marker'
    type: icon
    service: vacuum.return_to_base
    style:
      top: 81%
      '--iron-icon-height': 60px
      '--iron-icon-width': 60px
      left: 70%
    entity: vacuum.xiaomi_vacuum_cleaner
    tap_action: call-service
  - style:
      font-weight: bold
      font-family: Trebuchet MS
      top: 10%
      background-color: 'rgb(54, 65, 78)'
      border-color: 'rgb(34, 154, 210)'
      pointer-events: none
      opacity: 0.8
      font-size: 90%
      color: 'rgb(255, 255, 255)'
      border-left-style: solid
      transform: 'translate(0%,-50%)'
      text-shadow: 1px 1px black
      left: 5%
    entity: sensor.vacuum_status
    type: state-label
  - service_data:
      fan_speed: 105
      entity_id: vacuum.xiaomi_vacuum_cleaner
    icon: 'mdi:water'
    type: icon
    tap_action: call-service
    style:
      top: 28%
      '--iron-icon-height': 30px
      '--iron-icon-width': 30px
      left: 65%
    entity: vacuum.xiaomi_vacuum_cleaner
    service: vacuum.set_fan_speed
  - service_data:
      fan_speed: 101
      entity_id: vacuum.xiaomi_vacuum_cleaner
    icon: 'mdi:power-sleep'
    type: icon
    tap_action: call-service
    style:
      top: 28%
      '--iron-icon-height': 30px
      '--iron-icon-width': 30px
      left: 73%
    entity: vacuum.xiaomi_vacuum_cleaner
    service: vacuum.set_fan_speed
  - service_data:
      fan_speed: 102
      entity_id: vacuum.xiaomi_vacuum_cleaner
    icon: 'mdi:fan'
    type: icon
    tap_action: call-service
    style:
      top: 28%
      '--iron-icon-height': 30px
      '--iron-icon-width': 30px
      left: 81%
    entity: vacuum.xiaomi_vacuum_cleaner
    service: vacuum.set_fan_speed
  - service_data:
      fan_speed: 103
      entity_id: vacuum.xiaomi_vacuum_cleaner
    icon: 'mdi:blender'
    type: icon
    tap_action: call-service
    style:
      top: 28%
      '--iron-icon-height': 30px
      '--iron-icon-width': 30px
      left: 89%
    entity: vacuum.xiaomi_vacuum_cleaner
    service: vacuum.set_fan_speed
  - service_data:
      fan_speed: 104
      entity_id: vacuum.xiaomi_vacuum_cleaner
    icon: 'mdi:weather-hurricane'
    type: icon
    tap_action: call-service
    style:
      top: 28%
      '--iron-icon-height': 30px
      '--iron-icon-width': 30px
      left: 97%
    entity: vacuum.xiaomi_vacuum_cleaner
    service: vacuum.set_fan_speed
  - style:
      font-weight: bold
      font-family: Trebuchet MS
      top: 25%
      background-color: 'rgb(54, 65, 78)'
      border-color: 'rgb(34, 154, 210)'
      pointer-events: none
      opacity: 0.8
      font-size: 90%
      color: 'rgb(255, 255, 255)'
      border-left-style: solid
      transform: 'translate(0%,-50%)'
      text-shadow: 1px 1px black
      left: 5%
    entity: sensor.vacuum_fan_speed
    type: state-label
id: db5e323abd984551a8db5a0bf4721da8
image: /local/vacuum_card.jpg
type: picture-elements

image

@poma
Copy link

poma commented Jan 21, 2019

For myself I've just made an override .py file with the correct mapping, only had to change a few numbers. I'll make a PR because I want it to work for other users out of the box.

@stale
Copy link

stale bot commented Jul 7, 2019

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 7, 2019
@LordBoos
Copy link
Contributor

LordBoos commented Jul 7, 2019

mapping is still wrong.

@stale stale bot removed the stale label Jul 7, 2019
@rytilahti
Copy link
Member

Just for the record, @bugficks created a PR to fix this issue in the backend library (rytilahti/python-miio#523), but closed it afterwards out of no interest.

@frenck
Copy link
Member

frenck commented Jul 8, 2019

@rytilahti Maybe do a shot at moving it forward nevertheless?

@bugficks
Copy link

bugficks commented Jul 8, 2019

well if there is no response to a pull request after a week that shows me there is no interest, hence I have closed the pull request. simple as that.

@frenck
Copy link
Member

frenck commented Jul 8, 2019

@bugficks A week? I'm sorry sir, but that is not uncommon in the open source world. Furthermore, I personally don't see why one should close PR because of "waiting" too long. But that is personal I guess :)

@bugficks
Copy link

bugficks commented Jul 9, 2019

@frenck if you say so :) I'm used to some sort of reply within a few days. My fork is still available for now and if someone had asked to reopen PR I would have done so.

@rytilahti
Copy link
Member

Sorry for not being responsive enough, I've seen the PR and it looks good from the surface, but I haven't unfortunately have had enough time to dig into the specifics nor do I have currently access to test it myself.

As I cannot test it myself, I'm really hesitant on simply merging it and pushing out a new release (in case it then breaks down on someone's setup). So if anyone is willing to do some testing (verifying that everything works just fine also with the v1 vacuum), I think we can go ahead, merge that PR and I can prepare a new release so we can finally get that fixed.

If there are no volunteers I will be doing that by myself when I'll get access to a device later this year (some point in October). As I hope it doesn't have to wait that long, I hope that some other people will do testing on it and report on that PR :-)

@Ciubas
Copy link

Ciubas commented Jul 22, 2019

If there are no volunteers I will be doing that by myself when I'll get access to a device later this year (some point in October). As I hope it doesn't have to wait that long, I hope that some other people will do testing on it and report on that PR :-)

Hi! I just start the jurney with HA and I really want help with the MOP functions. I create special area to clean with mop and now I need to change normal mode to mop :D

How can I help You with that?

@stale
Copy link

stale bot commented Oct 20, 2019

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants