Setting up presence detection

Presence detection tells Home Assistant who is at home and where they are. That is one of the most useful pieces of information you can give your smart home, because it lets your automations react to people arriving and leaving:

  • Send me a notification when my child arrives at school
  • Turn on the AC when I leave work

Screenshot of the Map dashboard in Home Assistant showing four people, two of them at the home zone, one at a shop zone, and one on their own. Map dashboard showing a home zone, a shop zone, and the location of four people.

About setting up zone presence detection

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 devicesA device is a model representing a physical or logical unit that contains entities. are connected to the network. You can do that if you have one of our supported routers. By leveraging what your router already knows, you can detect if people are at home.

Adding zone presence detection with a mobile phone

Prerequisites

To add zone presence detection with a mobile phone

  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 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 marker on that map with your picture or your initials.
    • It floats above the current location of your phone. Under People, you are listed as Me.
    • To view the details, select that marker, then select More info.
      • 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 Settings > Devices & services > Entities and in the search field, enter devi and select your device_tracker entity from the list.
  6. Check your Zones 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 triggerA trigger is the part of an automation that makes the automation start when something specific happens, for example, when the sun sets, a door opens, or a button is pressed. [Learn more].
      • You could also use the location information as an automation conditionConditions check whether something is true at that moment, for example, whether a door is closed. You can use them in automations and scripts. If a condition is not met, the actions that come after it in the same sequence do not run. At the top level of an automation or script, this stops the automation or script. [Learn more], for example, when you have an automation to turn on the light at sunset, but only when you are home.

Adding presence detection for other persons in your home

  1. For each person you want to have presence detection, add a device tracker (for example, their phone).
    • You can also use a smartwatch for presence detection. To do this, install the Home Assistant Companion app on the device. Make sure to allow location tracking.
    • To use it for zone presence detection outside your home, the smartwatch requires a mobile plan.
  2. Go to Settings > People and select the person.
  3. Scroll down and under Select the devices that belong to this person, select the device.

  Join the Community