I seem to be having an issue with my Blueprint where I get a “Response error: 500” error when saving the Automation:
I have similar things already working in Automations with Scripts, but I’m trying to make a Blueprint to reduce the amount of maintenance required to maintain a bunch of copy-cat Automations.
This is my Blueprint:
blueprint:
name: Control Button & Motion Activated Lights
description: >-
Turns on lights with adaptive lighting during the day, but at night, it turns
on a much dimmer version.
Using a permanent trigger disables temporary lighting until definite trigger.
domain: automation
input:
lights:
name: Lights
description: The list of lights to turn on.
selector:
target:
entity:
domain: light
has_daytime_motion_lighting:
name: Has Daytime Motion Lighting
description: Enable lights turning on during the day.
selector:
boolean: {}
default: true
daytime_brightness:
name: Daytime Brightness
description: Brightness of lights during the day.
selector:
entity: {}
default: input_number.light_brightness_percentage
daytime_color_temperature:
name: Daytime Color Temperature
description: Color temperature of lights during the day.
selector:
entity: {}
default: input_select.light_color_temperature
nighttime_brightness:
name: Nighttime Brightness
description: Brightness of lights during when it's dark outside.
selector:
number:
min: 1
max: 100
step: 1
default: 20
nighttime_color_temperature:
name: Nighttime Color Temperature
description: Color temperature of lights when it's dark outside.
selector:
select:
multiple: false
options:
- "2500"
- "2700"
- "3500"
- "5000"
- "6500"
default: "2500"
lights_off_transition:
name: Lights Off Transition
description: Time to fade-out lights when turning them off.
selector:
number:
min: 1
max: 10
step: 0.25
default: 1.5
motion_sensor_toggle:
name: Motion Sensor Toggle
description: Toggle helper for turning off motion sensors.
selector:
entity:
domain: input_boolean
default: true
trigger_permanent_lights_on:
name: "Trigger: Turn on lights"
description: Trigger that turns on lights until they've been explicitly turned off.
selector:
trigger: {}
trigger_temporary_lights_on:
name: "Trigger: Temporarily turn on lights"
description: Trigger that turns on lights to be turned off after a specified time.
selector:
trigger: {}
trigger_definite_lights_off:
name: "Trigger: Turn off lights"
description: Trigger that turns off lights.
selector:
trigger: {}
trigger_possible_lights_off:
name: "Trigger: Potentially turn off lights"
description: Trigger that turns off lights when motion sensors are enabled.
selector:
trigger: {}
turn_on_daytime_lights:
name: Turn on Daytime Lights
description: Action that turns on adaptive lighting.
selector:
action: {}
default:
- service: light.turn_on
metadata: {}
data:
brightness_pct: "{{ daytime_brightness }}"
kelvin: "{{ daytime_color_temperature }}"
transition: 1
target: "{{ lights }}"
turn_on_nighttime_lights:
name: Turn on Nighttime Lights
description: Action that turns on adaptive lighting.
selector:
action: {}
default:
- service: light.turn_on
metadata: {}
data:
kelvin: "{{ nighttime_color_temperature }}"
brightness_pct: "{{ nighttime_brightness }}"
transition: 1
target: "{{ lights }}"
turn_off_lights:
selector:
action: {}
name: Turn off Lights
description: Action that turns off lights.
default:
- service: light.turn_off
metadata: {}
data:
transition: "{{ lights_off_transition }}"
target: "{{ lights }}"
trigger:
- platform: event
event_type: "{{ trigger.event.event_type }}"
event_data:
trigger_id: !input trigger_permanent_lights_on
- platform: event
event_type: "{{ trigger.event.event_type }}"
event_data:
trigger_id: !input trigger_temporary_lights_on
- platform: event
event_type: "{{ trigger.event.event_type }}"
event_data:
trigger_id: !input trigger_definite_lights_off
- platform: event
event_type: "{{ trigger.event.event_type }}"
event_data:
trigger_id: !input trigger_possible_lights_off
condition: []
action:
- choose:
- conditions:
- condition: trigger
id:
- "{{ trigger_permanent_lights_on }}"
- "{{ trigger_temporary_lights_on }}"
sequence:
- parallel:
- !input turn_on_daytime_lights
- if:
- condition: trigger
id:
- "{{ trigger_permanent_lights_on }}"
then: !input turn_on_nighttime_lights
- conditions:
- condition: or
conditions:
- condition: trigger
id:
- "{{ trigger_definite_lights_off }}"
- condition: and
conditions:
- condition: trigger
id:
- "{{ trigger_possible_lights_off }}"
- condition: state
entity_id: !input motion_sensor_toggle
state: "on"
sequence:
- !input turn_off_lights
- delay:
hours: 0
minutes: 0
seconds: 3
milliseconds: 0
- service: input_boolean.turn_on
metadata: {}
data: {}
target:
entity_id: !input motion_sensor_toggle
mode: restart
Separately, I’m trying to make it so the four triggers are optional. If I don’t add them, I don’t want them to be required because not every room is the same. Is that possible?