Refine Roborock home dashboard row

This commit is contained in:
2026-04-07 17:42:26 +02:00
parent 77704d5177
commit 463d24bddd
2 changed files with 54 additions and 7 deletions
+20
View File
@@ -0,0 +1,20 @@
- sensor:
- name: "Roborock Last Clean End Compact"
unique_id: roborock_last_clean_end_compact
state: >
{% set raw = states('sensor.roborock_s8_pro_ultra_last_clean_end') %}
{% if raw in ['unknown', 'unavailable', '', none] %}
Ukendt
{% else %}
{% set dt = as_datetime(raw) %}
{% if dt is none %}
Ukendt
{% elif 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 %}