Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sensor:
- - platform: template
- sensors:
- garage_door:
- friendly_name: Garage
- value_template: >
- {% if is_state('binary_sensor.garage_door_open', 'on') %}
- garage open
- {% elif is_state('binary_sensor.garage_door_closed', 'on') %}
- garage closed
- {% endif %}
- template:
- - binary_sensor:
- - name: Garage Door Not Open
- state: >
- {% if is_state('binary_sensor.garage_door_closed', 'off') %}
- On
- {% elif is_state('binary_sensor.garage_door_closed', 'on') %}
- Off
- {% endif %}
- cover:
- - platform: template
- covers:
- garage_door:
- device_class: garage
- friendly_name: "Garage Door"
- value_template: >
- {% if is_state('binary_sensor.garage_door_open', 'on') %}
- Open
- {% elif is_state('binary_sensor.garage_door_closed', 'on') %}
- Closed
- {% else %}
- Opening
- {% endif %}
- open_cover:
- - service: switch.turn_on
- target:
- entity_id: switch.garage_door
- close_cover:
- - service: switch.turn_on
- target:
- entity_id: switch.garage_door
- stop_cover:
- service: switch.turn_on
- target:
- entity_id: switch.garage_door
- icon_template: >-
- {% if is_state('binary_sensor.garage_door_open', 'on') %}
- mdi:garage-open-variant
- {% elif is_state('binary_sensor.garage_door_closed', 'on') %}
- mdi:garage-variant
- {% else %}
- mdi:garage-alert-variant
- {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment