[Fixed] Problem: Notifications extremly delayed (after update?)

The only pattern I can reproduce:
When the smartphone display is on (e.g. while I'm using it), the notifications arrive immediately.
When the smartphone display is off, it takes up to 10 minutes. But when I than unlock my smartphone the delayed Hubitat notifications are all arriving at the same time.

I just tried that and I still get the notification, although with a delay of a few seconds versus when the screen is on and unlocked.

It seems completely random... :confused:

I was having the same issue, and I was blaming the Samsung update in January to Android 11, but maybe the blame is in Hubitat?

Anyway, I found a temporary fix (temporary because you have to reapply after each phone reboot), which is to disable Doze via adb.

The command is adb shell dumpsys deviceidle disable

It fixed the issue for me and I'm getting instant notifications from Hubitat now.

But doesn't this disables Doze for all apps?!? :open_mouth:

Regarding the official documentation you (should be able to?) activate Doze on a per app basis via "Battery Optimization" - and that's exactly that, what we all have already tried. :cry:

But reading the Google dev docs on notifications I've found this statement:

"The App developer is able to define how important the notification is for the user [...]"

Maybe the app needs a little change to set it's notification importance to high (i.e. NotificationManager.IMPORTANCE_HIGH)?

@support: Have you checked this? :point_up_2:

More:
https://developer.android.com/training/monitoring-device-state/doze-standby

Yes, I think the priority is the main issue.
But as a troubleshooting step you should try the doze disabling I suggested, it is reset after a reboot anyway.
I agree that disabling doze as a whole is not ideal, but especially at this time that most people are at home, I personally don't care that much about battery life and would rather have timely notifications
I also tried using adb to whitelist the Hubitat app package on doze, but I still had the delay

2 Likes

As anyone found a fix for this, mine are very delayed on android, s10, latest beta
@bobbyD

Read my message above about adb

Just as a data point mine are delayed again. I'll take a look at the workaround above. App 1.5.3, Android 10.

That makes no sense to me, I've gone into the power management settings and confirmed its not being optimised

1 Like

I did the same, but it was still delayed. Disabling via adb solved it

Whats adb

https://www.xda-developers.com/what-is-adb/

Thank you all for your feedback. We were able to replicate the problem and our developers are exploring options to optimize the app for the doze cycles.

6 Likes

UPDATE: this issue has been resolved. Notifications should be working as expected even when the phone is sleeping.

7 Likes

@bobbyD

Seems back to normal from what I can see!!! Thanks :+1:

@Jost perhaps replace problem with resolved or fixed in title of post. Thanks for bringing it up initially

2 Likes

Thanx a lot! :+1: :beer:

As a software developer I have to ask:
What have you done to fix the problem?

Obviously there was no update involved... :thinking:

We changed how important the notification is :slight_smile: It seems like Google fixed a bug in a recent release and actually enforce the priorities that have been omitted (and ignored by some developers) since Android 6 :slight_smile:

3 Likes

:laughing: :+1:

OK... but without changing the app or Hubitat? :thinking:

I thought my notifications are local (apart from Google's part), i.e. my Hubitat sends notifications via FCM to my smartphone app?

Confirmed resolved, all notifications working this morning as expected. You guys rock!

Download the Hubitat app