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
+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