PoisonWaffle

Garage Door HA Configuration.yaml

Nov 26th, 2023 (edited)
564
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | Source Code | 0 0
  1. sensor:
  2. - platform: template
  3. sensors:
  4. garage_door:
  5. friendly_name: Garage
  6. value_template: >
  7. {% if is_state('binary_sensor.garage_door_open', 'on') %}
  8. garage open
  9. {% elif is_state('binary_sensor.garage_door_closed', 'on') %}
  10. garage closed
  11. {% endif %}
  12.  
  13. template:
  14. - binary_sensor:
  15. - name: Garage Door Not Open
  16. state: >
  17. {% if is_state('binary_sensor.garage_door_closed', 'off') %}
  18. On
  19. {% elif is_state('binary_sensor.garage_door_closed', 'on') %}
  20. Off
  21. {% endif %}
  22.  
  23. cover:
  24. - platform: template
  25. covers:
  26. garage_door:
  27. device_class: garage
  28. friendly_name: "Garage Door"
  29. value_template: >
  30. {% if is_state('binary_sensor.garage_door_open', 'on') %}
  31. Open
  32. {% elif is_state('binary_sensor.garage_door_closed', 'on') %}
  33. Closed
  34. {% else %}
  35. Opening
  36. {% endif %}
  37. open_cover:
  38. - service: switch.turn_on
  39. target:
  40. entity_id: switch.garage_door
  41. close_cover:
  42. - service: switch.turn_on
  43. target:
  44. entity_id: switch.garage_door
  45. stop_cover:
  46. service: switch.turn_on
  47. target:
  48. entity_id: switch.garage_door
  49. icon_template: >-
  50. {% if is_state('binary_sensor.garage_door_open', 'on') %}
  51. mdi:garage-open-variant
  52. {% elif is_state('binary_sensor.garage_door_closed', 'on') %}
  53. mdi:garage-variant
  54. {% else %}
  55. mdi:garage-alert-variant
  56. {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment