Delayed notifications

This started a few weeks ago, and I think it had something to do with an update to my phone.

I know it updated to Android 11 and I noticed some delay after that update, and then there was another one or two weeks ago (?) and now Home Assistant notifications are delayed until the phone is unlocked.
I have looked at the battery management, HA is not optimized.
I have disabled the adaptive battery.
HA has permissions to run in background.

What have I missed? Is there some other setting that could help?
This completely disabled my wakeup alarm in the mornings and is quite annoying.

Have you added priority:high, ttl:0 to the data field?

2 Likes

That helped. It went from no notification to about 10-11 seconds.

I’ll see what happens if I leave the phone off for a longer period and try with the intent commands.

No, it still does not work with command messages.
It managed to get one, but the rest does not get through.


This tries to send a new alarm time and waits five seconds and sees if it got set, then loops this until the current state node has the same time as the time sent with the notification.

notification json:

{
    "message": "command_activity",
    "data":{
        "tag": "android.intent.action.SET_ALARM",
        "group":"android.intent.extra.alarm.HOUR:" & msg.hour & ",android.intent.extra.alarm.MINUTES:" & msg.minutes & ",android.intent.extra.alarm.MESSAGE:Wake UP!,android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.VIBRATE:false",
        "data":{
            "ttl": 0,
            "priority": "high"
        }
    }
}

Only when I bumped the phone so that the screen lit up did it manage to receive it.

And when I unlock the phone I get a ton of notifications saying an alarm has been set in 23 hours and… minutes

wait i see the issue disregard previous response.

ttl and priority should be on the data element as tag and group, you nested 1 too many here.

Ahh!! You’re right.
It’s confusing when you have data as call service data and data as data for the notify.
One of them probably should have had a different name, but that’s too late now.

I’ll try that when I get home

1 Like

I think thats more of a general HA issue but yea the amount of data needed can be confusing.

I have tried it a few times and it seems to work.
But I will try it for real on monday morning.