Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sun:
- latitude: xx.0931
- longitude: -xx.8054
- on_sunrise:
- - elevation: 0.8°
- then:
- - if:
- condition:
- - switch.is_on: automatic_chicken_door
- then:
- - button.press: button_on_sunrise
- on_sunset:
- - elevation: -6°
- then:
- - if:
- condition:
- - switch.is_on: automatic_chicken_door
- then:
- - button.press: button_on_sunset
- binary_sensor:
- - platform: template
- id: door_opening
- name: "Door Opening"
- - platform: template
- id: door_closing
- name: "Door Closing"
- button:
- - platform: template
- id: stop_while_moving
- name: "Stop Mid-Cycle"
- on_press:
- then:
- - if:
- condition:
- or:
- - switch.is_on: relay1
- - switch.is_on: relay2
- then:
- - switch.turn_off: relay1
- - switch.turn_off: relay2
- - platform: template
- id: manually_close
- name: "Manual Close"
- on_press:
- then:
- - switch.toggle: relay2
- - platform: template
- id: manually_open
- name: "Manual Open"
- on_press:
- then:
- - switch.toggle: relay1
- ##########################################################################################
- # End Stop
- ##########################################################################################
- ##
- switch:
- - platform: template
- id: automatic_chicken_door
- name: "Automatic Open/Close"
- optimistic: true
- - platform: gpio
- id: relay1
- # name: 'Relay 1'
- pin: GPIO0
- internal: true
- interlock: [relay2]
- on_turn_on:
- then:
- - if:
- condition:
- - switch.is_on: automatic_chicken_door
- then:
- - binary_sensor.template.publish:
- id: door_opening
- state: ON
- - delay: 20s
- - switch.turn_off: relay1
- - binary_sensor.template.publish:
- id: door_opening
- state: OFF
- on_turn_off:
- then:
- - binary_sensor.template.publish:
- id: door_opening
- state: OFF
- - platform: gpio
- id: relay2
- # name: 'Relay 2'
- pin: GPIO2
- internal: true
- interlock: [relay1]
- on_turn_on:
- then:
- - if:
- condition:
- - switch.is_on: automatic_chicken_door
- then:
- - binary_sensor.template.publish:
- id: door_closing
- state: ON
- - delay: 20s
- - switch.turn_off: relay2
- on_turn_off:
- then:
- - binary_sensor.template.publish:
- id: door_closing
- state: OFF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement