When starting with HA I decided to use the HA Companion app as notification service, so now all my notification automations are based on HA Companion app.
What I meanwhile discovered: if none of the receiving devices is online, sent notifications will never be received.
Example:
During the night at 3 o’clock a notification is sent
The (first) receiving device(s) exit flight mode at 8 o’clock. They receive nothing. Doesn’t matter if iOS or Android powered.
I also noticed, that short-time notifications (about 30 to 60 minutes back in time/previous to exiting flight mode) are received in the same scenario. So if a notification is sent at 07:45 and the device is powered on at 08:00, it receives the notification.
1) Is this a known limitation? 2) Something I can or need to configure? 3) Or is this “working as expected”?
I’m thinking of how to work around that, because some notifications are pretty important meanwhile and I need to be aware of a certain situation asap. Using persistent notifications etc. is not suitable by the way, as they need an active action (opening HA).
Is your phone in flight-mode overnight or “Do Not Disturb”? Newer versions of iOS only turn off cellular on flight mode, and leave wifi on (I think unless you have turned off wifi before, in which case it remembers?).
Assuming it’s “Do Not Disturb” which is controlled under “Settings > Focus”, you can tell it allowed apps that can still send messages. I use Telegram for notifications, and have DND from midnight to 8am with Telegram as an allowed app, and this works for me.
That’s exactly what I’m looking for, yes As stated, this works for short-term notifications sent maybe one hour before exiting flight mode (longer ones e. g. from during the night never arrive at my devices… )
For now I worked around this by additionally bypassing the more critical notifications with PushingBox and therefore separate iOS and Android apps and via eMail.
But that’s just a workaround. Would love to only use HA Companion app („all from one hand“ approach).
I never experienced that behavior with other apps before but I haven’t used Flight Mode in years as DND suits me well as I have several people that are starred in my whitelist that could call me at night.
I would test it for you but as you said 1h old notifications are being received…sorry.
Well there are times everyone is offline. On the airplane, when switching your phone, in jail, … just think about it
After a few weeks with my workaround (additional notification path / bypassing HA companion app) I tend to say: the workaround failed. Because: during the day when my receiving devices (iDevices) are online, I receive notifications twice or even more. Gets quite annoying sometimes.
before: no notification at all (during night when in flight mode) → bad
Do I need to raise an issue on GitHub for this (not sure about that)?
Optimizing the workaround: how to check, if a notification device (service notify.mobile_app_something) is actually reachable / currently able to receive notifications?
I would then let Home Assistant check this first and decide if it needs to bypass the default notification path (HA companion app) or not.
Apple’s push notification service generally stores the latest 1 notification, with some variation for threads that I can’t recall offhand. You should assume notifications sent while offline are not guaranteed to be received.
In theory the app could fire an event when it processes a push (remote or local) notification, but this does not currently exist and this is the first use case that it could potentially make sense for - confirming receipt of message. You would need to wait for that event to fire or time out, and if timing out send via another means. Please file a feature request for this.
Meanwhile the Android app has exactly implemented this, shipping in latest 2022.8.0 app release.
I could verify it by listening to the mobile_app_notification_received event in the events tab of the dev-tools section. Works fine , really EXACTLY what I’m looking for (and @zacwest recommended)! Except it’s for Android, not iOS
Here’s the feature request for implementing the same for iOS:
(@zacwest: I cited a part of your former post there, please tell in case that’s not okay for you)
Remaining questions:
How can e. g. an automation check if such an event was received so I can assume (after a timeout of e. g. 60 seconds) the device is not reachable and take other measures?
Any idea on how to get some traction on the iOS feature request (link see above)? To everyone reading this: feel free to support that idea by voting it up. Thx!
Due to lack of process on this I meanwhile implemented a workaround:
Parallel persistent notifications to be more independent of HA Companion app based notifications
Adapt all notification automations to only use separate/parallel notification services (e. g. PushingBox) for critical events if iPhone and another device is not at home
This way I’m a bit more independent of HA Companion app based notifications and at the same time reduce redundant notifications to a minimum, basically the persistent notifications serve as “log book” so the root issue here (only last missed notification being delivered once iDevice is online again) is worked around.