Help, iPhone Sensors/entities on HA update only if Companion app is open, is it normal?

Just discovered this issue with my Google Pixel 6. Charge level automation isn’t running until I open the HA app.
It’s got unrestricted battery access.

Any solution to this?
Thanks

I stumbled upon this thread because I had the same issue with HA iOS App not refreshing the sensor when in background.

I granted the app all the permissions that it requested and further checked that the app has full access to all features. Did not help refreshing the sensors when the app was not opened and in foreground.


Update: Did not work…


tl;dr

In iOS Settings:

Check iOS settings (General>Background App Refresh): Is it enabled for WiFi and Mobile Data and the HA App?
Are the permissions fully granted in the iOS Settings? (e.g. Always sharing location)

In HA App:

Check periodic update frequency in Sensors Tab in HA App Settings


Solution in my case: (screenshots are after changes were applied)
In the HA App Settings>Companion App>Location the entry “Background refresh” was Disabled.

When clicking on it, the iOS Settings opened and showed the permissions page for HA App.
In my case, “Background App Refresh” was greyed out. =>> iOS Background App Refresh was disabled globally.

So under iOS Settings>General>“Background App Refresh” I set it to “WiFi and Mobile Data” and activated it for HA.

When heading back to the HA permissions page, Background App Refresh was enabled.

I further changed the update intervall in the HA App settings to 2 minutes.

Now it seems to work for my setup. :slight_smile:

Mine’s magically started working fine without needing the android app open for phone status updates.

I’m having this problem on iPhone. When I used to put my phone into ‘Sleep Focus’ which triggers Focus Mode “ON” it would immediately set off my bedtime automatons. However, now I then have to open the HA app to do it. What’s changed?

I am new to HA and I am facing this problem where I am unable see updated sensors on my HA dashboard when my phone is not connected to home WiFi.

All the permissions are correctly setup (with full access background etc.)
When I read the Sensor section under iOS HA app I see the below message. It says it works only when the app is running in “Foreground”. Is it true? If yes, what’s the purpose of HA app for updating sensors like battery and location.

Please suggest if I am missingsomething. Thanks!

I got the same problem as indiandarkhorse. I just got my connection going to my home assistant through a reverse proxy, and I can control things in my house when I’m not at home. But the sensors are not getting updated.
I have as well allowed everything and double-checked all permissions.

When I’m at home in my Wi-Fi network, everything works fine. I haven’t had a chance to test if it works while I’m not in my Wi-Fi network.

Okay, I Solved my problem. The issue was that the app after authentication with authelia makes rest-api calls to mydomain.com/api . And while I can authenticate the browser engine in the app with authelia I cant do that to the rest api calls so authelia was telling me that:

time="2023-09-10T10:26:57Z" level=info msg="Access to https://homeassistant.mydomain.com/api/webhook/[someID] (method POST) is not authorized to user <anonymous>, responding with status code 303 with location redirect to https://auth.mydomain.com/?rd=https%3A%2F%2Fhomeassistant.mydomain.com%2Fapi%2Fwebhook%2[someID]&rm=POST" method=GET path=/api/verify remote_ip=10.10.10.1

so I needed a new router in authelia for API calls that bypass authentication. My config in authelia looks something like this:

http:
  routers:
    homeassistant:
      rule: "Host(`homeassistant.mydomain.com`)"
      service: homeassistant
      entryPoints:
        - https
      tls:
        certResolver: letsencrypt
      middlewares:
       - auth

    homeassistant-api:
    # this is for API access to homeassistant without it access through the APP would not work
    # because we need to disbale the auth middleware for api access!
        rule: "Host(`homeassistant.mydomain.com`) && PathPrefix(`/api`)"
        service: homeassistant
        entryPoints:
          - https
        tls:
          certResolver: letsencrypt

  services:
    homeassistant:
      loadBalancer:
        passHostHeader: true
        servers:
          - url: "http://localip:8123/"

As you can see, the second router is simply missing -auth as a middleware