Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 109599

Can someone help me a bit with my alarm script (siren not repeating for some reason)

$
0
0

Hello all,

I’m hoping someone can give me some guidance on the script below. For some reason, the audio doesn’t seem to be repeating. This is being played on my “everywhere” chromecast group when my alarm is triggered. If possible, it would be nice if someone could review the whole script for junk because I’ll be honest, I don’t really know what I’m doing just yet and pretty much just doing my best with my current abilities.

The lights seem like they are turning red and repeating until I stop them but the audio seems like it stops after 1 cycle. I honestly don’t know if I am using the wait template properly, nor do I know if it is in the correct position. I put 2 seperate “repeat” blocks because the lights default flash time is different than my audio clip so I think this is probably necessary.

Thank you all again for your guidance.

  notification_security_alarm_audio:
    sequence:
      - service: media_player.volume_set
        data_template:
          entity_id: media_player.everywhere_inside_except_tvs
          volume_level: |
            {{ states('input_number.alarm_siren_volume') | float }}
      - repeat:
          until:
            - condition: state
              entity_id: alarm_control_panel.alarmo
              state: disarmed
          sequence:
            - service: light.turn_on
              data:
                rgb_color:
                  - 255
                  - 0
                  - 0
              target:
                entity_id:
                  - light.couch_lamp
                  - light.chair_lamp
                  - light.entry_lamp
            - service: light.turn_on
              data:
                brightness_pct: 100
                flash: long
              target:
                entity_id:
                  - light.chair_lamp
                  - light.couch_lamp
                  - light.entry_lamp
      - repeat:
          until:
            - condition: state
              entity_id: alarm_control_panel.alarmo
              state: disarmed
          sequence:
            - service: media_player.play_media
              data:
                media_content_id: media-source://media_source/sounds/siren.mp3
                media_content_type: music
              target:
                entity_id: media_player.everywhere_inside_except_tvs
            - wait_template: '      - wait_template: ''{{ is_state("media_player.everywhere_inside_except_tvs", "idle") or is_state("media_player.everywhere_inside_except_tvs", "off") or is_state("media_player.everywhere_inside_except_tvs", "paused") }}'''
              continue_on_timeout: true
    mode: single

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 109599

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>