This blueprint will create a script that flashes some lights a certain amount of times and restores them at their previous state.
You can customize the number of flashes, color, brightness and the time which the lights stay ON or OFF
This was inspired by @markus78 's blueprint simple-flashing-lights-via-on-off-and-delay-restore-previous-light-states
blueprint:
name: Flash lights
description: Create a script that flashes lights and restore them at their previous state.
domain: script
input:
target_lights:
name: Lights
description: Lights to flash
selector:
entity:
filter:
domain: light
multiple: true
number_of_times:
name: Number of times to flash
description: How many times to flash the lights
selector:
number:
min: 0
max: 100
mode: box
unit_of_measurement: times
color_rgb:
name: RGB Color
description: Choose the color for blinking lights
selector:
select:
options:
- white
- red
- green
- lime
- blue
- navy
- yellow
- orange
- turquoise
- violet
- magenta
- aliceblue
- antiquewhite
- aquamarine
- aqua
- cadetblue
- coral
- cornflowerblue
- crimson
- darkblue
- darkorange
- darkorchid
- darksalmon
- darkslategray
- deeppink
- darkviolet
- deepskyblue
- ghostwhite
- gold
- lawngreen
- lightcoral
- lightgreen
- lightseagreen
brightness_pct:
name: Brightness
description: Color Brightness percentage
default: 100
selector:
number:
min: 0
max: 100
unit_of_measurement: '%'
step: 1.0
mode: slider
advanced:
name: Advanced
collapsed: true
input:
delay_on:
name: (OPTIONAL) ON Delay
description: Time which the light is off
default: 1
selector:
number:
min: 0.0
max: 5
unit_of_measurement: s
step: 0.1
mode: slider
delay_off:
name: (OPTIONAL) OFF Delay
description: Time which the light is off
default: 1
selector:
number:
min: 0.0
max: 5
unit_of_measurement: s
step: 0.1
mode: slider
mode: restart
max_exceeded: silent
sequence:
- service: scene.create
data:
scene_id: light_flash_snapshot
snapshot_entities: !input 'target_lights'
- delay:
hours: 0
minutes: 0
seconds: !input 'delay_on'
- service: light.turn_on
target:
entity_id: !input 'target_lights'
data:
color_name: !input 'color_rgb'
brightness_step_pct: !input 'brightness_pct'
- repeat:
count: !input 'number_of_times'
sequence:
- service: light.turn_off
data: {}
target:
entity_id: !input 'target_lights'
- delay:
hours: 0
minutes: 0
seconds: !input 'delay_off'
- service: light.turn_on
target:
entity_id: !input 'target_lights'
data:
color_name: !input 'color_rgb'
brightness_step_pct: !input 'brightness_pct'
- delay:
hours: 0
minutes: 0
seconds: !input 'delay_on'
- service: scene.turn_on
data:
entity_id: scene.light_flash_snapshot
preview: