From 96934eb9add1c10463282832a96d372c8ad32dde Mon Sep 17 00:00:00 2001 From: Tobias Lehmann Date: Tue, 1 Jul 2025 14:26:21 +0200 Subject: [PATCH] templates added --- .../homeassistant/templates/air-quality.yaml | 197 ++++++++++++++++++ files/homeassistant/templates/alert.yaml | 46 ++++ files/homeassistant/templates/filter.yaml | 88 ++++++++ 3 files changed, 331 insertions(+) create mode 100644 files/homeassistant/templates/air-quality.yaml create mode 100644 files/homeassistant/templates/alert.yaml create mode 100644 files/homeassistant/templates/filter.yaml diff --git a/files/homeassistant/templates/air-quality.yaml b/files/homeassistant/templates/air-quality.yaml new file mode 100644 index 0000000..5b06ce6 --- /dev/null +++ b/files/homeassistant/templates/air-quality.yaml @@ -0,0 +1,197 @@ +type: custom:stack-in-card +cards: + - type: gauge + entity: sensor.helper_max_co2 + name: Luftqualität + needle: true + min: 0 + max: 3000 + segments: + - from: 0 + color: green + - from: 800 + color: orange + - from: 1200 + color: red + card_mod: + style: + ha-gauge: + $: | + svg.text > .value-text { + font-size: 3em !important; + } + svg { + height: 3.1em; + } + .: | + ha-card { + height: 100% !important; + } + .name { + font-size: 0.7em !important; + } + tap_action: + action: fire-dom-event + browser_mod: + service: browser_mod.popup + data: + title: Luftqualität + timeout: 20000 + content: + type: vertical-stack + cards: + - type: horizontal-stack + title: Untergeschoss + cards: + - type: markdown + content: " " + - type: markdown + content: " " + - type: markdown + content: " " + - type: markdown + content: " " + - type: markdown + content: " " + card_mod: + style: | + ha-card { + height: 100% !important; + } + ha-card .name { + font-size: 0.7em; + } + - type: horizontal-stack + title: Erdgeschoss + cards: + - type: gauge + entity: sensor.house_ground_floor_family_living_room_ceiling_co2 + name: Wohnzimmer + needle: true + min: 0 + max: 2000 + segments: + - from: 0 + color: green + - from: 800 + color: orange + - from: 1200 + color: red + card_mod: + style: + ha-gauge: + $: | + svg.text > .value-text { + font-size: 3em !important; + } + svg { + height: 3.1em; + } + .: | + ha-card { + height: 100% !important; + } + .name { + font-size: 0.7em !important; + } + - type: gauge + entity: sensor.esphome_eg_bath_co2 + name: Elternbad + needle: true + min: 0 + max: 2000 + segments: + - from: 0 + color: green + - from: 800 + color: orange + - from: 1200 + color: red + card_mod: + style: + ha-gauge: + $: | + svg.text > .value-text { + font-size: 3em !important; + } + svg { + height: 3.1em; + } + .: | + ha-card { + height: 100% !important; + } + .name { + font-size: 0.7em !important; + } + - type: markdown + content: " " + - type: markdown + content: " " + - type: markdown + content: " " + card_mod: + style: | + ha-card { + height: 100% !important; + } + ha-card .name { + font-size: 0.7em; + } + - type: horizontal-stack + title: Obergeschoss + cards: + - type: gauge + entity: sensor.house_first_floor_parents_ceiling_co2 + name: Elternschlafzimmer + needle: true + min: 0 + max: 2000 + segments: + - from: 0 + color: green + - from: 800 + color: orange + - from: 1200 + color: red + card_mod: + style: + ha-gauge: + $: | + svg.text > .value-text { + font-size: 3em !important; + } + svg { + height: 3.1em; + } + .: | + ha-card { + height: 100% !important; + } + .name { + font-size: 0.7em !important; + } + - type: markdown + content: " " + - type: markdown + content: " " + - type: markdown + content: " " + - type: markdown + content: " " + card_mod: + style: | + ha-card { + height: 100% !important; + } + ha-card .name { + font-size: 0.7em; + } + card_mod: + style: | + ha-card { + height: 100% !important; + } + ha-card .name { + font-size: 0.7em; + } diff --git a/files/homeassistant/templates/alert.yaml b/files/homeassistant/templates/alert.yaml new file mode 100644 index 0000000..bbf29d3 --- /dev/null +++ b/files/homeassistant/templates/alert.yaml @@ -0,0 +1,46 @@ +type: custom:auto-entities +card: + square: false + type: grid + columns: 1 +card_param: cards +filter: + exclude: + - state: "off" + - state: idle + include: + - entity_id: /^alert(.).* + state: "on" + options: + type: custom:mushroom-template-card + primary: Alarm + secondary: "!!!" + icon: mdi:alert-circle + icon_color: red + fill_container: true + layout: vertical + multiline_secondary: false + card_mod: + style: | + ha-card { + animation: blink 1s linear infinite; + } + @keyframes blink { 50% {opacity: 0;} } + + mushroom-shape-icon$: | + .shape + { + {% if states('sensor.luba_vsm5l4ku_aktivitatsmodus') == 'MODE_WORKING' or states('sensor.luba_vsm5l4ku_aktivitatsmodus') == 'MODE_RETURNING' %} + --shape-animation: spin 3s linear infinite; + {% endif %} + --icon-symbol-size: 1.4em; + --icon-size: 1.8em; + } + mushroom-state-info$: | + .container { + --card-primary-font-size: 0.7em; + --card-secondary-font-size: 0.7em; + --card-primary-line-height: 1.0em; + --card-secondary-line-height: 1.0em; + } +show_empty: true diff --git a/files/homeassistant/templates/filter.yaml b/files/homeassistant/templates/filter.yaml new file mode 100644 index 0000000..52a5a67 --- /dev/null +++ b/files/homeassistant/templates/filter.yaml @@ -0,0 +1,88 @@ +type: custom:auto-entities +card: + square: false + type: grid + columns: 1 +card_param: cards +filter: + exclude: + - state: "off" + - state: idle + include: + - entity_id: /^alert(.).* + state: "on" + options: + type: custom:mushroom-template-card + primary: Alarm + secondary: "!!!" + icon: mdi:alert-circle + icon_color: red + fill_container: true + layout: vertical + multiline_secondary: false + tap_action: + action: fire-dom-event + browser_mod: + service: browser_mod.popup + data: + dismissable: true + autoclose: false + title: Alarm + size: fullscreen + timeout: 60000 + content: + type: horizontal-stack + cards: + - type: custom:auto-entities + show_empty: true + card: + type: entities + card_mod: + style: | + ha-card { + background-color: red; + border-radius: 5px; + --primary-color: white; + --paper-item-icon-color: white; + --secondary-text-color: white; + height: 11em !important; + overflow-y: scroll !important; + } + filter: + include: + - entity_id: /^alert(.).* + options: + secondary_info: last-changed + exclude: + - state: "off" + - state: idle + sort: + method: last_changed + reverse: true + grid_options: + columns: full + + card_mod: + style: | + ha-card { + animation: blink 1s linear infinite; + } + @keyframes blink { 50% {opacity: 0;} } + + mushroom-shape-icon$: | + .shape + { + {% if states('sensor.luba_vsm5l4ku_aktivitatsmodus') == 'MODE_WORKING' or states('sensor.luba_vsm5l4ku_aktivitatsmodus') == 'MODE_RETURNING' %} + --shape-animation: spin 3s linear infinite; + {% endif %} + --icon-symbol-size: 1.4em; + --icon-size: 1.8em; + } + mushroom-state-info$: | + .container { + --card-primary-font-size: 0.7em; + --card-secondary-font-size: 0.7em; + --card-primary-line-height: 1.0em; + --card-secondary-line-height: 1.0em; + } +show_empty: true