please advise what to set.
I have set up automation to send notifications to my mobile phone (Galaxy S10e, Android 11).
Automation works properly, but notifications on the mobile phone are displayed when I unlock the mobile phone. Respectively, when I wake up the phone.
I have notifications enabled on the lock screen, Home Assistant has background activity enabled, battery optimization is off.
I don’t know what else to set up.
As soon as I wake up the phone, all the notifications will come.
I forgot the line “data.”
Automation was already functional after adding the “data” line, but the notification still did not appear on the sleeping phone. The notification came when I woke up the phone manually. I had to enable the adaptive battery in the phone settings and remove the Home Assistant application from the list of applications that are not optimized in the special access settings. Furthermore, in the developer options in the application section in standby mode, it is necessary to verify that the Home Asssistant is in the ACTIVE category. Now the notification is OK. A sound sounds and the icon is displayed on the Always on display. The whole display does not light up (eg as when an SMS arrives) but it does not matter.
I dig this one up, because I have the same issue, also with a Samsung phone.
I tried every channel and configuration listed in the documentation (Critical notifications | Home Assistant Companion Docs) but nothing works. On my Samsung S9 / Android 10, I only receive the notification if I unlock the phone. If the phone is locked, no notification comes through. Not even the LED starts blinking, nor a vibration pattern works.
If the phone is unlocked, I get the vibration (however vibrationPattern seems to have no effect…) and the notification is shown immediately.
This is the configuration I use in the automation:
action:
- service: notify.mobile_app_sm_g960f
data:
title: Coffee!
message: I need coffee!
data:
ttl: 0
priority: high
media_stream: alarm_stream
channel: alarm_stream
importance: high
notification_icon: mdi:coffee-maker-check
visibility: public
ledColor: red
I do not see why it should not work?
The App is removed from the battery optimization. I checked the DND overwrite for the alarm_stream channel.
Is this yet another Samsung power saving feature, which hinders the notification to show?
HA core: 2023.06.1 / App version: 2023.3.0-full
edit: All of a sudden it started to work - kind of. I get now a vibration (but still not the vibration pattern) but the LED is not blinking (It is when using the alarm_stream channel but always red. Looks like the color cannot be overwritten here?). What also does not work is to overwrite the ringer so that I get a acoustic ping on the notification. The media_stream: alarm_stream should do that - or not?
I also had to add channel: alarm_stream to the data, otherwise it would go into the General channel…
Resurrecting this Old Post since it’s the first one I found related to my issue.
On my pixel 9 Pro XL phone, I have the home assistant app set to not battery optimized, allow background usage, all notification content on lock screen, and to notify on several notification channels.
For example I have several time sensitive security related automations using the critical Channel and I do not receive these in a timely fashion when the phone screen is off and locked.
But when I awaken the phone screen and unlock it, the notifications then arrive immediately.
It appears to be a known issue across Android phones and I was hoping someone new of a fix.
UPDATE:
I added TTL in priority to my automation action section as shown below. Let’s see if this resolves the issue.
- action: notify.mobile_app_pixel_9_pro_xl
metadata: {}
data:
message: "Backyard Slider door left opened! "
data:
channel: Critical
ttl: 0
priority: high
UPDATE:
Adding ttl and priority like above appears to have resolved the issue with me getting immediate Audible notifications when my screen is off and locked.
I can also confirm that new Android 15 ‘notification cooldown’ feature does not negatively impact this either.