Skip to content

Commit

Permalink
Update background explanation (#476)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomBrien authored Mar 12, 2021
1 parent 74b264e commit a7771e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/core/sensors.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The sensors provided by the companion app are:
![iOS](/assets/iOS.svg)and ![macOS](/assets/macOS.svg)Sensor List

:::note Sensor Updates
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, and when performing an "Update Sensors" or "Send Location" shortcut or push notification.
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.

On macOS, sensors update in the same situations as above as well as immediately when some sensors change.
:::
Expand Down
6 changes: 5 additions & 1 deletion docs/troubleshooting/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ If you have more than 1 device of the same model and you did not rename your dev
3. Restart Home Assistant to register the new notify service call. (i.e. `notify.mobile_app_<device_name>`)
## Sensors are missing or not updating
![iOS](/assets/iOS.svg) When the app is not in the foreground, sensor updates are tied to location updates so you need to make sure that location permissions are enabled for the device and app in order for sensor updates to be sent to the phone. Once you enable location for the app the sensors will show up and continue to update as long as the location is enabled on the device and app.
![iOS](/assets/iOS.svg) When the app is not in the foreground, sensor updates are tied to location updates, so you need to make sure that location permissions are set to "Allow Always" in iOS settings.
The app will also try to send updates in the background however the frequency of these is determined by iOS and is heavily throttled to protect battery life. iOS uses an internal metric, which is not visible to app developers, to prioritize background activities for apps. Apps which you use more will be allowed to do more in the background more frequently, this means that the more you use the Companion App, iOS will learn that the app is important to you and allow more frequent updates via background fetch.
If you want to ensure that the sensors are updated when your device starts charging or the battery level goes below or above a certain limit, the most reliable way is to use an Automation in iOS's [Shortcuts](/integrations/siri-shortcuts.md) app. Set the "When" part to the desired condition and in the "Do" part select the "Update Sensors" action for Home Assistant. You will most likely want to turn off "Ask Before Running" to avoid being prompted before the update is sent. Due to limitations in iOS, you will however always see a notification from the Shortcuts app when these updates are sent.
![Android](/assets/android.svg) On Android, sensors will show up as and when they have an update. Some will show up immediately upon enabling and others will show up once permissions have been granted and the state was retrieved. If you do not see a sensor then you may need to wait for the sensor to get a state update so it can send it to your Home Assistant server.
Expand Down

0 comments on commit a7771e0

Please sign in to comment.