Fan Control in lovelace

Good Morning,
I was up early and noticed that HA Core had and update to 2022.2.7 and ESPHome 2022.2.1 so did the updates and a backup before I did your instructions.

I followed you instructions and all went well until I got to clearing the cache using F12. This did not do as you said on my laptop and I tried Firefox & chrome. To clear the cache I went to settings and cleared the cache from there. I think that should work? I even tried it on the NUC ( HA machine) which is running Ubuntu and I used chrome here (same result)

Anyway to testing…

It did not work and I got the same errors.
Fan started and “failed to call service fan/set_percentage”

This was after I clicked on low

image

Hope I did it correctly?

I also noted that there is a HACS update does that need to be done? I did not think so?

image

Anyway I must go now :slightly_smiling_face:

No, that’s for the other one. you are working only with the fan-percentage-button-row plugin.

I’ll try to get the new changes into the main branch so it will be available in HACS so we eliminate any vagueness about the install process.

EDIT:

done now and the changes should be in HACS soon.

EDIT2:

in HACS now so you can just download it there and give it a try.

I just downloaded the latest HACS and did a number of tests.

Using the “percent” row I was able to change the speed of the dining room fan and you could see it in the dev tools

However

  • The :OFF" does not stop fan in the percent.
  • The buttons don’t change colour

This is my config for the percent card

There is something that I just noticed a typo in your information
In the Options in the CONTROL card you have sensStateWithSpeed when it should be sendStateWithSpeed

I also found
To Delete the browser cache with a shortcut.

The fastest way to get rid of the cache data in Google Chrome is the option “Clear Browser cache”. You can access this function with the following shortcut:

  1. Press the keys [Ctrl], [Shift] and [Del]. Be sure you press all the keys at once.

It also works in Firefox

change your plugin config to this (as a test):

  - type: custom:fan-percent-button-row
    entity: fan.sonoff_1000f6e8d5
    reverseButtons: true
    state_color: true
    sendStateWithSpeed: true

I don’t follow where you are saying I have the typo.

Is it just in the docs somewhere? Or in the code?

Either way I’m not seeing it.

the typo is fixed. Thanks for pointing it out.

does the speed control work tho?

Yes Speed control works in both versions.
However no colour change in the buttons and OFF does not stop the fan in both.

What service does your fan use to turn it off? fan.turn_off I assume?

If so I’m not sure why it doesn’t work since that is the same service the plugin uses for turning off the fan.

Yep


image

I just tested this in dev tools just to be sure
Beats me?

The interesting thing is that when you click on a speed the button does not change color and the off does not change from red??

I’m at a loss as to why you can’t get it to work.

try going into HACS and using the three dot menu for the percent plugin select “redownload”.

then restart HA. Then clear your browser cache again.

then retry the plugin once more.

Redownload - Done. Told me it was version 1.9
Restart HA - Done
Try - Percent Row
Clear Cache

image

From Log. It still gives this in log

Logger: homeassistant.components.fan
Source: components/fan/init.py:221
Integration: Fan (documentation, issues)
First occurred: 6:04:04 AM (3 occurrences)
Last logged: 6:07:30 AM

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

Try Again after clear cache

However when I use and automation

- id: '1621026002356'
  alias: Master Bedroom Fan Turn-On 26-29
  description: Turn on MB Fan when bedroom temp between 26 and 29C
  trigger:
  - platform: numeric_state
    entity_id: sensor.sonoff_1000e5a438_temperature
    above: '26'
    for: 00:10:00
    below: '28.5'
  condition:
  - condition: and
    conditions:
    - condition: state
      entity_id: fan.sonoff_1000f6e1ca
      state: 'off'
  action:
  - service: fan.turn_on
    target:
      entity_id: fan.sonoff_1000f6e1ca
    data:
      percentage: 33
  mode: single

The log does not update to 4 occurrences with this.
My FAN Turn on Automation’s work fine.
:roll_eyes: :question:

I don’t see why you are getting that warning.

The percent button row doesn’t use the set_speed service anywhere at all. It uses set_percentage just like the warning says to use.

I really have no idea how to help you anymore because I can’t reproduce what is happening to you.

The only thing I have left for you to try is to just completely remove the fan-control-entity-row plugin from HACS and resrart/clear cache/Try again using just the percent row plugin and see if you get the same warnings.

Worst case is that it still doesn’t work and you will need to download the other fan control plugin again.

OK Thank you for all your help so far you have been very patient and helpful.
I will try what you say when I get a few appointments and chores out of the road. They have been building up.
I will keep you posted on anything positive I find.
Thanks once again.

1 Like

It got the better of me so I had a few minutes before my first appointment.

I did as you suggested and removed the Control row, Restarted HA
All I have now is the percent row.

I clicked on buttons Low, Med, High and the fan responded as it should have.
There are no log errors!

Issues that remain are

  • Off does not work

  • Low, Med, High buttons don’t change color

If you can get those working I will be a happy little Vegemite as we say in Oz :slightly_smiling_face:

Edit 1
image
All fans are running on LOW and were started from the percent row and still no errors.

Dude; I’m following along with a similar issue.

Now you’re making me hungry :wink:

1 Like

I’d say that is at least progress!

the issue still is that your fans don’t report the current percentage attribute correctly.

I keep seeing in the screenshots you post that the percentage is always 0.

the plugin uses the reported percentage to set the states of the buttons as on or off and to determine if the off button can actually do anything - if the percentage is 0 then the plugin thinks the fan is already off so it is disabled.

Until you get the current state (percentage attribute) of the fan reported correctly you should probably stick to using the fan-control-entity-row plugin since the speeds still work at least for now.

You really need to follow up with a bug report to the owner of the integration that your fans are using to get those issues sorted out.

As a side note I tried that Vegemite stuff once. Let’s just say that it must be an acquired taste that we in the US haven’t achieved yet… :nauseated_face:

:laughing:

1 Like

The issue was already raised on https://github.com/AlexxIT/SonoffLAN/issues/699
It is flagged as an enhancement!!
I have added a comment and informed the owner that the Fan.set_speed service will fail in 2022.3 and later with the hope that it might get more attention.

The other thing I have been test driving is “button-Card” @RomRider and watching this YouTube Custom Button Card 1: Home Assistant Animate your Icons - Spin / Flash / Rotate - YouTube
If I could code :slightly_frowning_face: :frowning_face: I was thinking that maybe this might help
The fan turn red and spins when turned on

I was playing with this in dev tools

If I could somehow get that variable into the Button card and test for Low, Medium, High then have the fan speed change accordingly that would be cool. In the the video in this series RomRider does this but I am at a loss to try and make it work with my iFan03’s.
He has used ESPHome and flashed a switch.

Anyway I will keep plugging and hope that the owner of (AlexxIT) fixes the code.

PS the secret with Vegemite is to spread it very thinly on buttered toast. Too much spoils the taste! :laughing:

1 Like