Ejemplo de yaml para controlar un servo con un ESP8266 con ESPHome
servo:
- id: my_servo
output: pwm_output
# Example output platform
# On ESP32, use ledc output
output:
- platform: esp8266_pwm
id: pwm_output
pin: GPIO15
frequency: 50 Hz
number:
- platform: template
name: Servo Control
min_value: -100
initial_value: 0
max_value: 100
step: 1
optimistic: true
set_action:
then:
- servo.write:
id: my_servo
level: !lambda 'return x / 100.0;'