The automation. I triggers also another automation to create a snapshot
alias: Pagerduty Alert
description: Blink lights and restore previous state
triggers:
- entity_id: sensor.pagerduty_total_incidents
attribute: urgency_high
trigger: state
conditions:
- condition: template
value_template: >-
{{ trigger.from_state.attributes.urgency_high | int <
trigger.to_state.attributes.urgency_high | int }}
- condition: state
entity_id: person.carsten_flokstra
state: home
actions:
- action: automation.trigger
metadata: {}
data:
skip_condition: true
target:
entity_id: automation.create_snapshot_scene
- delay:
hours: 0
minutes: 0
seconds: 2
milliseconds: 0
- data:
rgb_color:
- 0
- 255
- 4
target:
entity_id:
- light.studio
- light.bedroom
- light.bathroom
- light.color_leds_downstairs
action: light.turn_on
- repeat:
count: 5
sequence:
- data:
rgb_color:
- 0
- 255
- 4
flash: short
target:
area_id:
- bedroom
- bathroom
- studio
entity_id: light.color_leds_downstairs
action: light.turn_on
- action: light.turn_off
metadata: {}
data: {}
target:
entity_id: light.all_lights
- delay:
hours: 0
minutes: 0
seconds: 2
milliseconds: 0
- repeat:
count: 2
sequence:
- data:
entity_id: scene.snapshot
action: scene.turn_on
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
- delay:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
- data: {}
action: scene.delete
target:
entity_id: scene.snapshot
mode: single