Added cover for garaga door

This commit is contained in:
2021-10-23 15:58:20 -04:00
parent d3205f7c7d
commit d019d5e078
2 changed files with 21 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ media_player: !include media_player.yaml
input_number: !include input_number.yaml input_number: !include input_number.yaml
timer: !include timer.yaml timer: !include timer.yaml
switch: !include switch.yaml switch: !include switch.yaml
cover: !include cover.yaml
frontend: frontend:
themes: !include_dir_merge_named themes themes: !include_dir_merge_named themes

20
cover.yaml Normal file
View File

@@ -0,0 +1,20 @@
- platform: template
covers:
garage_door:
friendly_name: "Garage Door"
#This is what defines your garage door as being open (your sensor reports 7)
value_template: "{{ is_state('binary_sensor.garage_door_sensor', 'on') }}"
open_cover:
service: switch.toggle
data:
entity_id: switch.garage_door
close_cover:
service: switch.toggle
data:
entity_id: switch.garage_door
icon_template: >-
{% if is_state('binary_sensor.garage_door_sensor', 'on') %}
mdi:garage-open
{% else %}
mdi:garage
{% endif %}