Hi, New to automations in home assistant but trying things out.
I have 2 automations and have added a delay into the first one which works great and has stopped false notifications but as there was a false notification my second one keeps notifying me, can anyone think of a way I can only run the second automation if the first one has indeed been triggered?
Automation1:
alias: Off Grid
description: Tesla notified we are off grid
trigger:
- platform: state
entity_id:
- binary_sensor.my_home_grid_status
from: "on"
to: unavailable
condition: []
action:
- delay:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
- condition: state
entity_id: binary_sensor.my_home_grid_status
state: unavailable
- delay:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
- condition: state
entity_id: binary_sensor.my_home_grid_status
state: unavailable
- service: notify.alexa_media_office
data:
message: >-
The power is out and the house is now running on battery, turn off any
unwanted devices.
data:
type: tts
- service: notify.alexa_media_kitchen_echo_show_8
data:
message: >-
The power is out and the house is now running on battery, turn off any
unwanted devices.
data:
type: tts
enabled: false
- service: notify.alexa_media_hallway
data:
data:
type: tts
message: >-
The power is out and the house is now running on battery, turn off any
unwanted devices.
enabled: false
mode: single
Automation 2:
alias: On Grid
description: Tesla notified we are back on grid
trigger:
- platform: state
entity_id:
- binary_sensor.my_home_grid_status
from: unavailable
to: "on"
condition: []
action:
- delay:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
- condition: state
entity_id: binary_sensor.my_home_grid_status
state: "on"
- delay:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
- condition: state
entity_id: binary_sensor.my_home_grid_status
state: "on"
- service: notify.alexa_media_officea
data:
message: The power to the house has been restored
data:
type: tts
- service: notify.alexa_media_kitchen_echo_show_8
data:
message: The power to the house has been restored
data:
type: tts
enabled: false
- service: notify.alexa_media_hallway
data:
data:
type: tts
message: The power to the house has been restored
enabled: false
mode: single