Well not sure now. Although setting servo pulse outside the 1mS to 2mS range could have unknown effects on some of them.
Here’s my code for the ESP32 project I made, if it helps. Not been updated for a year or so.
# Using Light component to set a standard RC servo position
light:
- platform: monochromatic
output: gpio_21_servo
name: "Servo actuator #1 - Servo Pos"
default_transition_length: 0ms
output:
- platform: ledc
pin: GPIO21
id: gpio_21_servo
frequency: 50 Hz
min_power: 5.0% # 5% at 50Hz is 1mS (20mS cycles)
max_power: 10.0% # 10% at 50Hz is 2mS (20mS cycles)
A snip of the IF/THEN action block...
then:
- output.turn_on: yellow_led
# - output.turn_on: esp32_blue_led
- output.set_level:
id: gpio_21_servo
level: 100.0% # 100% = 2mS as set by 'max_power'
- delay: 3000ms #700ms
- output.set_level:
id: gpio_21_servo
level: 0.0% # 0% = 1mS as set by 'min_power'