I’m working on a project I’ve seen for controlling a vent fan through PWM. I’ve gone over the wiring and schematics and I’m trying to understand the configuration in ESPHome. Here’s the part of the file I need to add to my current configuration on my ESP32:
output:
- platform: ledc
pin: GPIO5
id: intake_fan_op
inverted: true
frequency: 1000
fan:
- platform: speed
output: intake_fan_op
name: "Tent intake fan"
speed_count: 10
id: intake_fan
I have a few questions:
- These 2 sections seem to be describing the info for controlling 1 fan. What is it that says, “This fan works with this output?”
- I’ve read about people using ESPHome to control 2, or even 4, of these vent fans using PWM. How would I set up multiple instances to control more than one fan, all of the same type?
- I’m still learning the IO on the ESP32. Will any GPIO pin work for PWM fan control or only certain ones?
I think the id: intake_fan_op
in the output
section links that output to the fan
section, since the fan has output: intake_fan_op
and that seems obvious, but I really want to know what I’m doing before I start hooking hardware together! (And I get that if I’m right, I can define multiple fans and multiple outputs by just linking the output
field in each fan
section with the id
field in each separate output
section.)
And, last question:
- If I’m using multiple fans, is there a way to use inheritance to define all the items that would be the same on each fan, and reference that definition from each
fan
class or section?