From f5b49149e98479f46082c01baa5db2b8b6840aec Mon Sep 17 00:00:00 2001 From: mike Date: Fri, 20 Oct 2023 23:51:25 -0700 Subject: [PATCH] Switch senes to parallel to avoid lag, probably --- motion-activated-light.yaml | 60 ++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/motion-activated-light.yaml b/motion-activated-light.yaml index f913f59..8819a23 100644 --- a/motion-activated-light.yaml +++ b/motion-activated-light.yaml @@ -137,16 +137,11 @@ action: name: "Motion On" message: "Motion was detected." - - alias: "Activate the ON scene" - service: scene.turn_on - target: - entity_id: !input scene_on - - delay: - seconds: 1 - - alias: "Activate the ON scene again, after a delay (to help laggy setups)" - service: scene.turn_on - target: - entity_id: !input scene_on + - parallel: + - alias: "Activate the ON scene" + service: scene.turn_on + target: + entity_id: !input scene_on # Take actions based on Motion being undetected @@ -181,10 +176,11 @@ action: data: name: "Begin notice period" message: "Begin notice period; Waiting while motion is still off." - - alias: "Activate Scene: Off Prep 1 (Notice)" - service: scene.turn_on - target: - entity_id: !input scene_off_prep_1 + - parallel: + - alias: "Activate Scene: Off Prep 1 (Notice)" + service: scene.turn_on + target: + entity_id: !input scene_off_prep_1 - alias: "Delay during the notice period" wait_template: "{{ states[motion_sensor].state == 'on' }}" timeout: "{{ notice_seconds }}" @@ -193,10 +189,11 @@ action: entity_id: !input motion_sensor state: "on" then: - - alias: "Activate Scene: On" - service: scene.turn_on - target: - entity_id: !input scene_on + - parallel: + - alias: "Activate Scene: On" + service: scene.turn_on + target: + entity_id: !input scene_on - alias: "Double countdown timer when user interrupts the notice period." service: input_number.set_value data: @@ -213,10 +210,11 @@ action: data: name: "Begin warning period" message: "Begin warning period; Waiting while motion is still off." - - alias: "Activate Scene: Off Prep 2 (Warning)" - service: scene.turn_on - target: - entity_id: !input scene_off_prep_2 + - parallel: + - alias: "Activate Scene: Off Prep 2 (Warning)" + service: scene.turn_on + target: + entity_id: !input scene_off_prep_2 - alias: "Delay during the warning period" wait_template: "{{ states[motion_sensor].state == 'on' }}" timeout: "{{ warning_seconds }}" @@ -225,10 +223,11 @@ action: entity_id: !input motion_sensor state: "on" then: - - alias: "Activate Scene: On" - service: scene.turn_on - target: - entity_id: !input scene_on + - parallel: + - alias: "Activate Scene: On" + service: scene.turn_on + target: + entity_id: !input scene_on - alias: "Double countdown timer when user interrupts the warning period." service: input_number.set_value data: @@ -241,10 +240,11 @@ action: message: "Warning period has finished and motion is still off." - - alias: "Activate Scene: Off (Done)" - service: scene.turn_on - target: - entity_id: !input scene_off + - parallel: + - alias: "Activate Scene: Off (Done)" + service: scene.turn_on + target: + entity_id: !input scene_off - alias: "Reset countdown timer after turning off lights." service: input_number.set_value