Logger: homeassistant.components.fan
Source: components/fan/init.py:221
Integration: Fan (documentation, issues)
First occurred: 12:09:39 PM (6 occurrences)
Last logged: 12:27:32 PM
The fan.set_speed service is deprecated and will fail in 2022.3 and later, use fan.set_percentage or fan.set_preset_mode instead
I have three ceiling fans in my house that I use *Automations * control them.
Two are A/C fans using Somoff iFan03 devices (Dining Room and Master Bedroom) and the third is a DC Fan (TV Room) that uses RF 433MHz from a remote or a Broadlink RM4 Pro.
I was using the fan.set_speed so changed the automations.
For the Sonoff Fans I am able to use Percentage control but this does not work with the Broadlink so I use remote control commands that I loaded into the Broadlink.
Previously I wanted control from Lovelace and I found Fan Control Entity Row in HACS from @finity69x2 and it worked fine until I made the changes.
If I use the buttons things current work but if the automations trigger and run:
Then
–The Dining Room and Master Bedroom update the buttons and the fan icon
–The TV Room does not update
I am note sure what to do??
I mainly need to stop the TV Fan
Workarounds I have found for the TV room
Use the old remote
If I click on a speed button and the on the stop button it seems to do the job but that’s counterintuitive for other users.
I though that loading the Fan-Percent-Button-Row might help but it just gives me an error “failed to call service/fan_percentage”
If anyone can shed some light I would be grateful.
Thanks
I have not flashed any of the devices, they are stock standard.
When I get the Sonoff devices I first load/configure them in the eWeLink app.
This is the entry in my configuration.yaml. I have blurred out username and password
According to the doco it has been tested with iFans02 & iFan03.
This is what my eWeLink for one of the iFans03 looks like and it has the low, medium and high settings.
I have checked and it the latest firmware. I have looked under settings and can’t see anywhere to change that either.
Can you go to the services tab and select each iFan03 fan and set it to 33% using the “fan.set_percentage” service? is it succesfull?
then try setting the TV fan to some percentage. I’m not sure what it will be since it looks like it is a 6 speed fan. But try 33% first just to see if it works.
OK. that’s really unfortunate. And kind of surprising. The fans have percentages listed as attributes so I would have assumed that setting percentages would have been supported.
I don’t know why you are getting errors when you try to set the percentages tho.
I don’t use the unmodified iFan03 with the factory firmware so I don’t know if it’s possible to convert those to use the percentages or not without flashing a third party firmware.
I know you can convert them to use the percentages by flashing them with Tasmota or ESPHome. I’ve used both and they work fine. Right now both of my iFan03’s are running ESPHome which is my recommended solution.
as far as your other fan I have no idea how you can convert that one.
just from a quick look at the code it seems that it should already support speed percentages.
I know there are a couple of users on here that use that SmartIR software so maybe one of them might pop in and confirm if theirs works or not. (I think that @sparkydave is one of them - I hope he doesn’t mind me tagging him )
My only advice at this point might be to go to the HA Discord and ask over there.
I’ve let my feelings be known about the switch away from named speeds to percentages and it’s fallen on deaf ears so hopefully they will support users like yourself who are struggling to get their fans converted to the new control scheme.
Once you finally figure out how to get your fans to run at different speeds by using the set_percentage service then you will be able to use the fan-percent-button-row instead of the fan-control-entity-row plugin to control them since the latter only supports the named speeds options.
Good Morning,
Yes I agree it’s not what I would have hoped for and I agree going away from named speeds makes it difficult for me and probably others. What was their reasoning?
I don’t know what the HA Discord is?
I have had interaction with @sparkydave before and he has helped me.
Anyway, I will continue to try and figure it out.
AC FANs
An interesting thing is on the two Sonoff iFan03 fans my automation’s work on percentage!
As you can see I set the speed as 33%
I just ran the actions on both of these and both turned the fans on at what I would have called the low speed.
I ask myself, why do automation actions work and not the call service in developer tools?
The only difference that I can see is that the action calls the fan.turn_on and the speed seems to be an attribute of that?
Ok so just now I tried this (fan:turn_on) in Developer tools → service and it worked on the Dining Room Fan (Sonoff iFan03) and it worked. I tried it on both fans.
Interestingly the buttons updated on the fan-control-entity-row plugin
Beats me?
Any ideas where to from here?
Update
I have changed my automation’s on the DC Fan to use the Fan:turn_on service, tested actions and it worked. It also updated the control row buttons.
Since your fans still contain the speed lists they will continue to work with the fan-control-entity-row plugin until the speed lists are completely removed/no longer supported.
At that point that plugin will no longer work.
The fan-percent-button-row plugin should also work for at least your iFan03 fans. It works for mine. And I have a zigbee fan that contains both percentage and a speed list and the percent plugin works for that as well.
the plugin may need one of the options changed if you can’t get it to work.
there is an option called “sendStateWithSpeed”. In the plugin config set that to “true”
similar to this example:
- entity: fan.hall_fan
type: custom:fan-percent-button-row
name: Hall Fan
sendStateWithSpeed: true
the plugin by default just calls the “set_percentage” service and most of the time that works.
if you use the “sendStateWithSpeed” option it sends the “fan.turn_on” service followed by the “set_percentage” service with the correct setpoint.
I keep seeing the pop-up in the corner that says “failed to call service fan.set_percentage”.
I can’t reproduce that behavior on my end at all.
did you say “fan.set_percentage” (without the fan.turn_on service call included) works in an automation service call but it doesn’t work via the services tab? Those shouldn’t make any difference where they are called from.
So let’s try one more thing…
when you turn on the fan with the fan percent plugin look at the fan in the dev tools states page and tell me what the percentage and speed attributes say (screenshot will work too).
if you click on the low speed button it should send the fan.turn_on service and then send the fan.set_percentage service with a percent value of 33 by default. Medium by default is 66 and high is 100 by default.
are those the numbers you are seeing?
let’s just do this for one fan at first to see if we can get at least one to work and then hopefully thatr will make the others easier. Let’s start with one of the iFan03’ssince it’s a fan I have.
If the fan is OFF and I click on the Middle speed button then the fan starts but goes to the low speed and I get the “failed to call service fan/set_percentage”
the fan turn_on service sets the fan to the default speed of low every time it’s called.
For some reason your fans don’t support the set_percentage service directly. they only support the percentage setpoint as service data in a turn_on service call.
I’m not sure you will be able to do anything about that except submit a bug report or go to the HA Discord and see if you can get any support there.
Until that gets resolved you won’t be able to update to using my fan-percent-button-row plugin.
All of my fans support calling the set_percentage service directly so I’m not sure what is different about yours.
I’ll try to look into modifying the plugin to accept the turn_on service with percent data instead of calling the set_percentage service directly.
I’m surprised I haven’t seen this issue raised for the plugin before now.
Well the positive out of this is that I think we have defined the problem.
Old Engineering saying
" You can’t get a solution if you can’t define the problem"
I will put in a report to discord and see what response I get in the near future.
Thank you for you efforts, I appreciate them.
Keep me posted if you have any light bulb moments
Thanks again.
PS I created an account on Discord but have no idea what to do??
in the green “code” drop down select “download zip”:
unzip that directory and copy the “fan-percent-button-row.js” file from the “dist” folder and replace the same file in your “www/community/fan-percent-button-row/” folder with the new file you just5 downloaded.
restart HA and when it has finished restarting do a hard refresh of your browser cache by pushing the F12 button your keyboard. Then right click on the “reload” button in your browser and select “empty cache and hard reload”:
once it’s done then you should have the new file installed and active and hopefully it will work.
you still need to have the “sendStateWithSpeed” option set to true in the card config.
Since the prior plugin didn’t work for you anyway then overwriting it with the new file won’t disrupt anything else a long as you follow the instructions above. But if you don’t feel comfortable doing it then that’s OK too.
Let me know if it works or if you need anything further.