From 467fcd30e3521ac1ddb0c2c7e6d68109f56a27dc Mon Sep 17 00:00:00 2001 From: mike Date: Wed, 27 Dec 2023 20:59:20 -0800 Subject: [PATCH] Removing parallel scenes because they didn't help anything --- mikes-motion-activated-scenes.yaml | 112 ++++++++++++++--------------- 1 file changed, 55 insertions(+), 57 deletions(-) diff --git a/mikes-motion-activated-scenes.yaml b/mikes-motion-activated-scenes.yaml index 64a98ee..be21537 100644 --- a/mikes-motion-activated-scenes.yaml +++ b/mikes-motion-activated-scenes.yaml @@ -314,7 +314,7 @@ action: name: "Debug: Disabled scene" message: "Disabled scene is currently set to: {{ disabled_scene }}" - + # In "auto" mode, activate the ON or OFF scene based on whether motion is currently detected # Also use "auto" mode if motion activation is ENABLED. - alias: "auto mode: Activate ON scene, if motion is currently detected, otherwise activate the OFF scene" @@ -327,17 +327,15 @@ action: entity_id: !input motion_sensor state: "on" then: - - parallel: - - alias: "Activate the ON scene" - service: scene.turn_on - target: - entity_id: !input scene_on + - alias: "Activate the ON scene" + service: scene.turn_on + target: + entity_id: !input scene_on else: - - parallel: - - alias: "Activate the OFF scene" - service: scene.turn_on - target: - entity_id: !input scene_off + - alias: "Activate the OFF scene" + service: scene.turn_on + target: + entity_id: !input scene_off - stop: "" # In ON mode, just activate the ON scene @@ -346,10 +344,9 @@ action: - condition: template value_template: "{{ disabled_scene == 'on' }}" then: - - parallel: - - service: scene.turn_on - target: - entity_id: !input scene_on + - service: scene.turn_on + target: + entity_id: !input scene_on - stop: "" # In OFF mode, just activate the OF scene @@ -358,10 +355,9 @@ action: - condition: template value_template: "{{ disabled_scene == 'off' }}" then: - - parallel: - - service: scene.turn_on - target: - entity_id: !input scene_off + - service: scene.turn_on + target: + entity_id: !input scene_off - stop: "" # In notice mode, just activate the NOTICE scene @@ -370,10 +366,9 @@ action: - condition: template value_template: "{{ disabled_scene == 'notice' }}" then: - - parallel: - - service: scene.turn_on - target: - entity_id: !input scene_notice + - service: scene.turn_on + target: + entity_id: !input scene_notice - stop: "" # In warning mode, just activate the WARNING scene @@ -382,10 +377,9 @@ action: - condition: template value_template: "{{ disabled_scene == 'warning' }}" then: - - parallel: - - service: scene.turn_on - target: - entity_id: !input scene_warning + - service: scene.turn_on + target: + entity_id: !input scene_warning - stop: "" # Don't do anything after processing the enabled_helper triggers @@ -423,11 +417,10 @@ action: name: "Motion On" message: "Motion was detected." - - parallel: - - alias: "Activate the ON scene" - service: scene.turn_on - target: - entity_id: !input scene_on + - alias: "Activate the ON scene" + service: scene.turn_on + target: + entity_id: !input scene_on # Motion is not detected @@ -486,11 +479,12 @@ action: data: name: "Begin notice period" message: "Begin notice period; Waiting while motion is still off." - - parallel: - - alias: "Activate Scene: Notice" - service: scene.turn_on - target: - entity_id: !input scene_notice + + - alias: "Activate Scene: Notice" + service: scene.turn_on + target: + entity_id: !input scene_notice + - alias: "Delay during the notice period" wait_template: "{{ states[motion_sensor].state == 'on' or (enabled_helper != None and is_state('enabled_helper', 'off') ) }}" timeout: "{{ notice_seconds }}" @@ -510,11 +504,12 @@ action: entity_id: !input motion_sensor state: "on" then: - - parallel: - - alias: "Activate Scene: On" - service: scene.turn_on - target: - entity_id: !input scene_on + + - alias: "Activate Scene: On" + service: scene.turn_on + target: + entity_id: !input scene_on + - alias: "Increase countdown timer when user interrupts the notice period." service: input_number.set_value data: @@ -567,11 +562,12 @@ action: data: name: "Begin warning period" message: "Begin warning period; Waiting while motion is still off." - - parallel: - - alias: "Activate Scene: Warning" - service: scene.turn_on - target: - entity_id: !input scene_warning + + - alias: "Activate Scene: Warning" + service: scene.turn_on + target: + entity_id: !input scene_warning + - alias: "Delay during the warning period" wait_template: "{{ states[motion_sensor].state == 'on' or (enabled_helper != None and is_state('enabled_helper', 'off') ) }}" timeout: "{{ warning_seconds }}" @@ -593,16 +589,18 @@ action: entity_id: !input motion_sensor state: "on" then: - - parallel: - - alias: "Activate Scene: On" - service: scene.turn_on - target: - entity_id: !input scene_on + + - 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: entity_id: !input delay_seconds_helper value: "{{ states[delay_seconds_helper].state | int * delay_seconds_multiplier }}" + - alias: "Limit delay seconds to its defined maximum" if: - condition: template @@ -620,6 +618,7 @@ action: data: name: "Limiting delay seconds" message: "Delay limited to max: {{ states[delay_seconds_helper].state }}" + - alias: "Log new delay seconds" if: - condition: template @@ -672,11 +671,10 @@ action: name: "Won't run on-before-off" message: "Won't run on-before-off because seconds was less than 1" - - parallel: - - alias: "Activate Scene: Off (Done)" - service: scene.turn_on - target: - entity_id: !input scene_off + - 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