iOS
iOS copied to clipboard
Local Push becomes disabled and cannot become re-enabled until iPhone is rebooted
Model Name: iPhone 15 Pro Software Version: 17.1.2 App version: 2023.12.1
Home Assistant Core Version 2023.12.4
Describe the bug For the last 2 days, the Battery State Sensor no longer immediately updates when the phone is charging or taken off of a charger, while HA is in the background. The sensor updates immediately if HA is in the foreground. Before a recent HA iOS App update (before 2023.12.0 or before 2023.12.1, I'm not 100% sure) this sensor would update immediately even with HA in the background.
To Reproduce Put HA iOS app in the background, plug phone into charger, see that Battery State Sensor does DOES NOT update. Put HA iOS app in the foreground, plug phone into charger, see that Battery State Sensor DOES update.
Expected behavior Previously, the sensor state would update immediately when the phone was put on, or taken off of a charger, even if HA was in the background.
Additional context This bug is present on both iPhones in our household (same model and versions). I could work around this with a iOS shortcut, sending events when charging or not, but I'd rather not set that up if this is a simple regression that will quickly be fixed. If it WON'T be fixed soon, please just let me know so I can go the shortcuts route, and get my automations working again. Thanks!
As we have in the documentation:
On iOS, sensors update in limited situations: when your location changes, periodically when the app is running in the foreground, when you pull-to-refresh the web view, in the background at a rate determined by iOS, and when performing an "Update Sensors" or via "Send Location" shortcut or push notification.
https://companion.home-assistant.io/docs/core/sensors/
I also just ran an older version of the app and at least to me it behaves the same. Let me know if you endup not having updates in background ever.
To achieve what you want we may need to implement https://developer.apple.com/documentation/BackgroundTasks which is currently not supported in the App.
Hi Bruno,
I'm going to have to disagree with you strongly here, as until 2 days before I opened this issue, I used this sensor extensively and it always updated instantly.
Since this was not an intentional change, unless this was caused by a change in iOS, this is definitely a regression.
For as long as I've used home assistant, I have had it set so that my wife and I both putting our phones on our nightstand chargers (when other conditions are met) puts our house into "Night Mode" which kicks off over 50 other tasks (turning off lights, changing thermostats, etc).
When we both remove our phones from the charger in the morning, it brings our house out of "Night Mode" which kicks off over 50 other tasks to get our home ready for the day.
We've been using this iOS sensor for this, twice a day, and it has always updated in less than a second, until 2 days before I filed this issue, which was also around the time the iOS app was updated.
Happy to help debug this further.
Hi Bruno,
I'm going to have to disagree with you strongly here, as until 2 days before I opened this issue, I used this sensor extensively and it always updated instantly.
Since this was not an intentional change, unless this was caused by a change in iOS, this is definitely a regression.
For as long as I've used home assistant, I have had it set so that my wife and I both putting our phones on our nightstand chargers (when other conditions are met) puts our house into "Night Mode" which kicks off over 50 other tasks (turning off lights, changing thermostats, etc).
When we both remove our phones from the charger in the morning, it brings our house out of "Night Mode" which kicks off over 50 other tasks to get our home ready for the day.
We've been using this iOS sensor for this, twice a day, and it has always updated in less than a second, until 2 days before I filed this issue, which was also around the time the iOS app was updated.
Happy to help debug this further.
No worries, let's try to find what changed; I know when local push is activated, it also updates sensors more often, but I don't see in the codebase any trigger based on battery/charge state; there is one, but it works only in the foreground. @zacwest Am I missing something here?
Local Push is the only way this can update immediately. We observe and immediately update if we see changes but on iOS this means Local Push or something else.
Might be worth double checking the notification update isn't changing behavior or Local Push just isn't informed under Xcode 15. Linked-on-or-after checks are pervasive in SDK updates.
It would definitely be local push in my use case since my wife and I would be home and on our home WiFi.
Which made me go check and make sure local push was working as it should and I saw: Connected via: Internal URL Version: 2024.1.2 WebSocket: Connected Local Push: Disabled
Uh, that's odd. I check under Internal URL and make sure Local Push is enabled and the SSID is my home SSID and I am on WiFi. All is correct.
I kill and restart the Home Assistant app a few times, Local Push is still Disabled.
I reboot my phone, after making no changes, start the HA App and Local Push is now: Available (0)
I plug in my phone here at my desk and the HA sensor immediately updates 🎉
So it looks like the real bug here was that Local Push somehow got disabled when the app updated and it took a reboot to fix it? Why did this happen I wonder? Will this happen again? Do we need some recovery logic here?
I can check my wife's phone when she gets home, but since hers was behaving the exact same way, I expect her Local Push is also currently "Disabled" and she has not rebooted since this began happening.
I confirmed on my wife's phone that she also had Local Push: Disabled despite having all the correct settings. Just like with my phone, a reboot without changing any settings got Local Push activated again.
She has not rebooted her iPhone since before Christmas, and this issue started happening on both of our phones on the same day (likely after we received the latest app update, 1st or 2nd of Jan, not sure exactly which).
Was this a one time issue related to the latest update? Or is there a bug that will disable local push until the phone is rebooted under some unknown circumstance?
I propose changing the name of this issue to something like "Local Push becomes disabled and cannot become re-enabled until iPhone is rebooted"
I see the same behavior on my iPhone too, I will investigate
Not sure yet the reason for that but the Local Push becomes available again for me after sometime, did it happen to deactivate again to you? If it does please (if possible) don't manually force it to reactivate, wait a few hours or a day and let me know more less how long it took.
Not sure yet the reason for that but the Local Push becomes available again for me after sometime, did it happen to deactivate again to you? If it does please (if possible) don't manually force it to reactivate, wait a few hours or a day and let me know more less how long it took.
I just noticed it's disabled again while I'm at home, on WiFi. I'll try to keep an eye on it and let you know approximately when it becomes enabled.
No info yet on what is causing it to get disabled?
Also, I use HA push notifications fairly extensively. Would local push being disabled also cause notifications to be sent via Apple's servers, using up my daily quota and causing a noticeable (few second) delay?
I'm having the same issue and an iPhone reboot does not fix it. Local push has been disabled for days now, but is enabled on my wife's iPhone with the same app configuration as me. I am running app version 2024.2.1 and I've only noticed it since upgrading. iPhone is a 12 Pro and running 17.2.1. Wife's is an iPhone XR also on 17.2.1 I tried deleting the server in the app, killing off the app and then rebooting, but my app is always showing as disabled for local push. Tomorrow I am going to rey deleting the app from my phone and then reinstall it. I'll let you know if that has any effect. Let me know if there is any debug information I can provide to help diagnose.
I deleted the app from my iPhone this evening. Rebooted my phone, then re-added the app. Local Push is now working for me 👍 Hopefully this won’t happen on the next update.
Can someone check if the issue is resolved on 2024.4? I wasn't able to reproduce it anymore
2024.4.4 same issue. No local push. Reboot phone and it comes back. IOS 17.4.1. Thanks.
I have the same issue: every once in a while my iPhone continues charging to 100% instead of the 85% I set up in an automation. Every time it is due to local push showing disabled, despite being connected to the internal URL with web sockets connected. I can only fix it by restarting the phone. I’ve been having this issue for more than a year now.
It happened again this morning (which is the reason for me trying to find a solution again).
I’m on version 2024.6.4. I just noticed the app updated today. Might this be the cause?
This issue reappeared for me again a couple of times. Each time I checked whether or not the app was auto-updated by iOS. And sure enough: it was updated every time I had this issue. I'm now fairly confident that the update causes Local Push to stop working.
This issue reappeared for me again a couple of times. Each time I checked whether or not the app was auto-updated by iOS. And sure enough: it was updated every time I had this issue. I'm now fairly confident that the update causes Local Push to stop working.
Unfortunately I've just become accustomed to this being broken ever since I opened this issue. Sometimes I think it might be fixed only for it to come back. Your theory of it being related to the HA App updating makes a lot of sense.
It seems most people must not use (or are unaware of) the benefits of local push and do not notice. It's extremely annoying, but does not seem to be a priority for the developers since it's been nearly a year now, with many app updates, and this still hasn't been fixed.
It seems to me that local push should always be enabled when connected to HA's internal URL. If we are connected to the internal URL, but local push is disabled due to an error (or bug that cannot be found), local push should be restarted and the websocket to the HA server should be reconnected (perhaps with an exponential backoff) to try and recover from this.
Since it's been so long without a fix that this is one of the biggest things making me consider switching back to Android so I can get a usable and reliable connection to my HA server again...
Same problem running Home Assistant Core 2025.5.3 on HAOS 15.2 with an iPhone running iOS 18.5 with companion app 2025.5!
@bgoncal any new ideas based on the theory that this is caused by App Store updates?
Once the App Store updates the companion app, local push will be disabled until iPhone reboot 100% of the time for me since I originally opened this issue, had it happen again earlier this week.
Similar to @tholland15 my local push becomes disabled after companion app update until device is rebooted.
Have seen it two times now on iPhone and iPad.
@tholland15 No updates to share unfortunately when there is a difference in behavior by force closing the app compared to rebooting the phone, usually it's a hunch that the issue is on Apple's plate, but I am still looking into it.
You can help me by exporting your companion app logs right after the issue starts happening and submiting here https://forms.gle/Uoqz127Phx4mMTpS6
You don't have to reboot the phone, you can just turn on Local push in the companion app settings and restart the app. The update seems to turn local push off as you know, requiring user to turn it on again. I will upload logs, edit - upload link for logs not active
Same thing happening here, local push on iOS gets disabled after every companion app update (interestingly the local push toggle in the settings remains enabled though).
Rebooting the phone is not necessary, it should be enough to just force close the app and re-open it (not sure if it's necessary but I manually disable and re-enable the local push toggle beforehand as well).