I have been trying to build a loop for most of the afternoon, but seeing some strange behaviour. This is the code atm (without a loop yet)
- alias: 'Manual - Alarm triggered'
trigger:
- platform: state
entity_id: alarm_control_panel.home_alarm
to: triggered
action:
- service: notify.mobile_app_xxxx
data_template:
title: 'Alarm'
message: >
Alarm triggered - Siren
data:
push:
sound: "sirene.wav"
- service: media_player.volume_set
data_template:
entity_id:
- media_player.keuken
- media_player.woonkamer
volume_level: 0.1
- service: media_player.play_media
data:
media_content_id: http://x.x.x.x:123/local/sirene.mp3
media_content_type: music
target:
entity_id:
- media_player.keuken
- media_player.woonkamer
It plays the 5 second sound once for media_player.keuken but loops for media_player.woonkamer. Anyone got an idea why that might be?
Also trying to stop it playing when disarming does not work. It just does not stop playing.
- alias: 'Manual - Alarm disarmed'
trigger:
- platform: state
entity_id: alarm_control_panel.home_alarm
to: disarmed
action:
- service: notify.mobile_app_xxx
data_template:
title: 'Alarm'
message: >
Alarm disarmed
- service: media_player.media_stop
data:
entity_id:
- media_player.woonkamer
- media_player.keuken