Android Notification - extra options not working (priority, ledcolor, etc)

Hi!
I’m trying to change my notification message by using extra ‘data’ parameter and set priority, ledcolor, vibrationpattern, persistent, etc…but is not working. I can only get a simple notification…no vibration, not persistense, nothing…only a single notification.
I have checked in my companion app, notification are enabled and everything look ok there…running in background is also enabled and configured, so I think app side is ok.
I’m running Android 10.

This is my node test flow:

[{"id":"c081deb9.68962","type":"tab","label":"Alarme / Fumaça","disabled":false,"info":""},{"id":"e646d362.5f757","type":"inject","z":"c081deb9.68962","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":360,"y":640,"wires":[["88e47c4e.960f5"]]},{"id":"88e47c4e.960f5","type":"api-call-service","z":"c081deb9.68962","name":"","server":"2ba92c0c.9dae24","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_mi_9t_pro_jonis","entityId":"","data":"{\t   \"title\": \"Alarme de Incendio\",\t   \"message\": \"O alarme de incendio foi ativado no escritório!\",\t   \"data\": {\t       \"color\": \"red\",\t       \"channel\": \"Alarme\",\t       \"importance\": \"max\",\t       \"vibrationPattern\": \"100, 1000, 100, 1000, 100\",\t       \"ledColor\": \"red\",\t       \"persistent\": \"true\",\t       \"tag\": \"persistent\"\t   }\t}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":760,"y":640,"wires":[[]]},{"id":"2ba92c0c.9dae24","type":"server","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

A lot of those commands especially for the ringer I don’t think their valid. I believe when you set a channel, on your phone, hold the notification and go to settings. You can set different ring tones for each channel.

Edit: I was able to get the volume controls working. First in the app go to the companion app settings. Click on your server. Turn on “Remotely control app and device”.

The other thing that you will need to do is adjust your volume, take note if there are stops. My phone has 7 stopping points on the volume slider. I can only set from 0-7 in the command. If the slider has no stopping points it’s probably 0-100.

{
   "message": "command_volume_level",
   "data": {
        "media_stream": "notification_stream",
        "command": 6
   }      
}
1 Like

Thank you so much for this little nugget of wisdom Mikefila! I’ve been beating my head against a wall with this for over a week now. Having the ability to just do this on the phone side makes this so much easier.

1 Like

Thanks to your Post I understood how to change notification sounds but no matter how hard I tried I couldn’t make it vibrate - did you also make vibration pattern or similar work?

The vibration pattern is able to be set once to a channel. To change the vibration pattern first delete the notification channel from the phone before sending the new pattern. You may need to restart the phone after you delete the channel.

Thanks Mike, nothing’s working, even restart doesn’t help. All I can make work is a sound played when the notification arrives but no vibration.


Do you have “remotely control app and device” enabled in the settings of the companion app? Settings → companion app settings → servers and devices → click on your server name. There should be a switch.