Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- esphomeyaml:
- on_boot:
- then:
- # Set servo to idle position on boot
- - output.set_level:
- id: servo
- level: 7.5%
- output:
- - platform: esp8266_pwm
- id: servo
- frequency: 50Hz
- pin: D1
- # Servos operate at 50Hz with pulse width modulated signal
- # Their duty cycle determines the level.
- # Range is from 3% duty cycle to 12% duty cycle
- # 7.5% is idle level (according to arduino docs, also depends on
- # servo motor)
- cover:
- - platform: template
- name: "Template Cover"
- optimistic: true
- open_action:
- # Roll in one direction
- - output.set_level:
- id: servo
- level: 5%
- # Wait a bit
- - delay: 30s
- # Return to idle position
- - output.set_level:
- id: servo
- level: 7.5%
- close_action:
- # Roll in other direction
- - output.set_level:
- id: servo
- level: 10%
- # Wait a bit
- - delay: 30s
- # Return to idle position
- - output.set_level:
- id: servo
- level: 7.5%
- stop_action:
- # Return to idle position
- - output.set_level:
- id: servo
- level: 7.5%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement