From d3fbb28472a911d523d84080cf1892cdb52837dd Mon Sep 17 00:00:00 2001 From: Victor Alexandrovich Tsyrenschikov <77172321+tsyrenschikov@users.noreply.github.com> Date: Sat, 4 Oct 2025 15:13:00 +0500 Subject: [PATCH] Home --- configuration.yaml | 1 + switches.yaml | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 switches.yaml diff --git a/configuration.yaml b/configuration.yaml index d5ee936..36785df 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -16,6 +16,7 @@ script: !include scripts.yaml scene: !include scenes.yaml mqtt: !include mqtt.yaml climate: !include climate.yaml +switch: !include switches.yaml #template: !include template.yaml diff --git a/switches.yaml b/switches.yaml new file mode 100644 index 0000000..922ed2f --- /dev/null +++ b/switches.yaml @@ -0,0 +1,18 @@ +- platform: template + switches: + garage: + value_template: "{{ is_state('cover.garage_door', 'on') }}" + turn_on: + service: cover.open_cover + data: + entity_id: cover.garage_door + turn_off: + service: cover.close_cover + data: + entity_id: cover.garage_door + icon_template: >- + {% if is_state('cover.garage_door', 'open') %} + mdi:garage-open + {% else %} + mdi:garage + {% endif %} \ No newline at end of file