Ceiling fan speed control switch

I am trying to find a Home Assistant compatible ceiling fan speed controller that meets my requirements.

The Leviton D24SF-1BW would be ideal, but from the reading I have done, it is not supported by Home Assistant.

The Lutron PD-FSQN-WH would be fine too, and it is compatible with Home Assistant, but it requires a hub, and I want to avoid using hubs for smart devices if I can.

I have a Treatlife DS02F switch currently installed (from before I started using Home Assistant) . It appears other Treatlife switches can have their firmware hacked/replaced (I am fine doing this), but unfortunately this fan speed controller does not appear to have a similar hack available.

With the above examples, you can kind of see what I am going for. I want something I can wire into a wall that controls the fan speed via physical interaction on the wall AND through Home Assistant.

I want to stay away from any of the fan controllers that you stuff into the base of the fan or into the wall cavity and use a remote that is hung on the wall like the Sonoff Fan04.

I would prefer it to only do speed control, like my examples, but I will accept one that does lights and speed if there are no better options.

So does what i described exist? or am I being too picky? Thanks for any insight!

Not picky. I have not found something similar either, but will be watching other comments in this thread.

They’ve replaced the module on that fan with beken, so you could still flash it with openbeken/libretiny.

I have the Leviton DW4SF. I just found out today that you can add it with a dimmable light switch button to your dashboard and it does change the fan speed.

You just add the Leviton app to your configuration.yaml:

# leviton config
light:
  - platform: decora_wifi
    username: "username"
    password: "password"

Here’s an example of what I mean for the dashboard button:

type: light
entity: light.master_fan
name: Master Bedroom Ceiling Fan
icon: mdi:ceiling-fan
hold_action:
  action: toggle

Thanks for the info! If I had saw this earlier, I probably would have went with with this solution. I ended up going the “hard way” though, which I will detail in my next reply.

The solution I settled on was to disassemble the TreatLife DS02F fan speed controller I already had and replace the WIFI module with an ESP8266-F12 that was flashed with ESPHome. It required a bit of investment… I had been looking for an excuse to buy a hot air rework station :sweat_smile:. I figured it was worth it since I plan to install another 2 or 3 of these sometime soon.

This is the video I followed that got me most of the way there. He takes apart a different TreatLife product, but it was fairly similar.

For what its worth, I ended up breaking half the clips that held the face onto the switch because I didn’t know where they were. There are 4 of them and they are on the sides. Also, be careful when removing the face plate, there is a thin ribbon wire the connects front to the back. Disconnect it like usual, slide the locking bar out before attempting to remove the ribbon. Since I broke those clips, I’m just going to use a couple dabs of Super Glue before I install it back in the wall.

If you use a hot air rework station to replace the chip, take the foam pad off that’s next to the microswitch. I tried to be really careful with the hot air, but the foam still slowly shrank. I noticed early enough to remove it before it caused problems. I was able to stick it back on the board before assembly and it was fine.


This link will take you to the ESPHome page for the TreatLife DS02F Fan Controller:

I started off with the example code they provided, but ended up changing it a bit. Specifically the

logger:
  baud_rate: 0

needed to be added, otherwise it kept giving me errors when i tried to look at the logs via WIFI through ESPHome. The below code is what I am currently using.


substitutions:
  devicename: master-bedroom-fan-control
  friendly_name: Master Bedroom Fan Control

esphome:
  name: ${devicename}
  friendly_name: ${friendly_name}

esp8266:
  board: esp01_1m

# Enable logging
logger:
  baud_rate: 0

# Enable Home Assistant API
api:
  encryption:
    key: "YourKeyHere"

ota:
  password: "YourOTAPasswordHere"

wifi:
  ssid: !secret wifi_ssid_house
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "${friendly_name}"

captive_portal:

uart:
  rx_pin: GPIO3
  tx_pin: GPIO1
  baud_rate: 115200

tuya:

fan:
  - platform: "tuya"
    name: Speed
    switch_datapoint: 1
    speed_datapoint: 3
    speed_count: 4

Its working well so far! I added it as a button card to my dashboard. At first I could not figure out how to control the speed from Home Assistant since the entity it added behaves like a normal light switch, but then I realized if I “long press” the button, it would give me the detailed view which was a slider.

That’s my only complaint really… Personally I would like to have a toggle for the “On/Off” state and a dedicated separate slider to control the speed setting without needing to long press. Honestly its a mild complaint, I’m getting used to how it currently works and I’m starting to prefer it since it takes up less space in exchange for a different click.

I ended up using the Treatlife DS03, (LocalTuya must be installed) and it worked pretty well.