The home zone (zone.home) is the foundation for:
- ✅ Presence detection (automations for “arrived/left”)
- ✅ Sunrise/sunset calculation (lighting, blinds)
- ✅ Weather forecasting (coordinate-based)
- ✅ Geofencing for devices and users
Inaccurate coordinates = false triggers, wrong forecasts, broken automations.
🎯 The Default Wizard Problem
During initial setup, Home Assistant asks to pick a location on a map. But:
- ❌ No manual coordinate input in the wizard
- ❌ IP-based auto-detection often has 1–10 km error
- ❌ Elevation above sea level is not requested
Solution: configure precise coordinates after installation, via UI or YAML.
🔧 Method 1: Via UI (After Installation)
Step 1: Get Precise Coordinates
Use a GPS-enabled device (phone with Home Assistant app):
- Install the official companion app
- Grant precise location permission
- Enable
device_tracker.<device>sensor in app settings - Open Developer Tools → States in web UI
- Find entity
device_tracker.<your_device> - Copy attributes:
latitude,longitude,altitude
Step 2: Update Home Zone
- Settings → Areas, labels & zones → Zones
- Open
home - Paste coordinates into
Latitude/Longitudefields - Save
Step 3: Set Elevation
- Settings → System → General
- Fill
Elevation above sea level(in meters) - Save
💡 Zone radius: default is 100 m. Increase to 200–500 m for rural areas or if GPS has noticeable error.
⚙️ Method 2: Via YAML (Advanced)
Add to configuration.yaml:
homeassistant:
name: Home
latitude: 55.7558 # ← example, replace with yours
longitude: 37.6173 # ← example, replace with yours
elevation: 156 # elevation in meters
radius: 200 # zone radius in meters
unit_system: metric
time_zone: "Europe/Moscow"
country: "RU"
currency: "RUB"
Important:
- After changing
configuration.yaml, run Check Configuration and Restart - If coordinates are set in YAML, UI fields become read-only
🔄 Alternative: homeassistant.set_location Action
For dynamic updates (e.g., from automation):
automation:
- alias: "Update home location"
trigger:
platform: time_pattern
minutes: "/30" # every 30 minutes
action:
- action: homeassistant.set_location
data:
latitude: "{{ states('sensor.gps_latitude') }}"
longitude: "{{ states('sensor.gps_longitude') }}"
elevation: "{{ states('sensor.gps_altitude') }}"
⚠️ Use with caution: frequent location updates may break presence automations.
⚠️ Common Issues
# "Away" doesn't change to "Home" on return
→ Check zone radius: increase to 300–500 m
→ Ensure `device_tracker` is updating (interval, min distance)
# Wrong sunrise/sunset time
→ Verify `elevation` and `time_zone` in settings
→ Reload `sun` integration
# Coordinates won't save in UI
→ They may be set in `configuration.yaml` - edit only there