Skip to main content

Configuring the Home Location in Home Assistant

Monday, October 13, 2025
Reading time 5 minutes

One of the things I’ve found somewhat complicated when setting up a Home Assistant instance for the first time is configuring the zone that serves as “home”. Everything else depends on this zone (presence detection, which can be used to trigger actions when someone is present or absent from the zone, is the best example I can think of, although weather forecasting also uses the zone to identify where to obtain information from).

The Problem

The problem, which is visible when running the instance setup wizard for the first time, is quite simple, but at the same time not easy to solve. The system includes a map interface to select the exact location where the house with the installed instance is located. The situation turns out to be difficult to manage because there is no accessible way to do this. The buttons that allow interaction with the map don’t allow entering the location manually, and it’s naturally not possible to visually select where the house is located.

There is an option that allows approximating the location based on the IP address of the user running the wizard. The problem with this is that while it does work, it depends on the IP address correctly pointing to the specific address (or close enough to it), which in the vast majority of cases doesn’t happen. However, it can obtain a set of coordinates (latitude and longitude) with more or less accuracy. When I was setting up my Home Assistant for the first time, this was the method I chose, and I later corrected it as I’ll explain below.

The Solution

I’ve done this a couple of times, and while it’s a bit more cumbersome than doing everything visually the first time, it has the advantage of not requiring external help. However, you must have a device that can obtain GPS data correctly (for example, an Android or iOS device that can install the Home Assistant companion app).

The first thing to do is to get through the Home Assistant setup wizard. Honestly, you can do anything here to configure the home location. Three important pieces of data are requested: longitude, latitude, and elevation above sea level. When the location is detected based on IP, you’ll get the first two, but not the elevation. In any case, we’ll probably change all these values very quickly.

Once the setup wizard is complete, you should install the Home Assistant companion app available in the app stores for your system. When you open it, if the instance is detected by scanning the network, it will likely offer direct access to the instance. If not, you can enter the URL used to access manually. In any case, access simply involves entering the address, username, and password. It’s important to grant precise location permissions to the Home Assistant app when requested and configure the location tracking sensor. This sensor is responsible for keeping the person’s GPS location updated. Later, from the settings, you can configure the time interval you want between updates, the minimum distance to trigger an update, etc. Even once the home zone is established, you can completely disable location tracking, but for this step, it’s important to keep the sensor active and working.

Once the companion app is configured on the device, it will create several entities. Under Home Assistant terminology, entities are the building blocks of automations. They represent data that can be part of a device. Each device can expose multiple entities, and entities can store data (such as the state of a device feature). The ones enabled by default in the companion app are fine, although you can send a lot of device information to Home Assistant (battery status, charge percentage, media sessions, active phone modes, step tracking, etc.). The idea is that by using this information within Home Assistant, you can react to events occurring on the phone, automating something (example: If you have a smart plug where the phone charges, you can program an automation so that when connecting the phone to charge, it allows charging up to 90 or 95% battery. Then have the plug cut power to protect battery lifespan).

Once the device configuration is finished, in the “Overview” section of Home Assistant, you’ll probably see the user account name with a label below that says “Away”. This is because Home Assistant detects that you’re not home, according to the defined zone. Our ideal goal is to make the tool detect that we are indeed at home. To do this, we’ll need to take the location and altitude data provided by GPS (via the device tracker, which is an entity exposed by the companion app to the instance) and edit the home zone with those values.

  1. On the Home Assistant instance page, go to the “Developer tools” section. This section will show a menu with multiple tabs. Select the States option.
  2. In the states table, look for an entity whose domain starts with device_tracker.xxxx, where xxxx can be the device name given to the phone during companion app configuration.
  3. The information of interest is in the attributes column. These are the raw sensor values. Copy the values of latitude, longitude, and altitude.
  4. Now go to Settings > Areas, labels & zones
  5. Then to the Zones tab.
  6. A list of defined zones is displayed. If nothing has been changed, this will normally only contain the home zone. Edit it and manually enter the latitude and longitude in the corresponding fields.
  7. Finally, go to Settings > System > General and fill in the “Elevation above sea level” field with the altitude value reported by GPS.
  8. That’s it.

Conclusion

If everything went well, after following these steps, the system should be able to identify when the device linked to the user (the one with the device_tracker entity) is away from home. It’s also possible to define other zones from known device locations. With this, the system would be ready to start programming location-based automations (when arriving home, turn on lights, read the news, etc.).

home assistant smart home tutorial