From 1a01aa6d1be4b2f3dc65674192bfb61e725d9c89 Mon Sep 17 00:00:00 2001 From: Valter Ferreira Date: Wed, 16 Feb 2022 23:23:11 +0000 Subject: [PATCH] fix garage gate not working properly --- cover.yaml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/cover.yaml b/cover.yaml index 7979a3d..8bd1b90 100755 --- a/cover.yaml +++ b/cover.yaml @@ -2,29 +2,31 @@ covers: garage_door: device_class: garage - friendly_name: "Garage Door" - position_template: "{{ is_state('binary_sensor.portao_garagem_input') }}" + 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.turn_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.turn_on + - service: switch.toggle target: entity_id: switch.portao_garagem stop_cover: - service: switch.turn_on - target: - entity_id: switch.portao_garagem + - service: switch.toggle + target: + entity_id: switch.portao_garagem icon_template: >- - {% if is_state('binary_sensor.portao_garagem_input','off') %} + {% 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 + mdi:garage-alert-variant {% endif %}