Skip to content

Sensors stop updating, but location updating still works #3550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
alex3305 opened this issue Apr 17, 2025 · 1 comment
Open

Sensors stop updating, but location updating still works #3550

alex3305 opened this issue Apr 17, 2025 · 1 comment

Comments

@alex3305
Copy link

iOS device model, version and app version

Model Name: iPhone 16 Plus
Software Version: 18.4
App version: 2025.1205

Home Assistant Core Version

Applicable to Home Assistant Core 2025.1 - 2025.5

Describe the bug
Sometimes - about half the time - when my wife uses a car for work with CarPlay she loses Home Assistant sensor updates from her companion app. Funnily enough, the only thing that keeps working is the device tracker entity. But all other sensors stop working. So for instance the geocoded location sensor and battery sensor(s) stop working. It only starts working again after restarting the companion app. My wife insists that she stopped using CarPlay, but that's the only common denominator I could find.

Controlling Home Assistant also still works perfectly. Only sensors stop updating.

To Reproduce

  1. Have Home Assistant iOS companion app running on mobile data with Wireguard VPN
  2. Connect to a wifi network that doesn't have internet (ie. CarPlay)

Expected behavior
That a wifi network that doesn't have internet access doesn't break sensor updates. Or at least that the app self recovers or actively retries after a short while (ie. 15 minutes).

Screenshots

Additional context

First of all I should also outline my networking setup. My Home Assistant instance is accessible from the internet through Cloudflare. Cloudflare blocks most regions with it's WAF, but it is reachable from both of our mobile networks. Other hosted services aren't available from the internet and are only available with a Wireguard VPN connection. Which my wife has and is enabled on-demand through the Wireguard app. Only including our home SSID. Internally I also have split DNS setup so that traffic to local containers isn't routed over the internet. This includes VPN traffic.

All of my hosted services / containers are proxied by Caddy and don't have any exposed ports. So we also don't have any internal URL configured. All traffic just goes over HTTPS. This includes HTTP/1.1, HTTP/2 and HTTP/3, both TCP and UDP. Where the latter can be considered a bit exotic for home use 😛 .

I mention this, because I found this Community thread from last year that pretty much describes the same thing: Apple Carplay causing problems with IOS device tracker updates?.

I also have a log dump from her phone from the moment on the day this triggered, but it contains too much sensitive information to share here.

@alex3305
Copy link
Author

alex3305 commented May 5, 2025

I want to clarify some things because of #3575.

  • My Home Assistant instance is reachable from the internet
    • Cloudflare is used for DDNS
    • Cloudflare is used as a WAF
    • No additional authentication or tunneling is used
  • Caddy is used for proxying Home Assistant
    • Caddy uses valid Let's Encrypt certificates
  • Wireguard VPN is mainly used for remote private DNS access
  • Split DNS is setup for local clients
    • Including clients on VPN
    • A-record points to my reverse proxy
    • HTTPS-record points to my reverse proxy

The connection issues on her phone doesn't seem to resolve itself, even after some time has passed. I'm also not 100% sure if this is related to CarPlay, since I have seen this happen a couple of times now when she wasn't working.

In the mean time I have setup an automation that notifies both phones whenever there are issues. Notifications on her phone do come through about 50% of the time even though sensors don't update.

Entity Description
device_tracker.iphone iPhone GPS device tracker from the mobile app integration
device_tracker.iphone_router iPhone Wi-Fi device tracker from the router integration
device_tracker.iphone_ssid iPhone Wi-Fi device tracker from the mobile app integration*
notify.phones Custom notify group that notifies all the phones in the household
person.tracked Person that needs to be tracked and has the device tracker associated with
sensor.iphone_battery_level iOS Companion App Battery Level Sensor

* this is a custom device_tracker that is created and updated from a the mobile app Wi-Fi sensor.

- id: notify_mobile_app_issue
  alias: Notification - Mobile app issue
  mode: restart
  variables:
    device_id: "{{ device_id('device_tracker.iphone') }}"
    message_title: "📵 Problem with iPhone"
    message_body: >-
      This iPhone should be at home, but it's not updating any sensors.
    message_tag: "mobile_app_issue"
  triggers:
    - trigger: state
      entity_id: person.tracked
      to: "home"
      for:
        minutes: 15
  conditions:
    - condition: state
      entity_id:
        - device_tracker.iphone_router
        - person.tracked
      match: "any"
      state: "home"
    - condition: state
      entity_id: device_tracker.iphone_ssid
      state: "not_home"
  actions:
    - parallel:
        - action: notify.phones
          data:
            title: "{{ message_title }}"
            message: "{{ message_body }}"
            data:
              ttl: 0
              priority: high
              tag: "{{ message_tag }}"
              push:
                sound:
                  name: default
                  critical: 1
                  volume: 0
              actions:
                - action: "URI"
                  title: "Device"
                  uri: "/config/devices/device/{{ device_id }}"
        - action: persistent_notification.create
          data:
            title: "{{ message_title }}"
            message: "{{ message_body }}"
            notification_id: "{{ message_tag }}"
    - wait_for_trigger:
        trigger: state
        entity_id:
          - sensor.iphone_battery_level
          - sensor.iphone_ssid
        to: null
      timeout:
        hours: 6
      continue_on_timeout: false
    - parallel:
        - action: notify.phones
          data:
            message: "clear_notification"
            data:
              tag: "{{ message_tag }}"
        - action: persistent_notification.dismiss
          data:
            notification_id: "{{ message_tag }}"

This automation triggers about every day. Closing and re-starting the iOS app instantly resolves it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant