Hello @tom_l, thanks again! It works
esphome:
name: basement_ventilation_fan
platform: ESP32
board: esp-wrover-kit
wifi:
ssid: "xxx"
password: "xxx"
# Enable logging
logger:
# Enable Home Assistant API
api:
password: "xxx"
ota:
password: "xxx"
output:
- platform: ledc
pin: GPIO19
frequency: 10000 Hz
id: ventilation_fan_pwm
fan:
- platform: speed
output: ventilation_fan_pwm
name: "Basement Ventilation Fan"
Just put the integration in on Home Assistant and the high-medium-low works out of the box. Tried with a lower frequency first but it made no sense. At 10000Hz it works just as I hoped.
Thanks for your help!