Hi,
I am about to realize an alarm siren via alexa echo dot. For now, this script is supposed to be triggered manually only.
script_sound_alarm:
alias: Script - Sound Alarm
sequence:
- service: media_player.volume_set
target:
entity_id: media_player.echo_dot_1
data:
volume_level: 1
- repeat:
count: '5'
sequence:
- service: media_player.play_media
data:
media_content_id: amzn_sfx_scifi_alarm_04
media_content_type: sound
target:
entity_id: media_player.echo_dot_1
mode: single
This has been set up via HA UI. First thing I realized is, that there is no unique id anymore like all my other scripts still have.
Is this a bug or a feature?
triggering this script does work and the alarm sound is being repeated 5 times (5 seconds per run - total of 20 seconds).
However, during run time, I can’t stop this script via script.turn_off.
Is this a desired behaviour?
In order to have the siren running as long as I stop it, I created a boolean as a condition.
script_sound_alarm:
alias: Script - Sound Alarm
sequence:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.arm_alarm_siren
- service: media_player.volume_set
target:
entity_id: media_player.echo_dot_1
data:
volume_level: 1
- repeat:
while:
- condition: state
entity_id: input_boolean.arm_alarm_siren
state: 'on'
sequence:
- service: media_player.play_media
data:
media_content_id: amzn_sfx_scifi_alarm_04
media_content_type: sound
target:
entity_id: media_player.echo_dot_1
mode: single
When starting this script manually, it starts and also stops based on this boolean according to my logbook but no sound is being played and there’s no error message in my log.
What’s wrong with this configuration?
Best