Esphome controlling servos ??

Home Assistant automation projects, questions, etc. go here.
Post Reply
Gromyjoe
LED Enthusiast
LED Enthusiast
Reactions:
Posts: 48
Joined: Fri Jul 03, 2020 2:28 pm

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!!
Gromyjoe
LED Enthusiast
LED Enthusiast
Reactions:
Posts: 48
Joined: Fri Jul 03, 2020 2:28 pm

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
jhagdorn
LED-Curious
LED-Curious
Reactions:
Posts: 7
Joined: Sat Aug 07, 2021 7:46 pm

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
Gromyjoe
LED Enthusiast
LED Enthusiast
Reactions:
Posts: 48
Joined: Fri Jul 03, 2020 2:28 pm

very nice build!
Post Reply