From 2de8af97d7252267e3033634bc8a2cc6bc8ce7bf Mon Sep 17 00:00:00 2001 From: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> Date: Tue, 6 Aug 2024 15:35:50 +0200 Subject: [PATCH] Step-by-step on adding presence detection with phone (#34146) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Step-by-step on adding presence detection with phone * Fix typo * Update source/getting-started/presence-detection.markdown Co-authored-by: Bruno Pantaleão Gonçalves <5808343+bgoncal@users.noreply.github.com> * Fix typos * Fix iOS version, as per review comment * Update source/getting-started/presence-detection.markdown Co-authored-by: Joris Pelgröm --------- Co-authored-by: Bruno Pantaleão Gonçalves <5808343+bgoncal@users.noreply.github.com> Co-authored-by: Joris Pelgröm --- .../presence-detection.markdown | 55 ++++++++++++++----- 1 file changed, 42 insertions(+), 13 deletions(-) diff --git a/source/getting-started/presence-detection.markdown b/source/getting-started/presence-detection.markdown index a206c6e1a47..74e029fd5d3 100644 --- a/source/getting-started/presence-detection.markdown +++ b/source/getting-started/presence-detection.markdown @@ -1,32 +1,61 @@ --- title: "Setting up presence detection" -description: "Instructions on how to setup presence detection within Home Assistant." +description: "Instructions on how to set up zone presence detection within Home Assistant." --- -Presence detection detects if people are home, which can be valuable input for automation. Knowing who is home or where they are, will open a whole range of other automation options: +Zone presence detection detects if people are within a certain zone, which can be valuable input for automation. Knowing who is home or where they are opens a range of automation options: - Send me a notification when my child arrives at school - Turn on the AC when I leave work -![Screenshot of Home Assistant showing a school, work and home zone and two people.](/images/screenshots/map.png) +

+ Screenshot of a map dashboard in Home Assistant showing a school, work and home zone and two people. + Map dashboard showing a school, work, and a home zone and the location of two people. +

-### Adding presence detection +## About setting up zone presence detection -There are different ways of setting up presence detection. Usually the easiest way to detect presence is by checking which {% term devices %} are connected to the network. You can do that if you have one of our [supported routers][routers]. By leveraging what your router already knows, you can easily detect if people are at home. +There are different ways of setting up zone presence detection. One way is to run an app on your phone to send detailed location information to your Home Assistant instance. Another way to detect presence is by checking which {% term devices %} are connected to the network. You can do that if you have one of our [supported routers][routers]. By leveraging what your router already knows, you can detect if people are at home. -It's also possible to run an app on your phone to provide detailed location information to your Home Assistant instance. For iOS and Android, we suggest using the [Home Assistant Companion app][companion]. +## Adding zone presence detection with a mobile phone -During the setup of Home Assistant Companion on your mobile device, the app will ask for permission to allow the device's location to be provided to Home Assistant. Allowing this will create a `device_tracker` entity for that device which can be used in automations and conditions. +### Prerequisites -### Zones +- [Home Assistant installed](/installation/) +- [Onboarding steps](/getting-started/onboarding/) completed +- [Remote access enabled](https://www.home-assistant.io/docs/configuration/remote/) + - The easiest way to do this is by enabling + - [Home Assistant Cloud](https://nabucasa.com/config/) +- Mobile phone: + - Android (Android 5 or later) or iPhone (iOS 15 or later) + - Phone plan with Internet access + - Access to your local network where Home Assistant is running +- [Home Assistant Companion app installed](https://companion.home-assistant.io/docs/getting_started/) on your phone. + - During the setup procedure, make sure to grant **Location access**. + - Location access creates a `device_tracker` entity for that device. This entity can be used in automations and conditions. -![Map with zones](/images/screenshots/badges-zone.png) +### To add zone presence detection with a mobile phone -{% term Zones %} allow you to name areas on a map. These areas can then be used to name the location a tracked user is, or use entering/leaving a zone as an automation {% term trigger %} or {% term condition %}. See [Zones integration](/integrations/zone/) page for more details like creating zones. +1. Open the Home Assistant Companion app on your phone and log in to your Home Assistant instance. +2. On the screen to **Connect to Home Assistant**, make sure you activate **Enable location tracking**. + - Select **Continue**. +3. Go to {% my integrations title="**Settings** > **Devices** & **Services**" %} and look for the new integration that was added: **Mobile App**. + - On the integration card, select **1 Device**. This opens the device info page. + - You now see your phone name and its entities. +4. To view the location of your phone on the map, open the **Map** dashboard. + - You now see a circle on that map with your initial. + - It shows the current location of your phone. + - To view the details, select that initial. + - Open the **Attributes** list to see the phone's **Latitude**, **Longitude**, and the **Source** of information. + - The source is the `device_tracker` entity for that device, for example `device_tracker.pixel_7_pro`. +5. To view the entity details and the history, go to {% my entities title="**Settings** > **Devices & services** > **Entities**" %} and in the search field, enter `devi` and select your `device_tracker` entity from the list. +6. Check your [Zones](/integrations/zone/) to prepare them for automations. + - Your home zone was set up during onboarding, but you can edit it. + - You can add other zones if you want to automate on them. + - For example, if you want the heating to start when you leave your office, you can add a zone called **Office**. + - In this case, leaving the office zone would be an automation {% term trigger %}. + - You could also use the location information as an automation {% term condition %}, for example, when you have an automation to turn on the light at sunset, but only when you are home. -{% note %} -The map dashboard will hide all devices that are home. -{% endnote %} [routers]: /integrations/#presence-detection [nmap]: /integrations/nmap_tracker