Adds off_delay input parameter allowing users to configure how long to wait after motion stops before turning lights off. Includes re-verification to prevent lights turning off if motion resumes during the delay period. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
115 lines
3.2 KiB
YAML
115 lines
3.2 KiB
YAML
blueprint:
|
|
name: Occupancy Controlled Lights with Adaptive Lighting
|
|
description: Automatically turn lights on/off based on occupancy sensor with adaptive lighting support
|
|
domain: automation
|
|
input:
|
|
occupancy_sensor:
|
|
name: Occupancy Sensor
|
|
description: Binary sensor that detects occupancy/presence
|
|
selector:
|
|
entity:
|
|
domain: binary_sensor
|
|
device_class: occupancy
|
|
lights:
|
|
name: Lights
|
|
description: Light entities to control
|
|
selector:
|
|
target:
|
|
entity:
|
|
domain: light
|
|
adaptive_lighting_switch:
|
|
name: Adaptive Lighting Switch
|
|
description: Adaptive lighting switch entity for this room
|
|
default: {}
|
|
selector:
|
|
entity:
|
|
domain: switch
|
|
integration: adaptive_lighting
|
|
turn_on_transition:
|
|
name: Turn On Transition
|
|
description: Transition time in seconds when turning lights on
|
|
default: 5
|
|
selector:
|
|
number:
|
|
min: 0
|
|
max: 300
|
|
step: 1
|
|
unit_of_measurement: seconds
|
|
turn_off_transition:
|
|
name: Turn Off Transition
|
|
description: Transition time in seconds when turning lights off
|
|
default: 15
|
|
selector:
|
|
number:
|
|
min: 0
|
|
max: 300
|
|
step: 1
|
|
unit_of_measurement: seconds
|
|
adapt_brightness:
|
|
name: Adapt Brightness
|
|
description: Whether to adapt brightness when turning on lights
|
|
default: true
|
|
selector:
|
|
boolean:
|
|
adapt_color:
|
|
name: Adapt Color
|
|
description: Whether to adapt color when turning on lights
|
|
default: true
|
|
selector:
|
|
boolean:
|
|
off_delay:
|
|
name: Off Delay
|
|
description: Time to wait after no motion before turning lights off
|
|
default: 0
|
|
selector:
|
|
number:
|
|
min: 0
|
|
max: 3600
|
|
step: 1
|
|
unit_of_measurement: seconds
|
|
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: !input occupancy_sensor
|
|
|
|
condition: []
|
|
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: !input occupancy_sensor
|
|
state: "on"
|
|
sequence:
|
|
- if:
|
|
- condition: template
|
|
value_template: "{{ adaptive_lighting_switch != none }}"
|
|
then:
|
|
- action: adaptive_lighting.apply
|
|
data:
|
|
entity_id: !input adaptive_lighting_switch
|
|
turn_on_lights: true
|
|
transition: !input turn_on_transition
|
|
adapt_brightness: !input adapt_brightness
|
|
adapt_color: !input adapt_color
|
|
else:
|
|
- action: light.turn_on
|
|
target: !input lights
|
|
data:
|
|
transition: !input turn_on_transition
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: !input occupancy_sensor
|
|
state: "off"
|
|
sequence:
|
|
- delay:
|
|
seconds: !input off_delay
|
|
- condition: state
|
|
entity_id: !input occupancy_sensor
|
|
state: "off"
|
|
- action: light.turn_off
|
|
target: !input lights
|
|
data:
|
|
transition: !input turn_off_transition
|
|
|
|
mode: single |