33 lines
1.0 KiB
YAML
Executable File
33 lines
1.0 KiB
YAML
Executable File
- platform: template
|
|
covers:
|
|
garage_door:
|
|
device_class: garage
|
|
friendly_name: "Garagem Portao"
|
|
value_template: "{{is_state('binary_sensor.portao_garagem_input','On')}}"
|
|
open_cover:
|
|
- condition: state
|
|
entity_id: binary_sensor.portao_garagem_input
|
|
state: "off"
|
|
- service: switch.toggle
|
|
target:
|
|
entity_id: switch.portao_garagem
|
|
close_cover:
|
|
- condition: state
|
|
entity_id: binary_sensor.portao_garagem_input
|
|
state: "on"
|
|
- service: switch.toggle
|
|
target:
|
|
entity_id: switch.portao_garagem
|
|
stop_cover:
|
|
- service: switch.toggle
|
|
target:
|
|
entity_id: switch.portao_garagem
|
|
icon_template: >-
|
|
{% if is_state('binary_sensor.portao_garagem_input','on') %}
|
|
mdi:garage
|
|
{% elif is_state('binary_sensor.portao_garagem_input','off') %}
|
|
mdi:garage-open
|
|
{% else %}
|
|
mdi:garage-alert-variant
|
|
{% endif %}
|