Notification trigger when app loses local push connection

I’m using the ‘minimal’ android app on a GrapheneOS phone without google play services. The persistent background connection works well to give me real-time notifications just as if I was using the google back-end. However every now and then (maybe once a month or so) the app loses its connection and I don’t notice. The app works fine otherwise, I’m just not getting notifications. When this happens I have to force-stop the app and restart it. That would be fine on its own, however the problem is that I sometimes go days without knowing that I’m in this state. I’m able to use the HA app and there are no errors reported, so everything looks fine as far as I can tell. However I’m missing out on potentially critical notifications like a water leak being detected.

I was thinking one possible mitigation would be to create a persistent notification when the phone loses its push connection. Since I usually open the app a few times a day, that would allow me to see a notification that I’ve lost the local push connection. However I couldn’t find an entity which corresponds to this state. Does such an entity exist, or is there any other way to trigger a persistent notification (or some other notification that I’ll see) when in this state?

When this was failing, the HA app still said that it was connected to home assistant in the background, and there were no errors that I could find in the mobile app’s logs, but Home Assistant itself knew that it was not connected, as I tried using the developer tools to send a notification to the phone and it failed with an error message stating that the device was “not connected to local push notifications”.

Side-note, I suspect that when this fails, it might have something to do with switching device profiles temporarily. I haven’t confirmed that though.

Thanks,
Mike