Page 1 of 1

Esphome controlling servos ??

Posted: Sat Sep 12, 2020 12:18 pm
by Gromyjoe
I'm working on automating my airflow dampers before winter. Cant seem to get the example on esphome.io to work.. I get stupid syntax errors in the esphome yaml.
I'll post my current yamls in a bit.. but if theres a simpler way of opening and closing dampers I'm keen to hear what you guys have!!

Re: Esphome controlling servos ??

Posted: Wed Sep 30, 2020 5:40 pm
by Gromyjoe
in case someone needs this. im not sure how im going to add this to my setup, i have a servo for cold air in, one for recirculation and one for hot air out.
esphome create a node and setup as you would then add this

Code: Select all

api:
  services:
    - service: control_dump_servo
      variables:
        level: float
      then:
        - servo.write:
            id: servo_dump
            level: !lambda 'return level / 100.0;'
and this

Code: Select all

output:
  - platform: esp8266_pwm
    id: dump_servo
    pin: D3
    frequency: 50 Hz
    servo:
  - id: servo_dump
    output: dump_servo
configurations.yaml

Code: Select all

 control_dump_servo:
    initial: 0
    min: -45
    max: 45
    step: 5
    mode: slider
automations.yaml

Code: Select all

- id: '1601217169190'
  alias: Dump Servo Control
  description: ''
  trigger:
  - platform: state
    entity_id: input_number.control_dump_servo
  condition: []
  action:
  - service: esphome.hvac_servo_controller_control_dump_servo
    data:
      level: '{{ trigger.to_state.state | int }}'
  mode: single

Re: Esphome controlling servos ??

Posted: Tue Oct 26, 2021 5:32 pm
by jhagdorn
I used the same basic code to build:

ESPHome - 0/1-10V LED Dimmer - DIY cheap - viewtopic.php?f=27&t=6668
Light-Dimmer1.jpg

Re: Esphome controlling servos ??

Posted: Thu Dec 02, 2021 1:11 pm
by Gromyjoe
very nice build!