blueprints/automation/motion-light.yaml aktualisiert
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
blueprint:
|
blueprint:
|
||||||
name: Motion-activated Light
|
name: Motion-activated Light with Lux and Daytime Dimming
|
||||||
description: Turn on a light when motion is detected.
|
description: Turn on a light when motion is detected, only if it's dark, and dim based on time of day.
|
||||||
domain: automation
|
domain: automation
|
||||||
author: Home Assistant
|
author: Enhanced by Copilot
|
||||||
input:
|
input:
|
||||||
motion_entity:
|
motion_entity:
|
||||||
name: Motion Sensor
|
name: Motion Sensor
|
||||||
@@ -19,6 +19,21 @@ blueprint:
|
|||||||
target:
|
target:
|
||||||
entity:
|
entity:
|
||||||
domain: light
|
domain: light
|
||||||
|
lux_entity:
|
||||||
|
name: Lux Sensor
|
||||||
|
selector:
|
||||||
|
entity:
|
||||||
|
domain: sensor
|
||||||
|
device_class: illuminance
|
||||||
|
lux_threshold:
|
||||||
|
name: Lux Threshold
|
||||||
|
description: Minimum lux level below which the light should turn on.
|
||||||
|
default: 50
|
||||||
|
selector:
|
||||||
|
number:
|
||||||
|
min: 0
|
||||||
|
max: 1000
|
||||||
|
unit_of_measurement: lx
|
||||||
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.
|
||||||
@@ -29,29 +44,34 @@ blueprint:
|
|||||||
max: 3600
|
max: 3600
|
||||||
unit_of_measurement: seconds
|
unit_of_measurement: seconds
|
||||||
|
|
||||||
# If motion is detected within the delay,
|
|
||||||
# we restart the script.
|
|
||||||
mode: restart
|
mode: restart
|
||||||
max_exceeded: silent
|
max_exceeded: silent
|
||||||
|
|
||||||
triggers:
|
trigger:
|
||||||
trigger: state
|
- platform: state
|
||||||
entity_id: !input motion_entity
|
entity_id: !input motion_entity
|
||||||
from: "off"
|
from: "off"
|
||||||
to: "on"
|
to: "on"
|
||||||
|
|
||||||
actions:
|
condition:
|
||||||
- alias: "Turn on the light"
|
- condition: numeric_state
|
||||||
action: light.turn_on
|
entity_id: !input lux_entity
|
||||||
|
below: !input lux_threshold
|
||||||
|
|
||||||
|
action:
|
||||||
|
- alias: "Turn on the light with calculated brightness"
|
||||||
|
service: light.turn_on
|
||||||
target: !input light_target
|
target: !input light_target
|
||||||
- alias: "Wait until there is no motion from device"
|
data:
|
||||||
|
brightness: "{{ brightness }}"
|
||||||
|
- alias: "Wait until there is no motion"
|
||||||
wait_for_trigger:
|
wait_for_trigger:
|
||||||
trigger: state
|
- platform: state
|
||||||
entity_id: !input motion_entity
|
entity_id: !input motion_entity
|
||||||
from: "on"
|
from: "on"
|
||||||
to: "off"
|
to: "off"
|
||||||
- alias: "Wait the number of seconds that has been set"
|
- alias: "Wait the number of seconds that has been set"
|
||||||
delay: !input no_motion_wait
|
delay: !input no_motion_wait
|
||||||
- alias: "Turn off the light"
|
- alias: "Turn off the light"
|
||||||
action: light.turn_off
|
service: light.turn_off
|
||||||
target: !input light_target
|
target: !input light_target
|
||||||
|
|||||||
Reference in New Issue
Block a user