I’m trying to control a number of servos using a PCA9685 connected to a Wemos D1 mini. The servos appear correctly in home assistant and I can move them however I’m having a problem with the range of angle movement. The servos are capable of 180 degree movement. ESPHome gives me 0 to 100%. Setting the input to 0% sets the servo at about 30deg. Moving to 100% gives me about 120 deg.
I’ve used the PCA and servos with an arduino and they work ok. How do I get 0 to 180 deg movement?
i2c:
- id: bus_a
sda: GPIO4
scl: GPIO5
scan: true
#frequency: 10000
pca9685:
id: pca9685_1
i2c_id: bus_a
address: 0x40
frequency: 50
output:
- platform: pca9685 #Ch1
id: 'pca_channel1'
channel: 1
servo:
- id: my_servo_1
output: pca_channel1
number:
- platform: template
name: Spare_1
id: servo1
min_value: 0
restore_value: False
max_value: 100
optimistic: true
step: 1
set_action:
then:
- servo.write:
id: my_servo_1
level: !lambda 'return x / 100.0;'