From d0379f31ee125e5f3654c16699504596a7640c91 Mon Sep 17 00:00:00 2001 From: Claus Dethlefsen Date: Mon, 6 Apr 2026 19:31:13 +0200 Subject: [PATCH] Improve indoor motion alert automation --- include/automations/derernogenihuset.yaml | 68 +++++++++++------------ 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/include/automations/derernogenihuset.yaml b/include/automations/derernogenihuset.yaml index dc16d48..c7daa3c 100644 --- a/include/automations/derernogenihuset.yaml +++ b/include/automations/derernogenihuset.yaml @@ -1,42 +1,39 @@ - - alias: 'Der er nogen i huset' - trigger: - - platform: state - entity_id: binary_sensor.hue_motion_sensor_2_motion_2 - to: 'on' - - platform: state - entity_id: binary_sensor.hue_motion_sensor_2_motion - to: 'on' - - platform: state - entity_id: binary_sensor.hue_motion_sensor_1_motion_2 - to: 'on' - - platform: state - entity_id: binary_sensor.bad_motion_sensor_motion - to: 'on' - - platform: state - entity_id: binary_sensor.gang_sensor_motion - to: 'on' - - platform: state - entity_id: binary_sensor.forgang_sensor_motion - to: 'on' - condition: - - condition: state - entity_id: group.nogen_hjemme - state: 'Away' - action: - - service: notify.mobile_app_clausiphone +- alias: "Der er nogen i huset" + mode: single + trigger: + - platform: state + entity_id: binary_sensor.hue_motion_sensor_2_motion_2 + to: "on" + - platform: state + entity_id: binary_sensor.hue_motion_sensor_2_motion + to: "on" + - platform: state + entity_id: binary_sensor.hue_motion_sensor_1_motion_2 + to: "on" + - platform: state + entity_id: binary_sensor.bad_motion_sensor_motion + to: "on" + - platform: state + entity_id: binary_sensor.gang_sensor_motion + to: "on" + - platform: state + entity_id: binary_sensor.forgang_sensor_motion + to: "on" + condition: + - condition: state + entity_id: binary_sensor.family_presence + state: "off" + action: + - service: notify.mobile_app_clausiphone15 data: - message: "Der er nogen i huset" -# - service: script.sonos_say -# data: -# sonos_entity: media_player.alrum -# volume: 0.4 -# delay: '00:00:05' -# message: 'Der er nogen i indkørslen' + message: >- + Der er nogen i huset. + Bevægelse registreret af {{ trigger.to_state.name or trigger.entity_id }}. - service: scene.create data: scene_id: before snapshot_entities: - - light.pendle1 + - light.pendle1 - service: light.turn_on data: entity_id: light.pendle1 @@ -45,7 +42,8 @@ flash: long - delay: 2 - service: scene.turn_on - entity_id: scene.before + target: + entity_id: scene.before