Advertisement
adorobis

esphome gate

Dec 10th, 2022
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. binary_sensor:
  2. #Kontaktron zamkniΔ™tej bramy
  3. - platform: gpio
  4. pin: 4 #D2
  5. name: "${friendly_name} closed"
  6. id: gate_closed
  7. button:
  8. - platform: template
  9. name: Gate
  10. icon: "mdi:autorenew"
  11. id: gate
  12. on_press:
  13. - switch.turn_on: d5_switch
  14. - delay: 1000ms
  15. - switch.turn_off: d5_switch
  16. switch:
  17. - platform: gpio
  18. pin: 14
  19. name: "Gate GPIO D5"
  20. id: d5_switch
  21. internal: true
  22. cover:
  23. - platform: template
  24. name: "Brama"
  25. device_class: "gate"
  26. lambda: |-
  27. if (id(gate_closed).state) {
  28. return COVER_CLOSED;
  29. } else {
  30. return COVER_OPEN;
  31. }
  32. open_action:
  33. - button.press: gate
  34. close_action:
  35. - button.press: gate
  36. stop_action:
  37. - button.press: gate
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement