From 746dd833c8f87a7f4f23eb52cff24e8e70691d74 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Fri, 10 Jul 2026 00:38:16 +0200 Subject: [PATCH] Add unique_ids and calendar text sensors --- template.yaml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/template.yaml b/template.yaml index c9ad129..313a591 100644 --- a/template.yaml +++ b/template.yaml @@ -139,8 +139,48 @@ attributes: last_reset: '1970-01-01T00:00:00+00:00' - name: internet_speed_out + unique_id: '9519483670667' state: > {{ (( states('sensor.wan_out_derivative') | float * 8 / 1000000 ) | round(2)) }} unit_of_measurement: 'Mbps' attributes: last_reset: '1970-01-01T00:00:00+00:00' + +# ── Kalender-Ereignisse für epaperframe ── + - text_sensor: + # ─── HEUTE (today) ─── + # Privat heute + - name: "Kalender heute Privat" + unique_id: kalender_heute_privat + state: >- + {%- if is_state('calendar.privat', 'on') %} + {{- (state_attr('calendar.privat', 'description') | default(state_attr('calendar.privat', 'message'), true)) + | replace('\n', ', ') | trim | truncate(60) -}} + {%- endif -%} + + # Arbeit heute + - name: "Kalender heute Arbeit" + unique_id: kalender_heute_arbeit + state: >- + {%- if is_state('calendar.tkrz_kalender', 'on') %} + {{- (state_attr('calendar.tkrz_kalender', 'description') | default(state_attr('calendar.tkrz_kalender', 'message'), true)) + | replace('\n', ', ') | trim | truncate(60) -}} + {%- endif -%} + + # Zeit heute (Privat) + - name: "Kalender heute Privat Uhrzeit" + unique_id: kalender_heute_privat_uhrzeit + state: >- + {%- if is_state('calendar.privat', 'on') and state_attr('calendar.privat', 'start_time') %} + {{- as_timestamp(state_attr('calendar.privat', 'start_time')) + | timestamp_custom('%H:%M', true) -}} + {%- endif -%} + + # Zeit heute (Arbeit) + - name: "Kalender heute Arbeit Uhrzeit" + unique_id: kalender_heute_arbeit_uhrzeit + state: >- + {%- if is_state('calendar.tkrz_kalender', 'on') and state_attr('calendar.tkrz_kalender', 'start_time') %} + {{- as_timestamp(state_attr('calendar.tkrz_kalender', 'start_time')) + | timestamp_custom('%H:%M', true) -}} + {%- endif -%}