Update Motion sensor

This commit is contained in:
2025-12-16 21:14:59 +01:00
parent 674f2a329e
commit 879d72dfe5

View File

@@ -4,6 +4,7 @@ blueprint:
domain: automation domain: automation
author: Philipp Klüter author: Philipp Klüter
source_url: https://git.klueter.dev/ThronRycer/HomeAssistant/raw/branch/main/blueprints/lights/motion-activated-with-lux-sensor.yml source_url: https://git.klueter.dev/ThronRycer/HomeAssistant/raw/branch/main/blueprints/lights/motion-activated-with-lux-sensor.yml
input: input:
motion_entity: motion_entity:
name: Motion Sensor name: Motion Sensor
@@ -14,21 +15,24 @@ blueprint:
device_class: device_class:
- motion - motion
- occupancy - occupancy
light_target: light_target:
name: Light name: Light
selector: selector:
target: target:
entity: entity:
domain: light domain: light
disabled_when_on: disabled_when_on:
name: Disabled when on name: Disabled when on
description: "The motion activation is disabled when one of these lights is on." description: The motion activation is disabled when one of these lights is on.
selector: selector:
entity: entity:
filter: filter:
domain: light domain: light
multiple: true multiple: true
default: [] default: []
no_motion_wait: no_motion_wait:
name: Wait time name: Wait time
description: Time to leave the light on after last motion is detected. description: Time to leave the light on after last motion is detected.
@@ -38,6 +42,7 @@ blueprint:
min: 0 min: 0
max: 3600 max: 3600
unit_of_measurement: seconds unit_of_measurement: seconds
lux_entity: lux_entity:
name: Illuminance Sensor name: Illuminance Sensor
selector: selector:
@@ -45,9 +50,9 @@ blueprint:
filter: filter:
domain: sensor domain: sensor
device_class: illuminance device_class: illuminance
lux_threshold: lux_threshold:
name: Illuminance threshold name: Illuminance threshold
description: Threshold for lux.
default: 5 default: 5
selector: selector:
number: number:
@@ -55,37 +60,37 @@ blueprint:
max: 200 max: 200
unit_of_measurement: lux unit_of_measurement: lux
# If new motion is detected, we mode: restart
# we restart the script.
mode: single
max_exceeded: silent max_exceeded: silent
triggers: triggers:
- trigger: state - trigger: state
entity_id: !input motion_entity entity_id: !input motion_entity
from: "off"
to: "on" to: "on"
conditions: conditions:
# Only checked when motion turns ON
- condition: numeric_state - condition: numeric_state
entity_id: !input lux_entity entity_id: !input lux_entity
below: 5 below: !input lux_threshold
- condition: state - condition: state
entity_id: !input disabled_when_on entity_id: !input disabled_when_on
state: "off" state: "off"
actions: actions:
- alias: "Turn on the light" - alias: Turn on the light
action: light.turn_on action: light.turn_on
target: !input light_target target: !input light_target
- alias: "Wait until there is no motion from device"
- alias: Wait until motion is off for the configured time
wait_for_trigger: wait_for_trigger:
- trigger: state - trigger: state
entity_id: !input motion_entity entity_id: !input motion_entity
from: "on"
to: "off" to: "off"
- alias: "Wait the number of seconds that has been set" for:
delay: !input no_motion_wait seconds: !input no_motion_wait
- alias: "Turn off the light"
- alias: Turn off the light
action: light.turn_off action: light.turn_off
target: !input light_target target: !input light_target