I have several fans which are using a Sonoff light/fan controller (iFan03: Wi-Fi Ceiling Fan And Light Controller). When I long-press on the button attached to those entities, it brings up the “More Information” dialog which, in this case shows Details and History tabs. Under the Details tab are individual controls for the light and for the fan speed (see below).
When I created these buttons, clicking on the Speed slider or dragging the dot would result in a fan speed change as expected. Now, however, it briefly flashes an error message: “Failed to call service fan/set_percentage” and does nothing.
If I set the fan speed in an automation or script, that works fine. It used to work. Can I get it to work again or do I have to resort to another set of buttons with [off] [low] [medium] [high] ?
Not sure I can be of much help but what integration does the fan use? Tasmota, esphome, sonoff?
Does reverting back to the previous version fix it? I’m still on version 2022.2.8 and mine works fine flashed using ESPHome.
A “off/low/med/high” won’t really help for a couple of reasons.
-
the named speeds have been deprecated in favor of percentages.
-
if the set_percentage service is failed to be called then it sounds like an integration issue for the fan.
The fan uses the Sonoff LAN HACS integration (sorry to have left that out). Obviously, one step is to contact the author of that integration and see if they have any insight.
The odd thing is that it was working. The problem I have is that I didn’t realize that it wasn’t working right away. (It was winter and we didn’t use the fans so I’m not really sure when it stopped working.) Another odd thing is that the error message says that it’s trying to use percentage. In my automations, which still work, I’m using the depreciated named speeds and they work. So the preferred method (percentage) seems to have a problem and the depreciated method (named speeds) still works.
the named speeds had still worked (and may still work for some integrations?) but they will be (if not already) removed soon. All fans try to use the percentages first by default now. Prior to this the integration tried to convert speeds into percentages and the UI would still work. Maybe now that has been removed?
So maybe that is why it doesn’t work thru the UI and works via automations - the UI uses percentages by default (especially using the slider) and you are still using named speeds in your automations.
I think that contacting the integration author would be your best solution. If you are seeing issues i’m sure others are too. And if not then maybe they can help you get to the bottom of your issue.
Frankly the switch to percentages for fans has caused a big mess in my opinion. A big mess that could have pretty easily been avoided. but what do I know?
I finally got to the github for the Sonoff LAN HACS integration and (surprise, surprise) the issue had already been noted by a few others. So now I can just watch that thread and hope to see a fix.
There is a temporary fix for this which involves editing the fan.py file.
Here’s the link: Home Assistant 2022.4.0b0 - Unable to prepare setup for platform sonoff.fan: Platform not found · Issue #735 · AlexxIT/SonoffLAN (github.com)
Scroll down a bit to get to the instructions.