From 8e6c6d011169bf4e08a49cb63935885921f974dc Mon Sep 17 00:00:00 2001 From: Claus Dethlefsen Date: Mon, 6 Apr 2026 11:42:19 +0200 Subject: [PATCH] Show compact dishwasher start time --- dashboards/views/01_home.yaml | 2 +- include/templates/dishwasher.yaml | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 include/templates/dishwasher.yaml diff --git a/dashboards/views/01_home.yaml b/dashboards/views/01_home.yaml index ff94641..8945552 100644 --- a/dashboards/views/01_home.yaml +++ b/dashboards/views/01_home.yaml @@ -206,7 +206,7 @@ cards: red: 4.5 - type: tile - entity: input_datetime.dishwasher_next_start + entity: sensor.dishwasher_next_start_compact name: Næste opvask # 🧹 Støvsuger (forenklet – mindre støj) diff --git a/include/templates/dishwasher.yaml b/include/templates/dishwasher.yaml new file mode 100644 index 0000000..466edf2 --- /dev/null +++ b/include/templates/dishwasher.yaml @@ -0,0 +1,18 @@ +sensor: + - name: "Dishwasher Next Start Compact" + unique_id: dishwasher_next_start_compact + state: > + {% set raw = states('input_datetime.dishwasher_next_start') %} + {% if raw in ['unknown', 'unavailable', '', none] %} + Ikke planlagt + {% else %} + {% set dt = as_datetime(raw) %} + {% if dt.date() == now().date() %} + I dag {{ dt.strftime('%H:%M') }} + {% elif dt.date() == (now() + timedelta(days=1)).date() %} + I morgen {{ dt.strftime('%H:%M') }} + {% else %} + {% set weekdays = ['man', 'tir', 'ons', 'tor', 'fre', 'lør', 'søn'] %} + {{ weekdays[dt.weekday()] }} {{ dt.strftime('%H:%M') }} + {% endif %} + {% endif %} \ No newline at end of file