Mobile App Device Polling is Slow

I have Home Assistant app installed on my Android phone; and all works well, all sensors are enabled.

Problem that I am having is I have an automation setup that when any of my devices (car, laptop, phone) return home, to turn all my lights on (assuming that I came home after a not_home > home state change).

The automation itself works fine, but I could be sitting in the dark for 10 minutes sometimes before they kick on from a device poll update.

Obviously, this time delay is unacceptable. I am not quite sure how to reference this “platform” in my configuration.yaml, as this is really a “Mobile App” Integration; but am I still able to configure / overwrite default scan_interval / polling_intesity for this under mobile_app:?

I have unrestricted background data enabled on my phone; again, the polling is just terribly slow sometimes.

If it helps, I connect (externally) over Nabu, and internally (when on Wifi). There is no communication problem; as I use MyQ for my garage, and it works great too (instant response off Wifi).

If you are looking to see when you are home and the device tracker is too slow then use the WiFi connection sensor as that will update as soon as your phone connects to WiFi

I attempted to do this; could this be improved? I am assuming yes, as I never receive that notification; but it does show in the history where it was triggered.

- id: '1597864561298'
  alias: Update GPS Location
  description: ''
  trigger:
  - entity_id: cover.garage_door
    platform: state
    to: closed #MyQ state "closed" when cover transition completes; opening when in motion
  condition:
  - condition: state
    entity_id: person.<my_name> # Real name redacted
    state: not_home
  action:
  - data: {}
    entity_id:
    - device_tracker.pixel_4_xl
    - sensor.pixel_4_xl_geocoded_location
    - sensor.pixel_4_xl_wifi_connection
    service: homeassistant.update_entity
  - data:
      message: Automation Triggered
      title: Updating GPS...
    service: notify.mobile_app_pixel_4_xl
  mode: single

I added this condition in; based on your recommendation. I will see how this works.

trigger:
  - entity_id: cover.garage_door
    platform: state
    to: closed
  - entity_id: sensor.pixel_4_xl_wifi_connection
    from: <not connected>
    platform: state
    to: <WiFi SSID>

These entities do not get updated like that. They send updates as they have them. HA has no current way to communicate to the device asides from sending a notification. The wifi connection sensor updates its state as soon as the network change has been detected. This step is unnecessary for that. Just use the wifi sensor as a trigger for when the state changes to your network name and it should be what you are after.

2 Likes