Syg-status: sluk alarmer+motion lys, kompakt person view

This commit is contained in:
2026-04-24 19:03:13 +02:00
parent 9f1dd20f06
commit df734d9259
6 changed files with 220 additions and 24 deletions
+60 -24
View File
@@ -2,42 +2,77 @@ title: Person Status
path: person-status
icon: mdi:account-group
type: sections
max_columns: 1 # én kolonne for fuld bredde
max_columns: 1
sections:
# 👨‍👩‍👧‍👦 Personer (2x2 grid)
# 👨‍👩‍👧‍👦 Personer kompakt 2x2 grid
- type: grid
columns: 2
square: false
cards:
- type: entities
title: Daniel
entities:
- entity: person.daniel_schusler_dethlefsen
- entity: input_select.daniel_status
- type: vertical-stack
cards:
- type: custom:mushroom-person-card
entity: person.andreas_schusler_dethlefsen
name: Andreas
secondary_info: last_changed
layout: horizontal
tap_action:
action: more-info
- type: custom:mushroom-select-card
entity: input_select.andreas_status
icon: mdi:account-heart
icon_color: >
{% if is_state('input_select.andreas_status', 'Syg') %}red{% else %}green{% endif %}
- type: entities
title: Claus
entities:
- entity: person.claus_dethlefsen
- entity: input_select.claus_status
- type: vertical-stack
cards:
- type: custom:mushroom-person-card
entity: person.daniel_schusler_dethlefsen
name: Daniel
secondary_info: last_changed
layout: horizontal
tap_action:
action: more-info
- type: custom:mushroom-select-card
entity: input_select.daniel_status
icon: mdi:account-heart
icon_color: >
{% if is_state('input_select.daniel_status', 'Syg') %}red{% else %}green{% endif %}
- type: entities
title: Anne
entities:
- entity: person.anne_schusler_dethlefsen
- entity: input_select.anne_status
- type: vertical-stack
cards:
- type: custom:mushroom-person-card
entity: person.anne_schusler_dethlefsen
name: Anne
secondary_info: last_changed
layout: horizontal
tap_action:
action: more-info
- type: custom:mushroom-select-card
entity: input_select.anne_status
icon: mdi:account-heart
icon_color: >
{% if is_state('input_select.anne_status', 'Syg') %}red{% else %}green{% endif %}
- type: entities
title: Andreas
entities:
- entity: person.andreas_schusler_dethlefsen
- entity: input_select.andreas_status
- type: vertical-stack
cards:
- type: custom:mushroom-person-card
entity: person.claus_dethlefsen
name: Claus
secondary_info: last_changed
layout: horizontal
tap_action:
action: more-info
- type: custom:mushroom-select-card
entity: input_select.claus_status
icon: mdi:account-heart
icon_color: >
{% if is_state('input_select.claus_status', 'Syg') %}red{% else %}green{% endif %}
# 🗺️ Popup kort nederst
# 🗺️ Popup kort
- type: grid
cards:
- type: custom:button-card
@@ -77,3 +112,4 @@ sections:
name: Anne
- entity: device_tracker.claus_iphone_15pro
name: Claus
+24
View File
@@ -7,6 +7,10 @@
- condition: state
entity_id: binary_sensor.arbejdsdagimorgen
state: 'on'
- condition: template
value_template: >-
{{ not is_state('input_select.anne_status', 'Syg') and
not is_state('input_select.claus_status', 'Syg') }}
action:
- service: homeassistant.turn_on
entity_id: switch.sonos_alarm_1782
@@ -31,6 +35,8 @@
- condition: state
entity_id: binary_sensor.arbejdsdagimorgen
state: 'on'
- condition: template
value_template: "{{ not is_state('input_select.andreas_status', 'Syg') }}"
action:
- service: homeassistant.turn_on
entity_id: switch.sonos_alarm_445
@@ -58,6 +64,8 @@
value_template: '{{ now().date() | string != "2022-12-24" }}'
- condition: template
value_template: '{{ now().date() | string != "2022-12-31" }}'
- condition: template
value_template: "{{ not is_state('input_select.andreas_status', 'Syg') }}"
action:
- service: homeassistant.turn_on
entity_id: switch.sonos_alarm_1874
@@ -78,6 +86,8 @@
- condition: state
entity_id: binary_sensor.arbejdsdagimorgen
state: 'on'
- condition: template
value_template: "{{ not is_state('input_select.daniel_status', 'Syg') }}"
action:
- service: homeassistant.turn_on
entity_id: switch.sonos_alarm_377
@@ -103,6 +113,8 @@
- condition: state
entity_id: binary_sensor.arbejdsdagimorgen
state: 'on'
- condition: template
value_template: "{{ not is_state('input_select.daniel_status', 'Syg') }}"
action:
- service: homeassistant.turn_on
entity_id: switch.sonos_alarm_1894
@@ -128,6 +140,8 @@
- condition: state
entity_id: binary_sensor.arbejdsdagimorgen
state: 'on'
- condition: template
value_template: "{{ not is_state('input_select.daniel_status', 'Syg') }}"
action:
- service: homeassistant.turn_on
entity_id: switch.sonos_alarm_2273
@@ -155,6 +169,8 @@
value_template: '{{ now().date() | string != "2022-12-24" }}'
- condition: template
value_template: '{{ now().date() | string != "2022-12-31" }}'
- condition: template
value_template: "{{ not is_state('input_select.daniel_status', 'Syg') }}"
action:
- service: homeassistant.turn_on
entity_id: switch.sonos_alarm_3471
@@ -177,6 +193,10 @@
- condition: state
entity_id: binary_sensor.arbejdsdagimorgen
state: 'on'
- condition: template
value_template: >-
{{ not is_state('input_select.anne_status', 'Syg') and
not is_state('input_select.claus_status', 'Syg') }}
action:
- service: homeassistant.turn_on
entity_id: switch.sonos_alarm_298
@@ -202,6 +222,10 @@
- condition: state
entity_id: binary_sensor.arbejdsdagimorgen
state: 'on'
- condition: template
value_template: >-
{{ not is_state('input_select.anne_status', 'Syg') and
not is_state('input_select.claus_status', 'Syg') }}
action:
- service: homeassistant.turn_on
entity_id: switch.sonos_alarm_1899
+4
View File
@@ -40,6 +40,10 @@
{{ 1000 <= t <= 2030 }}
{% endif %}
# Ikke syg
- condition: template
value_template: "{{ not is_state('input_select.andreas_status', 'Syg') }}"
sequence:
- service: light.turn_on
+4
View File
@@ -25,6 +25,8 @@
- condition: time
after: '06:30:00'
before: '19:30:00'
- condition: template
value_template: "{{ not is_state('input_select.daniel_status', 'Syg') }}"
action:
- service: homeassistant.turn_on
target:
@@ -47,6 +49,8 @@
- condition: time
after: '10:00:00'
before: '19:45:00'
- condition: template
value_template: "{{ not is_state('input_select.daniel_status', 'Syg') }}"
action:
- service: homeassistant.turn_on
target:
@@ -25,6 +25,10 @@
- condition: time
after: '06:30:00'
before: '20:00:00'
- condition: template
value_template: >-
{{ not is_state('input_select.anne_status', 'Syg') and
not is_state('input_select.claus_status', 'Syg') }}
action:
- service: homeassistant.turn_on
target:
@@ -47,6 +51,10 @@
- condition: time
after: '10:00:00'
before: '20:00:00'
- condition: template
value_template: >-
{{ not is_state('input_select.anne_status', 'Syg') and
not is_state('input_select.claus_status', 'Syg') }}
action:
- service: homeassistant.turn_on
target:
+120
View File
@@ -0,0 +1,120 @@
##################################################
# Syg-status: sluk alarmer + motion-lys ved sygdom
#
# Triggeres af input_select.PERSON_status → "Syg"
# Genaktiverer alarmer når status ikke længere er "Syg"
# Motion-lys håndteres via conditions i lys_*.yaml
##################################################
# ---- Andreas ----
- alias: "Syg - Andreas - sluk alarmer"
id: syg_andreas_sluk_alarmer
trigger:
- platform: state
entity_id: input_select.andreas_status
to: "Syg"
action:
- service: homeassistant.turn_off
target:
entity_id:
- switch.sonos_alarm_445 # Andreas hverdagsalarm
- switch.sonos_alarm_1874 # Andreas lørdag
- alias: "Syg - Andreas - genaktiver alarmer"
id: syg_andreas_genaktiver_alarmer
trigger:
- platform: state
entity_id: input_select.andreas_status
not_to: "Syg"
condition:
- condition: state
entity_id: binary_sensor.arbejdsdagimorgen
state: "on"
action:
- service: homeassistant.turn_on
target:
entity_id:
- switch.sonos_alarm_445
- switch.sonos_alarm_1874
# ---- Daniel ----
- alias: "Syg - Daniel - sluk alarmer"
id: syg_daniel_sluk_alarmer
trigger:
- platform: state
entity_id: input_select.daniel_status
to: "Syg"
action:
- service: homeassistant.turn_off
target:
entity_id:
- switch.sonos_alarm_377 # Daniel hverdagsalarm
- switch.sonos_alarm_1894 # Daniel afsted
- switch.sonos_alarm_2273 # Daniel man/fre
- switch.sonos_alarm_3471 # Daniel lørdag
- alias: "Syg - Daniel - genaktiver alarmer"
id: syg_daniel_genaktiver_alarmer
trigger:
- platform: state
entity_id: input_select.daniel_status
not_to: "Syg"
condition:
- condition: state
entity_id: binary_sensor.arbejdsdagimorgen
state: "on"
action:
- service: homeassistant.turn_on
target:
entity_id:
- switch.sonos_alarm_377
- switch.sonos_alarm_1894
- switch.sonos_alarm_2273
- switch.sonos_alarm_3471
# ---- Anne / Claus (soveværelse) ----
- alias: "Syg - Soveværelse - sluk alarmer"
id: syg_sovevaerelse_sluk_alarmer
trigger:
- platform: state
entity_id: input_select.anne_status
to: "Syg"
- platform: state
entity_id: input_select.claus_status
to: "Syg"
action:
- service: homeassistant.turn_off
target:
entity_id:
- switch.sonos_alarm_1782 # Soft wakeup
- switch.sonos_alarm_298 # Badeværelse
- switch.sonos_alarm_1899 # Badeværelse afsted
- alias: "Syg - Soveværelse - genaktiver alarmer"
id: syg_sovevaerelse_genaktiver_alarmer
trigger:
- platform: state
entity_id: input_select.anne_status
not_to: "Syg"
- platform: state
entity_id: input_select.claus_status
not_to: "Syg"
condition:
# Kun genaktiver hvis BEGGE ikke er syge
- condition: template
value_template: >
{{ not is_state('input_select.anne_status', 'Syg') and
not is_state('input_select.claus_status', 'Syg') }}
- condition: state
entity_id: binary_sensor.arbejdsdagimorgen
state: "on"
action:
- service: homeassistant.turn_on
target:
entity_id:
- switch.sonos_alarm_1782
- switch.sonos_alarm_298
- switch.sonos_alarm_1899