Hier wurden die Zustände mit 2 Sensoren pro Fenster kombiniert. Ggf. bekommst Du eine Idee.
sensor:
- platform: template
sensors:
fenster_gaeste:
friendly_name: "Fenster Gäste neu2"
value_template: >
{% set b1 = is_state('binary_sensor.gaste_wc_komplett','on') %}
{% set b2 = is_state('binary_sensor.gaste_wc_kipp','on') %}
{% if not b1 and not b2 %}geschlossen
{% elif not b1 and b2 %}gekippt
{% elif b1 and b2 %}offen
{% else %}?
{% endif %}
icon_template: >
{% set b1 = is_state('binary_sensor.gaste_wc_komplett','on') %}
{% set b2 = is_state('binary_sensor.gaste_wc_kipp','on') %}
{% if not b1 and not b2 %}mdi:window-closed-variant
{% elif not b1 and b2 %}mdi:angle-acute
{% elif b1 and b2 %}mdi:window-open-variant
{% else %}mdi:help-circle-outline
{% endif %}
availability_template: >
{{ states('binary_sensor.gaste_wc_komplett') in ['on','off']
and states('binary_sensor.gaste_wc_kipp') in ['on','off'] }}
Obiger Code ist ChatGPT 5 generiert und sieht für mich brauchbar aus. Versuche es einmal.
Dennoch tag: “KI ungeprüft”
EDIT:
Obwohl ich auch Fan der custom:button-card bin finde ich als Einstieg die
custom:mushroom-template-card besser. Auch hier kannst Du per Jinja Icon und Icon Farbe Status abhängig machen und auch “geschlossen” etc. setzen.
Was mir am eigenen KI Beispiel nicht gefällt auf den 2. Blick ist die alte Sensor Schreibweise.
template:
- sensor:
- name: "xyz etc"
wäre robuster für die Zukunft. KI habe ich an Deinem Beispiel prüfen lassen und so hat es übernommen. Und wenn ich mir Deine Variablen etc. anschaue, denke ich Du hast obigen Verweis selbst gefunden und abgeändert.
Na ich bin gespannt, was Du daraus machen wirst.