UnifiedPush allows multiple, different apps (like Home-Assistant) to use a single notification push server which a user can configure. It is like Google’s Firebase Cloud Messages, however with the difference that users can choose, which “distributor” they choose and what servers they trust to relay their notifications. However, it is overall better than using a direct Websocket connection to the Home-Assistant server itself because (assuming many apps are using UnifiedPush like FCM) the phone of the user is only required to maintain a single connection (in difference to every app maintaining their own) which saves battery & cellular data usage.
You can find more about the original concept here.
UnifiedPush was already discussed in issue #1480 for Home-Assistant Core (cannot post a link as new users can only post 2 in the beginning).
It was an idea to solve the problem that F-Droid users were not able to receive notifications at all. Still I think implementing UnifiedPush would improve Home-Assistant more.
UnifiedPush is already implemented in other Android apps. One example is Element for Android.
What would be required to implement? The Android client would need to check for any UnifiedPush distributor installed, would need to register itself there. It then receives a push URL as target for HTTP requests and needs to inform its Home-Assistant Server about this new push URL. The Home-Assistant Server (probably implemented in the Core) would need to save this URL and push future notifications to this client via the given URL.
For Android, there is already a library implemented which can do this in a similar shape like the official FCM library by Google. There is also one version which can automatically fallback to FCM if no UnifiedPush provider can be found on the device. You can find information for Android developer at the official UnifiedPush page and it probably helps to see what Element needed to change (see PR linked above) to migrate from FCM support only to UnifiedPush + FCM support.
Sadly, I’m not a Android developer, so I hope to find someone who might can implement this to Home-Assistant. When I have enough time, I could try to implement it, however, without guarantee. I should be able to assist in testing the feature.
I second this feature request. Those of us who don’t have Google Play Services — pretty much all of the privacy-on-Android community, such as GrapheneOS users and more — can’t get notifications at all unless UnifiedPush is implemented.
This paragraph is more or less on the money. There needs to be an API endpoint in HA that receives the NTFY/UP POST URL + an encryption key, and that API endpoint needs to associate the URL with the Companion client. Then, when HA needs to send a notification, there needs to be an additional implementation of push that looks up the POST URL then POSTs the necessary data through the UP server (encrypted with the pre-agreed key). The Companion app would then receive the notification from the distributor, decode it using the pre-agreed key, and process the data as usual using the same routine that processes push messages today.
unfortunately its still not that simple, the current mobile_app integration is still dependent on firebase and if not using local push will default to doing things like rate limiting notifications. Considerations will need to be made in the integration before the app should support it.
Yep, part of the ask is to let the mobile-app integration be informed by companion clients what backend to push to, and if the selected backend isn’t firebase but rather ntfy, then it should do the ntfy push thing instead.
Adding my support for UnifiedPush as well, though, as being able to untangle myself from depending on Play Services being enabled at an application level would be far better than hacking on push notifications via an add to my config.