Here is my automation. its based on a timer starting (which is triggered by a sensor)
I want to get this to keep doing the siren noise until the timer expires. I have tried to change this but I got a bit lost and not really sure how I can repeat this section as part of the action. Can anyone help~?
**** - service: media_player.play_media**
** target:**
** entity_id:**
** - media_player.back_bedroom**
** - media_player.front_bedroom**
** - media_player.lounge_echo**
** - media_player.mr_s_2nd_echo_dot**
** - media_player.upstairs_hall**
** data:**
** media_content_id: ‘’‘start security siren’’’**
** media_content_type: custom****
----- THE ACTUAL AUTOMATION ----
alias: ALARM_Make Noise
description: ‘’
trigger:
- platform: state
entity_id: timer.alarm_noise
from: idle
to: active
for:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
condition: - condition: state
entity_id: alarm_control_panel.home_security_system
state: armed_away
for:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
action: - service: notify.sms_alert
data:
message: Motion has been detected at home
target: 44xxxxxxx - service: notify.whatsapp
data:
message: Motion detected at Home - service: notify.mobile_app_sm_n976b
data:
message: Motion detected at Home
title: Home security system - service: notify.alexa_media_Everywhere
data:
message: Attention. Burglar Alarm Activated
data:
type: announce
method: all - service: media_player.play_media
target:
entity_id:
- media_player.back_bedroom
- media_player.front_bedroom
- media_player.lounge_echo
- media_player.mr_s_2nd_echo_dot
- media_player.upstairs_hall
data:
media_content_id: ‘’‘start security siren’’’
media_content_type: custom
mode: restart
max: 20