Fan speed 3 speed vs 4 speed

I have a few Lutron Caseta Fan switches which supports 4 fan speeds. It mapped the speeds Low, Medium, Medium-High, High to Low, Medium, High in the fan entity. However, if I’m reading correctly the fan domain only supports 3 speeds? The Low speed isn’t really useful with the fans that I have connected to these switches. Is it possible to remap the speed so it actually uses Medium, Medium-High, and High for the Low, Medium, High settings?

speed_list: off, low, medium, high
speed: medium
device_id: 25
zone_id: 15
friendly_name: Master Bedroom_Ceiling Fan
supported_features: 1
1 Like

I believe you can add however many speeds you need and you can even call them whatever you want (a,b,c… 1,2,3…).

But I’ve only ever added fans thru yaml manually.

If you are adding the fan thru the GUI I have no idea what the limitations are there.

Would you have an example of your yaml?

I found this for the fan entity component which seems to support 3 speeds:

https://github.com/home-assistant/core/blob/f8e48a92302e19e314a36aa88cf64c869f1eaade/homeassistant/components/fan/init.py

SPEED_OFF = "off"
SPEED_LOW = "low"
SPEED_MEDIUM = "medium"
SPEED_HIGH = "high"

I doubt the yaml for my fans will help you since my fans are mqtt fans (Sonoff iFan02 & iFan03)

But I just added a zigbee fan controller from Hampton Bay a few days ago and it added all kinds of fan speeds so I don’t know why your 4 speeds aren’t showing up.

and I don’t have any Lutron fans to test.

the only thing I can suggest is to create a template fan based on your current fan entity and remap the speeds in there.

Yeah, my whole house has all fans using Lutron Casetas switches and basically low and medium are quite low. And high is very high. Seems that it’s impossible at the moment to have a 4 speed fan. I think the Lutron integration and Fan entities would have to be modified for this to work.

As a work around, I ended up copying Home-assistant’s Lutron Caseta component to the custom_component directory and remapping the speeds in the fan.py. This removes me from being able to use the lowest Lutron Caseta fan speed, but opens up being able to use Medium-High speed.

# fan.py
VALUE_TO_SPEED = {
    None: SPEED_OFF,
    FAN_OFF: SPEED_OFF,
    FAN_LOW: SPEED_LOW,
    # Remap Lutron Medium (2) to Home-Assistant Low
    FAN_MEDIUM: SPEED_LOW,
    # Remap Lutron Medium-High (3) to Home-Assistant Medium
    FAN_MEDIUM_HIGH: SPEED_MEDIUM,
    FAN_HIGH: SPEED_HIGH,
}

SPEED_TO_VALUE = {
    SPEED_OFF: FAN_OFF,
    # Remap Home-Assisant Low to Lutron Medium (2)
    SPEED_LOW: FAN_MEDIUM,
    # Remap Home-Assisant Medium to Lutron Medium-High (3)
    SPEED_MEDIUM: FAN_MEDIUM_HIGH,
    SPEED_HIGH: FAN_HIGH,
}

Thanks a lot! Will try it out later today. I barely use the low speed so that would work for me.

Did this today - thanks so much for the idea. Works perfectly!

So tried the above code, but it doesn’t seem to do anything/I can’t tell if Home Assistant is using it, I just know it isn’t working for me (speeds are still high, medium-low, and low).

Running HA in docker, and created a custom_components\lutron_caseta folder in the same space as my config, and saved fan.py to that new folder. Is there something I’m missing?

Bumping this…I’m guessing I can’t get this working since I need to copy all the other lutron files to the custom folder. That said, I can’t locate where those files exist within the docker image…it isn’t in any of the usual places (eg. /etc, /usr/share, /home…)

Hi,

Correct, you will need all the files for the lutron caseta put into the /root/config/custom_components/lutron_caseta directory. You can find the files on github at the below URL. You can use something like GitZip browser plugging to download the files in the folder or just open each file and copy/paste the contents.

Thanks for the link – Seems to be working now that I’ve added everything. I hit a snag at first thinking your fan.py content above replaced the existing file vs modifying just that section.

Once I put the downloaded file back and just tweaked those lines, all is working as it should.

Awesome. I went through the same process since I don’t really understand all the ins and outs. I did the same thinking I could just copy the fan.py file over and trying to figure out where to get the full directory of files. Just keep in mind as time goes by, the lutron_caseta component may get updated and we will need to watch to manually update the custom component files.

FYI, KOF 4 speed fan controller is currently being dicussed in King Of Fans MR101Z missing MAX setting · Issue #628 · zigpy/zigpy · GitHub

1 Like

It looks like this was added to the repository 12 days ago.