Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- binary_sensor:
- #Kontaktron zamkniΔtej bramy
- - platform: gpio
- pin: 4 #D2
- name: "${friendly_name} closed"
- id: gate_closed
- button:
- - platform: template
- name: Gate
- icon: "mdi:autorenew"
- id: gate
- on_press:
- - switch.turn_on: d5_switch
- - delay: 1000ms
- - switch.turn_off: d5_switch
- switch:
- - platform: gpio
- pin: 14
- name: "Gate GPIO D5"
- id: d5_switch
- internal: true
- cover:
- - platform: template
- name: "Brama"
- device_class: "gate"
- lambda: |-
- if (id(gate_closed).state) {
- return COVER_CLOSED;
- } else {
- return COVER_OPEN;
- }
- open_action:
- - button.press: gate
- close_action:
- - button.press: gate
- stop_action:
- - button.press: gate
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement