home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.49k stars 30.7k forks source link

fan.set_percentage service does not support Xiaomi Air Purifier 2S #103087

Closed TeoTN closed 5 months ago

TeoTN commented 1 year ago

The problem

I've the Xiaomi Air Purifier 2S, and it doesn't work with fan.set_percentage service (as well as fan.increase_speed and fan.decrease_speed). Calling it ends up in an error:

Failed to call service fan.set_percentage. Entity fan.air_purifier does not support this service.

Because of that majority of custom integrations don't work with the fan as well.

What version of Home Assistant Core has the issue?

core-2023.10.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

xiaomi-miio

Link to integration documentation on our website

https://www.home-assistant.io/integrations/xiaomi_miio/

Diagnostics information

home-assistant_xiaomi_miio_2023-10-30T20-45-35.458Z.log

Example YAML snippet

service: fan.set_percentage
data:
  percentage: 20
target:
  entity_id: fan.air_purifier # This is entity of Air Purifier 2S

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @rytilahti, @syssi, @starkillerog, mind taking a look at this issue as it has been labeled with an integration (xiaomi_miio) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `xiaomi_miio` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign xiaomi_miio` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


xiaomi_miio documentation xiaomi_miio source (message by IssueLinks)

TeoTN commented 1 year ago

In particular, there's an awkward standalone number.air_purifier_favorite_level entity created for the device, which does allow setting the fan speed but it's not a native part of fan's capabilities, so it doesn't work with e.g. fan cards which rely on fan.set_percentage.

TeoTN commented 11 months ago

Hey @rytilahti, @syssi, @starkillerOG, any chance you could take a look at the bug?

ElectricPaul commented 10 months ago

Same issue here with the Mi Air Purifier 2.

Looks like the percentage attribute is missing which means that neither fan.set_percentage nor fan.increase_speed / 'fan.decrease_speed' can be used.

Subsequently, this causes the fan speed feature to be unavailable when using the Tile card.

As @TeoTN mentioned, I think we need the standalone number.air_purifier_favorite_level property which has a range from 0-17 mapped to 'percentage' to resolve this.

TeoTN commented 8 months ago

Just confirmed that the issue persists in 2024.2.2, still calling fan/set_percentage on entity of Xiaomi Air Purifier 2S throws an error:

service: fan.set_percentage
data:
  percentage: 20
target:
  entity_id: fan.air_purifier

Error:

[!CAUTION] Failed to call service fan.set_percentage. Entity fan.air_purifier does not support this service.

issue-triage-workflows[bot] commented 5 months ago

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 has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.