I am trying to create an automation that will alert me via push bullet and tts when any door is open. This is determined by checking the state of 5 doors. If the sensor is set to on the automation should trigger and repeat itself until the door(s) are closed.
I am getting this error:
Invalid config for [automation]: [service] is an invalid option for [automation].
I see I could use an Alert but I am curious why the automation won’t work . Thanks for any help you can offer.
# Keep NotifyingUntilFrontDoor is off
- id: CriticalSensorOn
alias: 'CriticalSensorAlert'
initial_state: 'on'
trigger:
platform: state
entity_id:
- binary_sensor.door_one
- binary_sensor.door_two
- binary_sensor.door_three
- binary_sensor.door_four
- binary_sensor.door_five
to: 'on'
action:
- service: persistent_notification.create
data_template:
message: The {{ trigger.to_state.attributes.friendly_name }} was left open
title: 'Warning'
repeat:
sequence:
- service: homeassistant.turn_on
data:
entity_id: 'light.gateway_light_7811dcfd69df'
color_name: 'red'
brightness: '255'
- delay: '00:00:01'
- service: notify.pushbullet
data_template:
title: Door Left Open
message: The {{ trigger.to_state.attributes.friendly_name }} was left open
- delay: '00:00:01'
- service: tts.google_say
data:
entity_id: media_player.living_room_speaker
message: The {{ trigger.to_state.attributes.friendly_name }} was left open
- service: tts.google_say
data:
entity_id: media_player.bathroom_speaker
message: The {{ trigger.to_state.attributes.friendly_name }} was left open
- service: tts.google_say
data:
entity_id: media_player.dinning_room_speaker
message: The {{ trigger.to_state.attributes.friendly_name }} was left open
- service: xiaomi_aqara.play_ringtone
data:
gw_mac: 7811DCFD69DF
ringtone_id: 10001
ringtone_vol: 100
until:
- condition: state
entity_id:
- binary_sensor.door_one
- binary_sensor.door_two
- binary_sensor.door_three
- binary_sensor.door_four
- binary_sensor.door_five
state: 'off'
``````````````````````````````````````````````````````