homemwfv
(Martin)
May 31, 2024, 12:26pm
1
How can I optimize my code to make my servo slow to the intial position when restarting the ESP?
output:
- platform: ledc
id: pwm_servo
pin: GPIO26
frequency: "50Hz"
servo:
- id: louis_led_servo
output: pwm_servo
transition_length: 10.0s
number:
- platform: template
name: "Servo Control"
initial_value: 0
max_value: 100
step: 1
optimistic: true
on_value:
then:
- servo.write:
id: louis_led_servo
level: !lambda 'return x / 100.0;'
Karosm
(Karosm)
May 31, 2024, 12:47pm
2
Not so clear what you are looking for…
on_boot:
then:
?
homemwfv
(Martin)
May 31, 2024, 12:54pm
3
After restarting the ESP32, the servo returns to a home position very quickly. However, I want it to return to the home position very slowly and not jerkily. Then the servo moves to the positions again at the correct speed with the option “transition_length: 10s”.
Karosm
(Karosm)
May 31, 2024, 6:05pm
4
Is it necessary to move to “home position”?
Many servos (with an absolute servo motor) will go to its start position at power up, and you can’t set the transition speed of that, unfortunately.
Best you can do, in those circumstances, is to set the restore: true
option, and leave it at that.
Karosm
(Karosm)
May 31, 2024, 8:40pm
6
Something in on_boot with high priority can have any effect?
Not if the servo goes to the start position as soon as it gets power.
1 Like
Which servo are we talking about here? Link? Is this all the config that deals with the servo?