Xiaomi Ringtone Time

Hi community,

I am trying to play Police Ringtone in Xiaomi Gateway when my alarm is triggered. It is working awesome but my problem is the ringtone is only for like 10 seconds and then ringtone ends. Is there anyway i can play that ringtone for more time?

Thank you in advance

Hi i created a loop script to repeated the alarm every 15 seconds, the alarm sound i was using was 14/15 seconds in length, looping until the Alarm is disarmed, this was the only way round it, i could think off.

Thank you, that’s what i was looking for. Can you please show me the config you are using for looping a script?

Hi sorry for the delay in getting back to you.

here is my script, I’m not the best at scripting, and im sure there is a better way but his does work for me

############################################################
##                   Alarm Siren Loop                     ##
############################################################

# START XIAOMI SIREN 
  xiaomi_alarm_siren:
    alias: Xiaomi Alarm Siren 
    sequence:
      - service: xiaomi_aqara.play_ringtone
        data_template:
          ringtone_id: 0
          ringtone_vol: 100
          gw_mac: 34:CE:00:91:F2:BC
      - service: xiaomi_aqara.play_ringtone
        data_template:
          ringtone_id: 0
          ringtone_vol: 100
          gw_mac: 34:CE:00:90:83:4F
      - delay:
#### time for siren to play before restarting 
          seconds: 14
      - service: script.turn_on
        data:
          entity_id: script.xiaomi_alarm_siren_loop

# LOOP BACK TO START SIREN AGAIN         
  xiaomi_alarm_siren_loop:
    alias: Xiaomi Alarm loop
    sequence:
      - delay:
#### time for siren to start
          seconds: .1
      - service: script.turn_on
        data:
          entity_id: script.xiaomi_alarm_siren
# CANCEL Siren when Disarm - refer to Automation
  xiaomi_alarm_siren_cancel:
    alias: Cancel Siren Cancel
    sequence:
      - delay:
          seconds: 1
      - service: script.turn_off
        data:
          entity_id: script.xiaomi_alarm_siren
      - service: script.turn_off
        data:
          entity_id: script.xiaomi_alarm_siren_loop
1 Like