Hi all, I have taken the delivered Motion Activated Light. blueprint and modified slightly for my needs but having a bit of an issue still. My need was to trigger scenes instead of a specific light entity or device. That part all works. The part I am struggling with is that I have a variable to see if a certain light in that room is already on to skip running altogether. I thought I had it all working, but have found that it still triggers the off scene after the timer expires. What am I not setting properly to have it skip altogether if the light is on?
blueprint:
name: Motion-activated Light - All Day
description: Turn on a light when motion is detected.
domain: automation
author: Home Assistant
input:
motion_entity:
name: Motion Sensor
selector:
entity:
domain: binary_sensor
device_class: motion
scene_on_target:
name: Scene On
selector:
target:
entity:
domain: scene
scene_off_target:
name: Scene Off
selector:
target:
entity:
domain: scene
no_motion_wait:
name: Wait time
description: Time to leave the light on after last motion is detected.
default: 120
selector:
number:
min: 0
max: 3600
unit_of_measurement: seconds
light_to_ignore:
name: Light Check
description: Choose a light that if it is on, do not activate scene
default:
selector:
entity:
filter:
- domain: light
# If motion is detected within the delay,
# we restart the script.
mode: restart
max_exceeded: silent
trigger:
platform: state
entity_id: !input motion_entity
from: "off"
to: "on"
condition:
- condition: state
entity_id: !input light_to_ignore
state: "off"
action:
- alias: "Activate On Scene"
service: scene.turn_on
target: !input scene_on_target
- alias: "Wait until there is no motion from device"
wait_for_trigger:
platform: state
entity_id: !input motion_entity
from: "on"
to: "off"
- alias: "Wait the number of seconds that has been set"
delay: !input no_motion_wait
- alias: "Activate Off Scene"
service: scene.turn_on
target: !input scene_off_target