[GH-ISSUE #417] Emergency Priority on Android #322

Closed
opened 2026-05-07 00:23:03 +02:00 by BreizhHardware · 26 comments

Originally created by @danmed on GitHub (Sep 29, 2022).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/417

I've been trying out ntfy and it's.. well it's awesome.. so much quicker than pushover..

The problem i have is that i want to use it for my alarm notifications but i cannot figure out how to set it as an emergency alert on android.

My phone is almost always on vibrate only and after 11pm it's in DND.

I've figured out how to ignore DND.. but how can i get it to ignore vibrate and play a sound (loud!)

With pushover I set the priority to 2.. but i can't find the equivalent with ntfy

Originally created by @danmed on GitHub (Sep 29, 2022). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/417 I've been trying out ntfy and it's.. well it's awesome.. so much quicker than pushover.. The problem i have is that i want to use it for my alarm notifications but i cannot figure out how to set it as an emergency alert on android. My phone is almost always on vibrate only and after 11pm it's in DND. I've figured out how to ignore DND.. but how can i get it to ignore vibrate and play a sound (loud!) With pushover I set the priority to 2.. but i can't find the equivalent with ntfy
Author
Owner

@binwiederhier commented on GitHub (Sep 30, 2022):

I've figured out how to ignore DND.. but how can i get it to ignore vibrate and play a sound (loud!)

I just tried and if I

  • set my phone to "Ring" (my OnePlus phone has a slider on the side of the phone)
  • enable DND
  • And set the "max priority" channel to "override DND"

It will play a sound even with DND.

Here's what that looks like. You can even set a custom ringtone for max priority items:
image

<!-- gh-comment-id:1262995893 --> @binwiederhier commented on GitHub (Sep 30, 2022): > I've figured out how to ignore DND.. but how can i get it to ignore vibrate and play a sound (loud!) I just tried and if I - set my phone to "Ring" (my OnePlus phone has a slider on the side of the phone) - enable DND - And set the "max priority" channel to "override DND" It will play a sound even with DND. Here's what that looks like. You can even set a custom ringtone for max priority items: ![image](https://user-images.githubusercontent.com/664597/193169569-eafe35c8-8792-4a06-b8e0-c53c0affab4b.png)
Author
Owner

@binwiederhier commented on GitHub (Sep 30, 2022):

I found this is a great sound for max priority: https://cdn.freesound.org/previews/607/607878_12946258-lq.mp3

<!-- gh-comment-id:1263002360 --> @binwiederhier commented on GitHub (Sep 30, 2022): I found this is a great sound for max priority: https://cdn.freesound.org/previews/607/607878_12946258-lq.mp3
Author
Owner

@danmed commented on GitHub (Sep 30, 2022):

I've figured out how to ignore DND.. but how can i get it to ignore vibrate and play a sound (loud!)

I just tried and if I

  • set my phone to "Ring" (my OnePlus phone has a slider on the side of the phone)
  • enable DND
  • And set the "max priority" channel to "override DND"

It will play a sound even with DND.

Here's what that looks like. You can even set a custom ringtone for max priority items: image

Hi,

thank you for your reply, but i don't want to take my phone off silent... (for a few reasons).. I was just wondering if NTFY could by pass the "silent" mode like pushover can.

<!-- gh-comment-id:1263275816 --> @danmed commented on GitHub (Sep 30, 2022): > > I've figured out how to ignore DND.. but how can i get it to ignore vibrate and play a sound (loud!) > > I just tried and if I > > * set my phone to "Ring" (my OnePlus phone has a slider on the side of the phone) > * enable DND > * And set the "max priority" channel to "override DND" > > It will play a sound even with DND. > > Here's what that looks like. You can even set a custom ringtone for max priority items: ![image](https://user-images.githubusercontent.com/664597/193169569-eafe35c8-8792-4a06-b8e0-c53c0affab4b.png) Hi, thank you for your reply, but i don't want to take my phone off silent... (for a few reasons).. I was just wondering if NTFY could by pass the "silent" mode like pushover can.
Author
Owner

@binwiederhier commented on GitHub (Sep 30, 2022):

but i don't want to take my phone off silent...

Doesn't DND override all sounds and mutes them?

I was just wondering if NTFY could by pass the "silent" mode like pushover can.

I thought I had looked into that and decided it wasn't possible. But if Pushover does it, it must be possible ... It's a valid request.

<!-- gh-comment-id:1263750378 --> @binwiederhier commented on GitHub (Sep 30, 2022): > but i don't want to take my phone off silent... Doesn't DND override all sounds and mutes them? > I was just wondering if NTFY could by pass the "silent" mode like pushover can. I thought I had looked into that and decided it wasn't possible. But if Pushover does it, it must be possible ... It's a valid request.
Author
Owner

@danmed commented on GitHub (Sep 30, 2022):

but i don't want to take my phone off silent...

Doesn't DND override all sounds and mutes them?

I was just wondering if NTFY could by pass the "silent" mode like pushover can.

I thought I had looked into that and decided it wasn't possible. But if Pushover does it, it must be possible ... It's a valid request.

Thank you for considering it.. here is the Pushover info : https://pushover.net/api#priority

<!-- gh-comment-id:1264040292 --> @danmed commented on GitHub (Sep 30, 2022): > > but i don't want to take my phone off silent... > > Doesn't DND override all sounds and mutes them? > > > I was just wondering if NTFY could by pass the "silent" mode like pushover can. > > I thought I had looked into that and decided it wasn't possible. But if Pushover does it, it must be possible ... It's a valid request. Thank you for considering it.. here is the Pushover info : https://pushover.net/api#priority
Author
Owner

@danmed commented on GitHub (Nov 13, 2022):

I had to set up pushover on my phone again (new phone) and by default it wasn't bypassing my DND.. it turns out i'd had to alter some settings in the client and the main one is to play high priority alerts as through the alarm channel which bypasses DND / Silent mode.. maybe that will assist in progressing this one! (it also allows customising the sound played for high priority alerts)

<!-- gh-comment-id:1312605089 --> @danmed commented on GitHub (Nov 13, 2022): I had to set up pushover on my phone again (new phone) and by default it wasn't bypassing my DND.. it turns out i'd had to alter some settings in the client and the main one is to play high priority alerts as through the alarm channel which bypasses DND / Silent mode.. maybe that will assist in progressing this one! (it also allows customising the sound played for high priority alerts)
Author
Owner

@binwiederhier commented on GitHub (Nov 13, 2022):

had to alter some settings in the client

If you could share the steps or screenshots that'd be helpful :-D

<!-- gh-comment-id:1312708947 --> @binwiederhier commented on GitHub (Nov 13, 2022): > had to alter some settings in the client If you could share the steps or screenshots that'd be helpful :-D
Author
Owner

@danmed commented on GitHub (Nov 14, 2022):

Screenshot_20221114-035739

This is just in the settings for the pushover app on Android... nothing else i can really share i'm afraid...

<!-- gh-comment-id:1313059985 --> @danmed commented on GitHub (Nov 14, 2022): ![Screenshot_20221114-035739](https://user-images.githubusercontent.com/3878490/201572305-decb1779-d5c8-4f90-9a70-03249055befb.png) This is just in the settings for the pushover app on Android... nothing else i can really share i'm afraid...
Author
Owner

@binwiederhier commented on GitHub (Nov 17, 2022):

What app is that from? Is that from Android, or in Pushover? It'd be more helpful if you could provide specific steps in Android. If it's a pushover setting, then don't bother, because I won't know what Pushover does under the hood.

<!-- gh-comment-id:1318742449 --> @binwiederhier commented on GitHub (Nov 17, 2022): What app is that from? Is that from Android, or in Pushover? It'd be more helpful if you could provide specific steps in Android. If it's a pushover setting, then don't bother, because I won't know what Pushover does under the hood.
Author
Owner

@danmed commented on GitHub (Nov 17, 2022):

It's Pushover.. i just figured that the description of what it does might
help

On Thu, Nov 17, 2022 at 2:44 PM Philipp C. Heckel @.***>
wrote:

What app is that from? Is that from Android, or in Pushover? It'd be more
helpful if you could provide specific steps in Android. If it's a pushover
setting, then don't bother, because I won't know what Pushover does under
the hood.


Reply to this email directly, view it on GitHub
https://github.com/binwiederhier/ntfy/issues/417#issuecomment-1318742449,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AA5S4WX5QM2A262X3OOLHF3WIZAETANCNFSM6AAAAAAQZGSGO4
.
You are receiving this because you authored the thread.Message ID:
@.***>

<!-- gh-comment-id:1318932778 --> @danmed commented on GitHub (Nov 17, 2022): It's Pushover.. i just figured that the description of what it does might help On Thu, Nov 17, 2022 at 2:44 PM Philipp C. Heckel ***@***.***> wrote: > What app is that from? Is that from Android, or in Pushover? It'd be more > helpful if you could provide specific steps in Android. If it's a pushover > setting, then don't bother, because I won't know what Pushover does under > the hood. > > — > Reply to this email directly, view it on GitHub > <https://github.com/binwiederhier/ntfy/issues/417#issuecomment-1318742449>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AA5S4WX5QM2A262X3OOLHF3WIZAETANCNFSM6AAAAAAQZGSGO4> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> >
Author
Owner

@binwiederhier commented on GitHub (Nov 28, 2022):

I have managed to produce a looping alarm sound, even with DND enabled, and even when the phone is silent. I think I can make a similar toggle to the screenshot above. Working on this now.

<!-- gh-comment-id:1328440969 --> @binwiederhier commented on GitHub (Nov 28, 2022): I have managed to produce a looping alarm sound, even with DND enabled, and even when the phone is silent. I think I can make a similar toggle to the screenshot above. Working on this now.
Author
Owner

@danmed commented on GitHub (Nov 28, 2022):

I have managed to produce a looping alarm sound, even with DND enabled, and even when the phone is silent. I think I can make a similar toggle to the screenshot above. Working on this now.

Awesome!

<!-- gh-comment-id:1329370231 --> @danmed commented on GitHub (Nov 28, 2022): > I have managed to produce a looping alarm sound, even with DND enabled, and even when the phone is silent. I think I can make a similar toggle to the screenshot above. Working on this now. Awesome!
Author
Owner

@binwiederhier commented on GitHub (Nov 29, 2022):

Alright I got something that reliably works. It is a little odd that it's not possible to configure the sound for this (yet), so I have to pick a sound. For my phone, the default notification sound (on repeat) works the best, but I don't know if that's ok with other phones.

I'm going to implement it this way and later, maybe if I ever get to #6, we can make this configurable.

<!-- gh-comment-id:1331250426 --> @binwiederhier commented on GitHub (Nov 29, 2022): Alright I got something that reliably works. It is a little odd that it's not possible to configure the sound for this (yet), so I have to pick a sound. For my phone, the default notification sound (on repeat) works the best, but I don't know if that's ok with other phones. I'm going to implement it this way and later, maybe if I ever get to #6, we can make this configurable.
Author
Owner

@danmed commented on GitHub (Nov 29, 2022):

Happy to give it a test.. I'm using a pixel 6a

On Tue, 29 Nov 2022, 20:22 Philipp C. Heckel, @.***>
wrote:

Alright I got something that reliably works. It is a little odd that it's
not possible to configure the sound for this (yet), so I have to pick a
sound. For my phone, the default notification sound (on repeat) works the
best, but I don't know if that's ok with other phones.

I'm going to implement it this way and later, maybe if I ever get to #6
https://github.com/binwiederhier/ntfy/issues/6, we can make this
configurable.


Reply to this email directly, view it on GitHub
https://github.com/binwiederhier/ntfy/issues/417#issuecomment-1331250426,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AA5S4WUKLO63KFLT6FG4R6LWKZQZXANCNFSM6AAAAAAQZGSGO4
.
You are receiving this because you authored the thread.Message ID:
@.***>

<!-- gh-comment-id:1331254424 --> @danmed commented on GitHub (Nov 29, 2022): Happy to give it a test.. I'm using a pixel 6a On Tue, 29 Nov 2022, 20:22 Philipp C. Heckel, ***@***.***> wrote: > Alright I got something that reliably works. It is a little odd that it's > not possible to configure the sound for this (yet), so I have to pick a > sound. For my phone, the default notification sound (on repeat) works the > best, but I don't know if that's ok with other phones. > > I'm going to implement it this way and later, maybe if I ever get to #6 > <https://github.com/binwiederhier/ntfy/issues/6>, we can make this > configurable. > > — > Reply to this email directly, view it on GitHub > <https://github.com/binwiederhier/ntfy/issues/417#issuecomment-1331250426>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AA5S4WUKLO63KFLT6FG4R6LWKZQZXANCNFSM6AAAAAAQZGSGO4> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> >
Author
Owner

@binwiederhier commented on GitHub (Nov 29, 2022):

Well, right now there is no toggle and the notification sound will literally not stop looping until you kill the app. So I'll let you know when I have something that is actually close to ready.

<!-- gh-comment-id:1331255707 --> @binwiederhier commented on GitHub (Nov 29, 2022): Well, right now there is no toggle and the notification sound will literally not stop looping until you kill the app. So I'll let you know when I have something that is actually close to ready.
Author
Owner

@binwiederhier commented on GitHub (Nov 30, 2022):

Here's an .apk you can try: https://drive.google.com/file/d/11ZbKDPz4fz9RvvtAi1W3ylATr_L5AlOG/view?usp=share_link

(Be sure to back up your config using Settings -> Backup)

<!-- gh-comment-id:1331609536 --> @binwiederhier commented on GitHub (Nov 30, 2022): Here's an .apk you can try: https://drive.google.com/file/d/11ZbKDPz4fz9RvvtAi1W3ylATr_L5AlOG/view?usp=share_link (Be sure to back up your config using Settings -> Backup)
Author
Owner

@binwiederhier commented on GitHub (Nov 30, 2022):

@danmed Let me know if it generally works for you.

There has been a discussion on Discord/Matrix about this feature, and about whether or not to add a new priority level or a new flag to trigger this insistent behavior. Here are the options

  1. Add client-side toggle turn the normal "priority 5" behavior into the looping sound. No server side changes.
  2. Add new priority Priority: 6 (aka Priority: emergency), which will by default trigger the looping sound. There would be a cllient-side toggle to switch this behavior off. This is a little weird, because now the max priority is not the highest anymore. This requires server side changes, and may be a slightly breaking change for clients.
  3. Add Insistent: yes header, which will by default trigger the looping sound. There would be a client-side toggle to ignore this flag. This is a little off for something like Priority: min; Insistent: yes, because that would not alert at all. This requires server side changes.

Arguably, option 1+2 are kind of the same, because they both have a client-side toggle to turn the behavior off/on.

Thoughts?

<!-- gh-comment-id:1332650484 --> @binwiederhier commented on GitHub (Nov 30, 2022): @danmed Let me know if it generally works for you. There has been a discussion on Discord/Matrix about this feature, and about whether or not to add a new priority level or a new flag to trigger this insistent behavior. Here are the options 1. Add client-side toggle turn the normal "priority 5" behavior into the looping sound. No server side changes. 2. Add new priority `Priority: 6` (aka `Priority: emergency`), which will by default trigger the looping sound. There would be a cllient-side toggle to switch this behavior off. This is a little weird, because now the max priority is not the highest anymore. This requires server side changes, and may be a slightly breaking change for clients. 3. Add `Insistent: yes` header, which will by default trigger the looping sound. There would be a client-side toggle to ignore this flag. This is a little off for something like `Priority: min; Insistent: yes`, because that would not alert at all. This requires server side changes. Arguably, option 1+2 are kind of the same, because they both have a client-side toggle to turn the behavior off/on. Thoughts?
Author
Owner

@danmed commented on GitHub (Dec 4, 2022):

Hey, really sorry.. it's been a hectic weekend.. ill try and test the APK
in the next couple of days..

as for the options for implementation.. it makes sense to me to have a new
priority for it but i do understand the breaking changes this could cause..

On Wed, Nov 30, 2022 at 7:36 PM Philipp C. Heckel @.***>
wrote:

@danmed https://github.com/danmed Let me know if it generally works for
you.

There has been a discussion on Discord/Matrix about this feature, and
about whether or not to add a new priority level or a new flag to trigger
this insistent behavior. Here are the options

  1. Add client-side toggle turn the normal "priority 5" behavior into
    the looping sound. No server side changes.
  2. Add new priority Priority: 6 (aka Priority: emergency), which will
    by default trigger the looping sound. There would be a cllient-side toggle
    to switch this behavior off. This is a little weird, because now the max
    priority is not the highest anymore. This requires server side changes, and
    may be a slightly breaking change for clients.
  3. Add Insistent: yes header, which will by default trigger the
    looping sound. There would be a client-side toggle to ignore this flag.
    This is a little off for something like Priority: min; Insistent: yes,
    because that would not alert at all. This requires server side changes.

Arguably, option 1+2 are kind of the same, because they both have a
client-side toggle to turn the behavior off/on.

Thoughts?


Reply to this email directly, view it on GitHub
https://github.com/binwiederhier/ntfy/issues/417#issuecomment-1332650484,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AA5S4WSJEJZ5XDDXPP3FFT3WK6UCRANCNFSM6AAAAAAQZGSGO4
.
You are receiving this because you were mentioned.Message ID:
@.***>

<!-- gh-comment-id:1336536247 --> @danmed commented on GitHub (Dec 4, 2022): Hey, really sorry.. it's been a hectic weekend.. ill try and test the APK in the next couple of days.. as for the options for implementation.. it makes sense to me to have a new priority for it but i do understand the breaking changes this could cause.. On Wed, Nov 30, 2022 at 7:36 PM Philipp C. Heckel ***@***.***> wrote: > @danmed <https://github.com/danmed> Let me know if it generally works for > you. > > There has been a discussion on Discord/Matrix about this feature, and > about whether or not to add a new priority level or a new flag to trigger > this insistent behavior. Here are the options > > 1. Add client-side toggle turn the normal "priority 5" behavior into > the looping sound. No server side changes. > 2. Add new priority Priority: 6 (aka Priority: emergency), which will > by default trigger the looping sound. There would be a cllient-side toggle > to switch this behavior off. This is a little weird, because now the max > priority is not the highest anymore. This requires server side changes, and > may be a slightly breaking change for clients. > 3. Add Insistent: yes header, which will by default trigger the > looping sound. There would be a client-side toggle to ignore this flag. > This is a little off for something like Priority: min; Insistent: yes, > because that would not alert at all. This requires server side changes. > > Arguably, option 1+2 are kind of the same, because they both have a > client-side toggle to turn the behavior off/on. > > Thoughts? > > — > Reply to this email directly, view it on GitHub > <https://github.com/binwiederhier/ntfy/issues/417#issuecomment-1332650484>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AA5S4WSJEJZ5XDDXPP3FFT3WK6UCRANCNFSM6AAAAAAQZGSGO4> > . > You are receiving this because you were mentioned.Message ID: > ***@***.***> >
Author
Owner

@binwiederhier commented on GitHub (Dec 5, 2022):

No worries.

I have pretty much decided to either no release this feature at all, or just the same way that you suggested, with a new option that redefines priority 5 (option 1).

The problem is that I have not had much success getting people to try it. So far two people have tried. It worked for one, and not the other. So rather than releasing a brittle feature that no-one wants, I'd rather not release it at all.

Maybe I can get some more people to test once I have a few more features bundled into an RC.

image

<!-- gh-comment-id:1336594157 --> @binwiederhier commented on GitHub (Dec 5, 2022): No worries. I have pretty much decided to either no release this feature at all, or just the same way that you suggested, with a new option that redefines priority 5 (option 1). The problem is that I have not had much success getting people to try it. So far two people have tried. It worked for one, and not the other. So rather than releasing a brittle feature that no-one wants, I'd rather not release it at all. Maybe I can get some more people to test once I have a few more features bundled into an RC. ![image](https://user-images.githubusercontent.com/664597/205528632-e8bb7825-86e7-4551-af9c-523e055fb430.png)
Author
Owner

@binwiederhier commented on GitHub (Dec 5, 2022):

Current score:

  • Works: @binwiederhier on OnePlus 8 (Android 12) + Emulator (Android 12) + Emulator (Android 13), @cmeis (Android 12)
  • Doesn't work: @nwithan8 (Android 13)
<!-- gh-comment-id:1336599867 --> @binwiederhier commented on GitHub (Dec 5, 2022): Current score: - Works: @binwiederhier on OnePlus 8 (Android 12) + Emulator (Android 12) + Emulator (Android 13), @cmeis (Android 12) - Doesn't work: @nwithan8 (Android 13)
Author
Owner

@wunter8 commented on GitHub (Dec 6, 2022):

Works: @wunter8 on Pixel 5 (Android 13)

<!-- gh-comment-id:1339413993 --> @wunter8 commented on GitHub (Dec 6, 2022): Works: @wunter8 on Pixel 5 (Android 13)
Author
Owner

@binwiederhier commented on GitHub (Dec 8, 2022):

This is now 100% implemented in https://github.com/binwiederhier/ntfy-android/pull/49 -- It includes a per-subscription setting.

I'm going to wait with merging it until I get the Google Play stuff sorted out.

<!-- gh-comment-id:1341851688 --> @binwiederhier commented on GitHub (Dec 8, 2022): This is now 100% implemented in https://github.com/binwiederhier/ntfy-android/pull/49 -- It includes a per-subscription setting. I'm going to wait with merging it until I get the Google Play stuff sorted out.
Author
Owner

@binwiederhier commented on GitHub (Mar 13, 2023):

I forgot to close this ticket. This was merged and released some time ago.

<!-- gh-comment-id:1465358223 --> @binwiederhier commented on GitHub (Mar 13, 2023): I forgot to close this ticket. This was merged and released some time ago.
Author
Owner

@jvandenbroek commented on GitHub (Oct 24, 2023):

Unfortunately this feature doesn't seem to work on my Poco F3 with MIUI 13. Log gives the following traceback:

1698136715441 2023-10-24 10:38:35.441 D NtfyNotifService Media player: Playing insistent alarm on alarm channel
1698136715446 2023-10-24 10:38:35.446 W NtfyNotifService Media player: Failed to play insistent alarm
Exception:
java.io.IOException: setDataSource failed.: status=0x80000000
        at android.media.MediaPlayer.nativeSetDataSource(Native Method)
        at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1210)
        at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1197)
        at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1108)
        at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1028)
        at io.heckel.ntfy.msg.NotificationService.maybePlayInsistentSound(NotificationService.kt:453)
        at io.heckel.ntfy.msg.NotificationService.displayInternal(NotificationService.kt:115)
        at io.heckel.ntfy.msg.NotificationService.displayInternal$default(NotificationService.kt:90)
        at io.heckel.ntfy.msg.NotificationService.display(NotificationService.kt:32)
        at io.heckel.ntfy.msg.NotificationDispatcher.dispatch(NotificationDispatcher.kt:35)
        at io.heckel.ntfy.service.SubscriberService$onNotificationReceived$1.invokeSuspend(SubscriberService.kt:264)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
        at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:749)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

There is no option to make DND exemptions per notification on this ROM as shown by OP, really annoying and I will probably avoid MIUI in the future. However for some reason it does work even without this setting on the Home Assistant app by setting the channel to alarm_stream: https://companion.home-assistant.io/docs/notifications/critical-notifications/#android-alarm-stream

So if the same logic could be implemented in ntfy, I (and probably others) would be very happy :-) Thanks for the great work!

Edit: After some more testing I got it working with the built-in system notifications. Selecting a custom one in shared storage doesn't work when DND is enabled.

<!-- gh-comment-id:1776804613 --> @jvandenbroek commented on GitHub (Oct 24, 2023): Unfortunately this feature doesn't seem to work on my Poco F3 with MIUI 13. Log gives the following traceback: ``` 1698136715441 2023-10-24 10:38:35.441 D NtfyNotifService Media player: Playing insistent alarm on alarm channel 1698136715446 2023-10-24 10:38:35.446 W NtfyNotifService Media player: Failed to play insistent alarm Exception: java.io.IOException: setDataSource failed.: status=0x80000000 at android.media.MediaPlayer.nativeSetDataSource(Native Method) at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1210) at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1197) at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1108) at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1028) at io.heckel.ntfy.msg.NotificationService.maybePlayInsistentSound(NotificationService.kt:453) at io.heckel.ntfy.msg.NotificationService.displayInternal(NotificationService.kt:115) at io.heckel.ntfy.msg.NotificationService.displayInternal$default(NotificationService.kt:90) at io.heckel.ntfy.msg.NotificationService.display(NotificationService.kt:32) at io.heckel.ntfy.msg.NotificationDispatcher.dispatch(NotificationDispatcher.kt:35) at io.heckel.ntfy.service.SubscriberService$onNotificationReceived$1.invokeSuspend(SubscriberService.kt:264) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:749) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664) ``` There is no option to make DND exemptions per notification on this ROM as shown by OP, really annoying and I will probably avoid MIUI in the future. However for some reason it does work even without this setting on the Home Assistant app by setting the channel to alarm_stream: https://companion.home-assistant.io/docs/notifications/critical-notifications/#android-alarm-stream So if the same logic could be implemented in ntfy, I (and probably others) would be very happy :-) Thanks for the great work! Edit: After some more testing I got it working with the built-in system notifications. Selecting a custom one in shared storage doesn't work when DND is enabled.
Author
Owner

@juanrgm commented on GitHub (Nov 30, 2023):

Customizing the number of intervals and delay between sounds would be great.

In the meantime I had to add a delay to the end of the audio track with ffmpeg.

<!-- gh-comment-id:1833448031 --> @juanrgm commented on GitHub (Nov 30, 2023): Customizing the number of intervals and delay between sounds would be great. In the meantime I had to add a delay to the end of the audio track with ffmpeg.
Author
Owner

@gwlg-mjh commented on GitHub (Mar 7, 2024):

Thanks, I was looking for a way to be able to override the silent mode so I can do a find my phone feature with Alexa and Home Assistant and not have to boot up a pc or laptop and do the Google/Samsung version. The only thing I would say is that when I originally saw this option in the settings it wasn't obvious that it would override the silent/vibrate setting on the phone.

<!-- gh-comment-id:1983980856 --> @gwlg-mjh commented on GitHub (Mar 7, 2024): Thanks, I was looking for a way to be able to override the silent mode so I can do a find my phone feature with Alexa and Home Assistant and not have to boot up a pc or laptop and do the Google/Samsung version. The only thing I would say is that when I originally saw this option in the settings it wasn't obvious that it would override the silent/vibrate setting on the phone.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#322
No description provided.