Trying to add data for critical notification before action node

So I try to set up notifications for the fire alarm, and I want them to be critical (skip DnD, make sound if possible, and be displayed highest)

I want to add this data to a node before the notify action node.
So this is my setup:
image

[{"id":"99a13d0a8f178d5c","type":"inject","z":"49abe2a263c909c4","name":"Test alarm","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":160,"y":900,"wires":[["7bbdf3ab2a674453"]]},{"id":"7bbdf3ab2a674453","type":"template","z":"49abe2a263c909c4","name":"Melding","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n  \"title\": \"🔥 Varsel: Brannalarm\",\n  \"message\": \"Sensor oppdaget røyk!\"\n}","output":"json","x":400,"y":900,"wires":[["8bb47128b9f50769"]]},{"id":"8bb47128b9f50769","type":"change","z":"49abe2a263c909c4","name":"Add Critical","rules":[{"t":"set","p":"payload.data","pt":"msg","to":"{\"ttl\":0,\"priority\":\"high\",\"importance\":\"high\",\"persistent\":true,\"channel\":\"alarm_stream_max\",\"sound\":\"default\",\"push\":{\"sound\":{\"name\":\"default\",\"critical\":1,\"volume\":1}},\"interruption-level\":\"critical\"}","tot":"json"}],"x":570,"y":900,"wires":[["8cdb196e67ee91a7"]]},{"id":"8cdb196e67ee91a7","type":"api-call-service","z":"49abe2a263c909c4","name":"Notify Flemming","server":"fee63bd.14801c8","version":7,"debugenabled":true,"action":"notify.mobile_app_fleska_tlf","floorId":[],"areaId":[],"deviceId":[],"entityId":[],"labelId":[],"data":"{\t  \"title\": payload.title,\t  \"message\": payload.message,\t  \"data\": payload.data\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":true,"domain":"notify","service":"mobile_app_fleska_tlf","x":860,"y":900,"wires":[[]],"info":"Legger til overskrift og sender varsel med melding fra template noden."},{"id":"fee63bd.14801c8","type":"server","name":"Home Assistant","addon":true}]

The thing is, It will send me the message, but it does not make sound if on DnD, not on Android, not on iOS.
Also, it looks like data is double, and idk how to fix that:

I have tried asking ChatGPT also, but even he is stuck and just repeating himself at this point.

Question:

  • Can I combine iOS and Android on the same Change node as I do?
  • Are all the parameters valid/needed?
  • Why does it not act critical?
  • How do I avoild the double-data sendt in the last node?

There is a difference between iOS and Android notifications; see the Companion Apps Notification documentation (the android Notification Channel Importance is the key difference from the iOS Interruption Level).

No. You will need a separate action node for apple and android. importance: high is used only if the android os is <= 8.0. Use priority: high for modern phones.

sound: is an apple only option.To set the notification sound in android, long press the notification and you can set the default sound there.

https://companion.home-assistant.io/docs/notifications/notification-sounds/

If you look through the documentation you will see an apple or android icon next to an option. This will tell you which os you can use it for.

https://companion.home-assistant.io/docs/notifications/notifications-basic

I have read the docs, and tried all kinds of combinations data values, now it is just comming as normal silent notifications no matter what I do.
Before I got it silent, but at the lock streen, that is not the case anymore.

I have a Samsung Galaxy S23 Ultra, Android 14.

Well that is an android phone so what you will need for a text to show up asap

{
   "message": "your message",
   "title": "your title",
   "data": {
       "ttl": 0,
       "priority": "high",
       "channel": "new_channel"
        }
    }

channel: sets the channel’s ttl and priority setting to those set in the data. This is set the first time the phone receives a notification to that channel. If you long press the ha app icon and choose notifications, it will show all your channels.

clicking a channel like “General” or “hasound” will let you set the notification sound. Try creating new channel by using a new name. Once a channel is set to certain priority/ttl it cannot be turned up to higher level.

Can’t find That, this is my menu

Edit: IT had to be enabled

EDIT:
So, I made rhis, but still no sound, or on lock screen. Just acting as a normal notification with nothing extra.

{
    "ttl": 0,
    "priority": "high",
    "channel": "alarm"
}
1 Like

I can only assume there is another setting that you need to change, that admin permission you needed to enable is not on pure android. Samsung adds a bunch of crap to the android os.

They add their own battery savers that required additional steps to disable, bs can stop/slow notifications. This site used to track these added app killing programs but it has not been updated in a while. It may still be applicable.

I see in this thread it looks like the only “solution” is to adjust the volume before sending the notification.

And I see this guy has the same issues:

And this guy on facebook: Home Assistant | Hello everyone. | Facebook