Hi
I am trying to make blueprint, but I can’t seem to get it working. Can someone point me in the right direction or help?
blueprint:
name: Motion-triggered lights
description: Turn on lights when motion is detected
domain: automation
input:
trigger:
name: Trigger
description: The trigger(s) that will activate the lighting.
selector:
entity:
domain: binary_sensor
lights:
name: Lights
description: The lights that should be turned on.
selector:
target:
entity:
domain: light
time_after:
name: After
description: The time after which the lights can be turned on.
default: 00:00:00
selector:
time: {}
time_before:
name: Before
description: The time before which the lights can be turned on.
default: '23:59:59'
selector:
time: {}
illuminance_entity:
name: Daylight Sensor
description: The entity that measures the amount of daylight.
default: ''
selector:
entity:
domain: sensor
device_class: illuminance
illuminance_threshold:
name: Daylight Threshold
description: Defines the threshold of daylight below which the lights are turned on.
default: 100
selector:
number:
mode: box
min: 1.0
max: 100000.0
unit_of_measurement: lx
step: 1.0
brightness:
name: Brightness
description: The brightness (in %) that the lights should be set to when turned on.
default: 100
selector:
number:
mode: slider
min: 1.0
max: 100.0
step: 1.0
unit_of_measurement: '%'
color_temp_kelvin:
name: Color Temperature
description: The color temperature (in kelvin) that the lights should be set to when turned on.
default: 3000
selector:
number:
mode: slider
min: 2200.0
max: 6500.0
step: 25.0
unit_of_measurement: K
duration:
name: Duration
description: The duration (in seconds) that the lights are turned on.
default: 60
selector:
number:
mode: box
min: 1.0
max: 100000.0
unit_of_measurement: s
step: 1.0
automation:
- alias: 'Motion-triggered lights'
description: 'Turn on lights when motion is detected'
trigger:
- platform: state
entity_id: !input trigger
to: 'on'
condition:
- condition: time
after: !input time_after
before: !input time_before
- condition: numeric_state
entity_id: !input illuminance_entity
below: !input illuminance_threshold
action:
- service: light.turn_on
target: !input lights
data:
brightness_pct: !input brightness
color_temp: "{{ color_temp_kelvin }}"
- delay: !input duration
- service: light.turn_off
target: !input lights