Advertisement
Guest User

Untitled

a guest
Jan 13th, 2019
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.20 KB | None | 0 0
  1. esphomeyaml:
  2.   on_boot:
  3.     then:
  4.      # Set servo to idle position on boot
  5.       - output.set_level:
  6.           id: servo
  7.           level: 7.5%
  8.  
  9. output:
  10.   - platform: esp8266_pwm
  11.     id: servo
  12.     frequency: 50Hz
  13.     pin: D1
  14.     # Servos operate at 50Hz with pulse width modulated signal
  15.     # Their duty cycle determines the level.
  16.     # Range is from 3% duty cycle to 12% duty cycle
  17.     # 7.5% is idle level (according to arduino docs, also depends on
  18.     # servo motor)
  19.  
  20. cover:
  21.   - platform: template
  22.     name: "Template Cover"
  23.     optimistic: true
  24.     open_action:
  25.      # Roll in one direction
  26.       - output.set_level:
  27.           id: servo
  28.           level: 5%
  29.       # Wait a bit
  30.       - delay: 30s
  31.       # Return to idle position
  32.       - output.set_level:
  33.           id: servo
  34.           level: 7.5%
  35.     close_action:
  36.      # Roll in other direction
  37.       - output.set_level:
  38.           id: servo
  39.           level: 10%
  40.       # Wait a bit
  41.       - delay: 30s
  42.       # Return to idle position
  43.       - output.set_level:
  44.           id: servo
  45.           level: 7.5%
  46.     stop_action:
  47.      # Return to idle position
  48.       - output.set_level:
  49.           id: servo
  50.           level: 7.5%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement