home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.63k stars 30.4k forks source link

Local Push functionality does not behave as expected when the device is offline. #127577

Open gthbusrr opened 2 weeks ago

gthbusrr commented 2 weeks ago

The problem

On Android, users can configure Local Push by selecting "Persistent Connection" in the server settings. However, the Home Assistant (HA) server only respects this setting if the phone has an active internet connection at the time the notification is sent. For instance, if I'm in the subway without cell signal, HA will fallback to using FCM.

This fallback behavior is not adequately documented in the official documentation, and I believe it undermines the purpose of offering a Local Push option.

Proposed Solutions:

  1. Implement an option in the notify.mobile_app_xxx service (e.g., no_fallback: true) to prevent automatic fallback to FCM. (Main proposal)
  2. Consider replacing FCM with UnifiedPush for better privacy and control, or ensure FCM notifications are encrypted. (I'm aware that there's already requests on this feature; just mentioning it here as well)

Additional Notes: I am aware that using the "minimal" version of the app disables FCM entirely, but this version lacks critical features like location tracking, making it an impractical solution for many users.

There's already a VERY useful event hook that allows the server to know whether the Android app has received the notification, which could further help refine how fallbacks are handled in scripts / automations.

What version of Home Assistant Core has the issue?

core-2024.10.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

mobile_app

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

Related: https://github.com/home-assistant/android/issues/4683 https://github.com/home-assistant/android/issues/4574#issuecomment-2284589487

home-assistant[bot] commented 2 weeks ago

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (mobile_app) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `mobile_app` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign mobile_app` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


mobile_app documentation mobile_app source (message by IssueLinks)