Hello,
I am currently trying my hand at esphome and a servo motor.
So far so good. Everything is actually working. But I have the problem that the first positioning after a restart is done too fast.
The parameter “transition_length” doesn’t seem to work for the first positioning. However, the parameter has an effect on the next positionings.
How can I ensure that the first positioning run is also slow?
My source code is certainly not perfect. I’m just getting started with it …
I hope I have posted the source code here correctly.
esphome:
name: wandthermostat-wohnzim
friendly_name: wandthermostat-wohnzim
platform: ESP8266
board: d1_mini
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "xxxxxxx"
ota:
password: "xxxxxxx"
wifi:
ssid: xxxxxxx
password: xxxxxxx
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Wandthermostat-Wohnzim"
password: "xxxxxxx"
captive_portal:
output:
- platform: esp8266_pwm
id: pwm_output
pin: D1
frequency: 50 Hz
servo:
- id: thermostat_servo
output: pwm_output
restore: False
transition_length: 1.0s
auto_detach_time: 2s
number:
- platform: template
name: Wandthermostat Servo Control
id: wandthermostat_servo_control
icon: mdi:thermometer-auto
device_class: TEMPERATURE
min_value: -100
max_value: +100
step: 1
set_action:
then:
- servo.write:
id: thermostat_servo
level: !lambda 'return x / 100.0;'