Persistent connection and notifications closing after phone sleeps

I’m not sure if I’m missing anything, but I have the android app and have set battery optimisation to off for the home assistant app and I can send notifications whether connected to internal URL or external.

If I have the Persistent Connection option to Never any notification I send to the phone stays there even if the phone sleeps which is what I expect

if I use the On Home Wifi only option the notification comes immediately but after a while after the phone sleeps it closes and doesn’t raise any mobile_app_notification_cleared event either. The notification indicates it was delivered by Websockets.

Should the notifications be affected by the persistent connection option?

Thanks

taht depends if you installed the minimal build like from f-droid then yes persistent connection is required to get notifications

depending on the device manufacturer you may have more than just battery optimizations to disable. Samsung for example has multiple different things to disable like power saving and data saving etc…

you can also check companion app logs at time of dismissal to see if there was an error sending the event back to the server. Settings > companion app > troubleshooting > show and share logs

I have the full build from the google app store 2027.7.3-full and on a OnePlus 12.

Would the power settings have a difference on the experience whether you have persistent notification to never (and sent to FCM) and On Home Wifi when it sends via Websockets? As when it’s sent to FCM the notification stays?

Currently when I go into show and share logs it only shows the last few minutes so may need to retry - hoping that the logs stay for longer.

Thanks! :slight_smile:

yes battery optimizations (especially extras that are added by some manufacturers) can indeed cause issues with delays and such. Our app should be able to run freely in the background in order to work properly. A good site like dontkillmyapp.com will give some good insights on where to start.

Thanks! couldn’t find some options for the OnePlus - possibly a newer version of the OS than the instructions, but either way it looks like it’s fixed the problem!