Advertisement
cperryoh

Untitled

Jan 25th, 2021
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. output:
  2. - platform: gpio
  3. pin: D3
  4. id: relay
  5. switch:
  6. - platform: template
  7. name: "PC"
  8. lambda: 'return id(pc_power).state'
  9. turn_on_action:
  10. - switch.turn_on: pc
  11. turn_off_action:
  12. - switch.turn_off: pc
  13. - platform: template
  14. name: "PC switch"
  15. id: pc
  16. turn_on_action:
  17. - output.turn_on: relay
  18. - delay: 0.5s
  19. - output.turn_off: relay
  20. turn_off_action:
  21. - output.turn_on: relay
  22. - delay: 0.5s
  23. - output.turn_off: relay
  24. binary_sensor:
  25. - platform: gpio
  26. pin: D5
  27. filters:
  28. - delayed_off: 500ms
  29. id: pc_power
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement