Syg-status: sluk alarmer+motion lys, kompakt person view
This commit is contained in:
@@ -2,42 +2,77 @@ title: Person Status
|
|||||||
path: person-status
|
path: person-status
|
||||||
icon: mdi:account-group
|
icon: mdi:account-group
|
||||||
type: sections
|
type: sections
|
||||||
max_columns: 1 # én kolonne for fuld bredde
|
max_columns: 1
|
||||||
|
|
||||||
sections:
|
sections:
|
||||||
|
|
||||||
# 👨👩👧👦 Personer (2x2 grid)
|
# 👨👩👧👦 Personer – kompakt 2x2 grid
|
||||||
- type: grid
|
- type: grid
|
||||||
columns: 2
|
columns: 2
|
||||||
square: false
|
square: false
|
||||||
cards:
|
cards:
|
||||||
|
|
||||||
- type: entities
|
- type: vertical-stack
|
||||||
title: Daniel
|
cards:
|
||||||
entities:
|
- type: custom:mushroom-person-card
|
||||||
- entity: person.daniel_schusler_dethlefsen
|
entity: person.andreas_schusler_dethlefsen
|
||||||
- entity: input_select.daniel_status
|
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
|
- type: vertical-stack
|
||||||
title: Claus
|
cards:
|
||||||
entities:
|
- type: custom:mushroom-person-card
|
||||||
- entity: person.claus_dethlefsen
|
entity: person.daniel_schusler_dethlefsen
|
||||||
- entity: input_select.claus_status
|
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
|
- type: vertical-stack
|
||||||
title: Anne
|
cards:
|
||||||
entities:
|
- type: custom:mushroom-person-card
|
||||||
- entity: person.anne_schusler_dethlefsen
|
entity: person.anne_schusler_dethlefsen
|
||||||
- entity: input_select.anne_status
|
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
|
- type: vertical-stack
|
||||||
title: Andreas
|
cards:
|
||||||
entities:
|
- type: custom:mushroom-person-card
|
||||||
- entity: person.andreas_schusler_dethlefsen
|
entity: person.claus_dethlefsen
|
||||||
- entity: input_select.andreas_status
|
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
|
||||||
# 🗺️ Popup kort nederst
|
|
||||||
- type: grid
|
- type: grid
|
||||||
cards:
|
cards:
|
||||||
- type: custom:button-card
|
- type: custom:button-card
|
||||||
@@ -77,3 +112,4 @@ sections:
|
|||||||
name: Anne
|
name: Anne
|
||||||
- entity: device_tracker.claus_iphone_15pro
|
- entity: device_tracker.claus_iphone_15pro
|
||||||
name: Claus
|
name: Claus
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,10 @@
|
|||||||
- condition: state
|
- condition: state
|
||||||
entity_id: binary_sensor.arbejdsdagimorgen
|
entity_id: binary_sensor.arbejdsdagimorgen
|
||||||
state: 'on'
|
state: 'on'
|
||||||
|
- condition: template
|
||||||
|
value_template: >-
|
||||||
|
{{ not is_state('input_select.anne_status', 'Syg') and
|
||||||
|
not is_state('input_select.claus_status', 'Syg') }}
|
||||||
action:
|
action:
|
||||||
- service: homeassistant.turn_on
|
- service: homeassistant.turn_on
|
||||||
entity_id: switch.sonos_alarm_1782
|
entity_id: switch.sonos_alarm_1782
|
||||||
@@ -31,6 +35,8 @@
|
|||||||
- condition: state
|
- condition: state
|
||||||
entity_id: binary_sensor.arbejdsdagimorgen
|
entity_id: binary_sensor.arbejdsdagimorgen
|
||||||
state: 'on'
|
state: 'on'
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ not is_state('input_select.andreas_status', 'Syg') }}"
|
||||||
action:
|
action:
|
||||||
- service: homeassistant.turn_on
|
- service: homeassistant.turn_on
|
||||||
entity_id: switch.sonos_alarm_445
|
entity_id: switch.sonos_alarm_445
|
||||||
@@ -58,6 +64,8 @@
|
|||||||
value_template: '{{ now().date() | string != "2022-12-24" }}'
|
value_template: '{{ now().date() | string != "2022-12-24" }}'
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: '{{ now().date() | string != "2022-12-31" }}'
|
value_template: '{{ now().date() | string != "2022-12-31" }}'
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ not is_state('input_select.andreas_status', 'Syg') }}"
|
||||||
action:
|
action:
|
||||||
- service: homeassistant.turn_on
|
- service: homeassistant.turn_on
|
||||||
entity_id: switch.sonos_alarm_1874
|
entity_id: switch.sonos_alarm_1874
|
||||||
@@ -78,6 +86,8 @@
|
|||||||
- condition: state
|
- condition: state
|
||||||
entity_id: binary_sensor.arbejdsdagimorgen
|
entity_id: binary_sensor.arbejdsdagimorgen
|
||||||
state: 'on'
|
state: 'on'
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ not is_state('input_select.daniel_status', 'Syg') }}"
|
||||||
action:
|
action:
|
||||||
- service: homeassistant.turn_on
|
- service: homeassistant.turn_on
|
||||||
entity_id: switch.sonos_alarm_377
|
entity_id: switch.sonos_alarm_377
|
||||||
@@ -103,6 +113,8 @@
|
|||||||
- condition: state
|
- condition: state
|
||||||
entity_id: binary_sensor.arbejdsdagimorgen
|
entity_id: binary_sensor.arbejdsdagimorgen
|
||||||
state: 'on'
|
state: 'on'
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ not is_state('input_select.daniel_status', 'Syg') }}"
|
||||||
action:
|
action:
|
||||||
- service: homeassistant.turn_on
|
- service: homeassistant.turn_on
|
||||||
entity_id: switch.sonos_alarm_1894
|
entity_id: switch.sonos_alarm_1894
|
||||||
@@ -128,6 +140,8 @@
|
|||||||
- condition: state
|
- condition: state
|
||||||
entity_id: binary_sensor.arbejdsdagimorgen
|
entity_id: binary_sensor.arbejdsdagimorgen
|
||||||
state: 'on'
|
state: 'on'
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ not is_state('input_select.daniel_status', 'Syg') }}"
|
||||||
action:
|
action:
|
||||||
- service: homeassistant.turn_on
|
- service: homeassistant.turn_on
|
||||||
entity_id: switch.sonos_alarm_2273
|
entity_id: switch.sonos_alarm_2273
|
||||||
@@ -155,6 +169,8 @@
|
|||||||
value_template: '{{ now().date() | string != "2022-12-24" }}'
|
value_template: '{{ now().date() | string != "2022-12-24" }}'
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: '{{ now().date() | string != "2022-12-31" }}'
|
value_template: '{{ now().date() | string != "2022-12-31" }}'
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ not is_state('input_select.daniel_status', 'Syg') }}"
|
||||||
action:
|
action:
|
||||||
- service: homeassistant.turn_on
|
- service: homeassistant.turn_on
|
||||||
entity_id: switch.sonos_alarm_3471
|
entity_id: switch.sonos_alarm_3471
|
||||||
@@ -177,6 +193,10 @@
|
|||||||
- condition: state
|
- condition: state
|
||||||
entity_id: binary_sensor.arbejdsdagimorgen
|
entity_id: binary_sensor.arbejdsdagimorgen
|
||||||
state: 'on'
|
state: 'on'
|
||||||
|
- condition: template
|
||||||
|
value_template: >-
|
||||||
|
{{ not is_state('input_select.anne_status', 'Syg') and
|
||||||
|
not is_state('input_select.claus_status', 'Syg') }}
|
||||||
action:
|
action:
|
||||||
- service: homeassistant.turn_on
|
- service: homeassistant.turn_on
|
||||||
entity_id: switch.sonos_alarm_298
|
entity_id: switch.sonos_alarm_298
|
||||||
@@ -202,6 +222,10 @@
|
|||||||
- condition: state
|
- condition: state
|
||||||
entity_id: binary_sensor.arbejdsdagimorgen
|
entity_id: binary_sensor.arbejdsdagimorgen
|
||||||
state: 'on'
|
state: 'on'
|
||||||
|
- condition: template
|
||||||
|
value_template: >-
|
||||||
|
{{ not is_state('input_select.anne_status', 'Syg') and
|
||||||
|
not is_state('input_select.claus_status', 'Syg') }}
|
||||||
action:
|
action:
|
||||||
- service: homeassistant.turn_on
|
- service: homeassistant.turn_on
|
||||||
entity_id: switch.sonos_alarm_1899
|
entity_id: switch.sonos_alarm_1899
|
||||||
|
|||||||
@@ -40,6 +40,10 @@
|
|||||||
{{ 1000 <= t <= 2030 }}
|
{{ 1000 <= t <= 2030 }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
# Ikke syg
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ not is_state('input_select.andreas_status', 'Syg') }}"
|
||||||
|
|
||||||
sequence:
|
sequence:
|
||||||
|
|
||||||
- service: light.turn_on
|
- service: light.turn_on
|
||||||
|
|||||||
@@ -25,6 +25,8 @@
|
|||||||
- condition: time
|
- condition: time
|
||||||
after: '06:30:00'
|
after: '06:30:00'
|
||||||
before: '19:30:00'
|
before: '19:30:00'
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ not is_state('input_select.daniel_status', 'Syg') }}"
|
||||||
action:
|
action:
|
||||||
- service: homeassistant.turn_on
|
- service: homeassistant.turn_on
|
||||||
target:
|
target:
|
||||||
@@ -47,6 +49,8 @@
|
|||||||
- condition: time
|
- condition: time
|
||||||
after: '10:00:00'
|
after: '10:00:00'
|
||||||
before: '19:45:00'
|
before: '19:45:00'
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ not is_state('input_select.daniel_status', 'Syg') }}"
|
||||||
action:
|
action:
|
||||||
- service: homeassistant.turn_on
|
- service: homeassistant.turn_on
|
||||||
target:
|
target:
|
||||||
|
|||||||
@@ -25,6 +25,10 @@
|
|||||||
- condition: time
|
- condition: time
|
||||||
after: '06:30:00'
|
after: '06:30:00'
|
||||||
before: '20: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:
|
action:
|
||||||
- service: homeassistant.turn_on
|
- service: homeassistant.turn_on
|
||||||
target:
|
target:
|
||||||
@@ -47,6 +51,10 @@
|
|||||||
- condition: time
|
- condition: time
|
||||||
after: '10:00:00'
|
after: '10:00:00'
|
||||||
before: '20: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:
|
action:
|
||||||
- service: homeassistant.turn_on
|
- service: homeassistant.turn_on
|
||||||
target:
|
target:
|
||||||
|
|||||||
@@ -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
|
||||||
Reference in New Issue
Block a user