Notification on triggered alarm exampels on android phone?

When for exampel i have a alarm that triggers, water sensor activates, fire alarm go on, i would like a notification on my android phone that continuously ring the phone, blink etc until i dismiss the notification.
To be sure i have noticed the alarm.
And it shouldnt matter if phone is in DND mode.
Iam sure someone have done something similiar and can share how it could look like?
have a nice day

There isn’t a super simple way to cover all your criteria…

alias: Repeated Mobile Alarm Alerts
description: ""
mode: parallel
trigger:
  - platform: state
    to: 'on'
    entity_id: sensor.house_fire
  - platform: state
    to: 'on'
    entity_id: input_boolean.enable_fire_alert
condition: []
action:
- choose:
  - conditions:
    - condition: trigger
      id: sensor
    sequence:
    - service: input_boolean.turn_on
      target:
        entity_id: input_boolean.enable_fire_alert
  - conditions:
    - condition: trigger
      id: boolean
    sequence:
    - alias: "Set up variables for the actions"
      variables:
        action_stop: "{{ 'STOP_' ~ context.id }}"
    - repeat:
        while:
        - condition: state
          entity_id: input_boolean.enable_fire_alert
          state: "on"
        - condition: template
          value_template: "{{ repeat.index <= 30 }}"
        sequence:
        - alias: "Ask to stop the alerts"
          service: notify.mobile_app_<YOUR_PHONE_NOTIFIER>
          data:
            title: EMERGENCY ALERT
            message: "The house is on fire!"
            data:
              actions:
                - action: "{{ action_stop }}"
                  title: Stop Alerts
              channel: alarm_stream
              priority: high
        - alias: "Wait for a response"
          timeout: "00:00:20"
          continue_on_timeout: false
          wait_for_trigger:
            - platform: event
              event_type: mobile_app_notification_action
              event_data:
                action: "{{ action_stop }}"
        - service: input_boolean.turn_off
          target:
            entity_id: input_boolean.enable_fire_alert
1 Like

Ty, i tried your automation but i still only get 1 vibration and no sound like a regular notifikation on my android phone.
I tried some automations yesterday with the alarm_stream setting but no luck.
It should ring the phone right?

Alarm stream will play the whatever sound you have set for your alarm, if you have your alarm sound set to vibrate only, that is what it will do. I believe you should be able to change that by using a volume level command before the repeat: action…

      - service: notify.mobile_app_<your_device_id_here>
        data:
          message: "command_volume_level"
          data:
            media_stream: "alarm_stream"
            command: 100
1 Like

Couldnt get it to work but ty for your efforts .
I did a notify alarm in tasker based on the HA notification instead. That turn of dnd mode, max volume and play alarm.mp3 intill stopped.

Some Samsung devices do not respect the Android API here, this was a deliberate change by Samsung. The only workaround for the Android app is too take the phone out of DND send notification then place it back.

1 Like