Smart Home Assistant

Home Assistant Welcome Home Automation: Lights, Heating and Lock on Arrival

SepehrBy Sepehr· 22 November 2026· Updated 22 November 2026· 6 min read
✓ Independent — no paid placements✓ UK-tested in real homes✓ Cited sources
Abstract house with a lit door and window at night on a dark navy background with dashed arrival paths

Key takeaways

  • Use a zone trigger on a person entity, not a single phone, so the automation follows the household member.
  • A sun condition with a one-hour negative offset stops the hall light switching on in daylight.
  • Require ten minutes away before firing, so a trip to the bins does not trigger a greeting.
  • Send an Unlock button to your phone rather than unlocking automatically, because GPS position does not prove who is at the door.
  • If it never fires, check the person entity history first: a tracker that never changed state is the usual cause.
On this page[tap to expand]

A Home Assistant welcome home automation turns on the hall light, warms the house and, if you choose, unlocks the door when your phone arrives home. It needs a person entity, a home zone and one automation. Most of the effort goes into stopping it firing at the wrong moment.

The basic version takes about 20 minutes. The version you will still like in three months takes a little longer, because it checks it is dark, ignores a quick trip to the bins and copes with two people arriving together. The steps below build it in that order so you can test each layer.

Flow diagram of a welcome-home automation: person enters home zone, conditions check darkness and time away, then lights, optional unlock, heating and alarm actions
The trigger says someone arrived; the conditions decide whether anything should happen.

What do you need before you start?

  • The Companion app on each phone: it supplies the GPS location and a device tracker. Our device tracker guide covers the setup.
  • A person entity: one per household member under Settings → People, linked to that phone's tracker.
  • A correctly sized home zone: the default zone.home radius is set from your home location. Check it on the map before you trust it.
  • Something to control: a hall light is enough. A smart lock, a thermostat or an alarm panel are optional extras for later steps.

Is phone GPS reliable enough to trigger things at home?

Mostly, but not to the metre, so design for that. Home Assistant's person integration combines the trackers linked to a person and picks the state from them. At home, a connection tracker such as your router wins over GPS, and away from home GPS takes precedence. That is sensible, but it means the moment of "arrival" depends on which tracker updates first.

In practice, a GPS-only person can fire a minute or two before you reach the door, or occasionally late if the phone has been put into battery saving. Adding a second tracker, such as the phone's Wi-Fi connection to your router, makes the state more dependable. Treat the automation as a convenience, not a security control, and keep that in mind before Step 5. The presence detection guide compares the options in more depth.

Step 1: Check your home zone and people

Open Settings → Areas, labels & zones → Zones and look at the home zone on the map. If the circle is small, a phone can drop in and out at the edge. A radius of 100 metres or more is a common starting point for a terraced house in a built-up street, but you will need to test your own. Then open Settings → People and confirm each person has the Companion app's device tracker attached.

Finally, watch the person entity in Developer tools → States while someone walks or drives away and comes back. You want to see it change from home to not_home and back, in a sensible place, before you build anything on top of it.

Step 2: Create the basic arrival trigger

Create a new automation and paste this into the YAML editor. Replace person.alex and light.hallway with your own entities.

alias: Welcome home - hall light
description: Hall light on when Alex arrives
triggers:
  - trigger: zone
    entity_id: person.alex
    zone: zone.home
    event: enter
actions:
  - action: light.turn_on
    target:
      entity_id: light.hallway
    data:
      brightness_pct: 70
mode: single

The zone trigger fires when the person enters or leaves the zone, and the event option chooses which. Here it is enter. Test it by turning off Wi-Fi on the phone, leaving the zone, then coming back, or use the automation's Run menu to check the action half works on its own.

Step 3: Only run it when it is dark

A hall light switching on at noon is pointless. Add a condition so the action only runs after sunset, with an offset so it starts a little before it is properly dark. The sun condition supports an after_offset, and a negative value moves the time earlier.

conditions:
  - condition: sun
    after: sunset
    after_offset: "-01:00:00"
  - condition: sun
    before: sunrise
    before_offset: "01:00:00"

Those two blocks as written would both have to be true at once, which is almost never the case, so wrap them in an or. Use this instead:

conditions:
  - condition: or
    conditions:
      - condition: sun
        after: sunset
        after_offset: "-01:00:00"
      - condition: sun
        before: sunrise
        before_offset: "01:00:00"

The Home Assistant documentation describes the sun condition as an older one and recommends the newer sun and sun elevation conditions for new automations, so you may prefer those in the visual editor. If you have a light sensor in the hallway, an illuminance threshold is more accurate than the clock in winter, when a grey afternoon is dark before sunset.

Step 4: Ignore short trips and handle two people

The classic annoyance is the bin run: you step out, the phone drops out of the zone, you step back in and the house greets you. Add a trigger-level duration so the person must have been away for a while. This version fires for either of two people and only if they were away for ten minutes first.

triggers:
  - trigger: state
    entity_id:
      - person.alex
      - person.sam
    from: not_home
    to: home
conditions:
  - condition: template
    value_template: >-
      {{ (now() - trigger.from_state.last_changed).total_seconds() > 600 }}

Here trigger.from_state.last_changed is when the person last became not_home, so the template measures how long they were away. If you want to skip the greeting when someone is already in, add a state condition that the other person is not home, or flip it round so the second arrival does nothing new. Because the trigger lists both people, either arrival runs the same actions, and mode: single stops a second arrival a few seconds later from starting a duplicate run.

Step 5: Add heating, lock and alarm actions carefully

The extras are where convenience meets risk. Heating is harmless: set the thermostat to your comfortable temperature when the first person arrives, using the guidance in our heating control guide. The lock and alarm need more thought.

Home Assistant's lock integration offers lock.unlock as an action, and some locks also support lock.open to release the latch. Before you automate it, remember that a phone's GPS position is not proof that the person carrying it is at the door. Many people prefer a middle path: the arrival automation sends a notification with an Unlock button, so a human confirms it. The notifications guide shows how actionable notifications work, and the door left unlocked reminder pairs well with it.

actions:
  - action: light.turn_on
    target:
      entity_id: light.hallway
  - action: climate.set_temperature
    target:
      entity_id: climate.living_room
    data:
      temperature: 20
  - action: notify.mobile_app_alex_phone
    data:
      message: "Welcome home. Unlock the front door?"
      data:
        actions:
          - action: UNLOCK_FRONT
            title: Unlock

You then need a second automation that listens for the mobile_app_notification_action event with the UNLOCK_FRONT action name and calls lock.unlock. For an alarm panel, the same rule applies: disarming on a GPS arrival is a decision to make deliberately, and our alarm panel guide explains the options. If you are choosing a lock for this, the best smart lock guide lists models that work with Home Assistant.

What if you arrive and nothing happens?

The automation never fires: open the person entity history. If it never changed to home, the problem is the tracker, not the automation. Check the Companion app's location permission is set to always allow and that battery optimisation is not stopping it.

It fires at the end of the road, not the door: the zone radius is too large, or GPS accuracy is poor. Shrink the zone or add a second tracker, such as the phone's Wi-Fi connection, so the router confirms you are in.

It fires twice: the person entity flipped between states because two trackers disagreed. The ten-minute away check in Step 4 removes most of these, and mode: single catches the rest.

The light comes on in daylight: the sun condition is missing or wrapped wrongly. Test the condition alone from the automation's trace view, which shows which condition stopped the run.

It works for one person but not the other: compare the two person entities. A phone with location sharing set to "while using" will not report in the background.

What should you build next?

A matching goodbye automation completes the pair: switch off lights, lower the heating and arm the alarm when the last person leaves. If you want the house to look occupied while you are away, the holiday mode guide picks up where this one stops, and the motion night light guide is a good second hallway automation. For the evening end of the day, see the bedtime routine.

Buy the picks in this guide

Recommended for Home Automation

See all devices →

Frequently asked questions

How do I make Home Assistant do something when I arrive home?
Create an automation with a zone trigger set to your person entity, the home zone and the enter event, then add the actions you want, such as turning on the hall light. The Companion app on your phone supplies the location the person entity relies on, so install it and allow background location first. Test by leaving the zone and returning. The caveat is that GPS arrival is approximate and can fire a minute or two early or late, so avoid tying it to anything you would regret happening at the wrong moment. Add a darkness condition and a minimum time away to make it feel dependable, and review the automation trace after the first few real arrivals to see what ran.
Can Home Assistant unlock my front door when I get home?
Yes, the lock integration provides an unlock action that an arrival automation can call, and some locks also support opening the latch. Whether you should is a separate question. A phone's GPS position shows that the phone is near, not that the person holding it is at your door, and a stale or inaccurate location could unlock a door at the wrong time. A safer design sends a notification with an Unlock button so you confirm it yourself, or only unlocks when a second signal agrees, such as the phone joining your Wi-Fi. If you do automate it, keep the lock's own code or key as a backup and consider a delay.
Why does my arrival automation run when I only went to the bins?
Your phone briefly dropped out of the home zone and came back, so the person entity changed from home to not_home and back, which looks like a real arrival. This happens when the zone radius is small, GPS accuracy is poor or the phone loses signal near a wall. Fix it by checking how long the person was away before running the actions, for example by requiring the previous not_home state to have lasted ten minutes, and by enlarging the zone slightly. Adding a second tracker, such as the router connection, also stabilises the state. The caveat is that a longer minimum time away delays greetings after short real trips, so pick a value that suits your routine.
What if two people live in the house?
Give each person their own person entity, and list both in the trigger so either arrival can start the automation. Decide what should happen when the second person comes home: usually nothing, because the house is already awake. You can check that the other person is not home at the moment the trigger fires, or let both arrivals run and rely on single mode to avoid overlapping runs. If you want personalised actions, create separate automations per person, such as different thermostat targets. The caveat is that if only one phone is reliable, the other person will not trigger anything, so test each person separately before assuming the household is covered.

Sources

Sources verified 2026-11-22

  1. Home Assistant — Automation triggers (zone trigger)
  2. Home Assistant — Person integration
  3. Home Assistant — Sun condition
  4. Home Assistant — Lock integration
  5. Home Assistant Companion — Actionable notifications
›How we researched this

Claims in this article are checked against primary sources — manufacturer specifications, official documentation, Which? research, Ofgem guidance, or gov.uk — rather than forum threads or video reviews. Where the author has direct hands-on experience with a product (most Home Assistant, Zigbee, and home-networking gear is running in his own homelab), that is stated explicitly in the text.

For categories outside that personal setup — such as boilers, heat pumps, and other areas that are traditionally a heating engineer's domain — verdicts are built from cross-referenced manufacturer data, published lab results, and vetted expert and owner reviews rather than a claim of personal hands-on testing. See the editorial policy for the full methodology.

Sepehr

Written by

Sepehr

10+ years hands-on with Home Assistant & networking · Research-backed elsewhere · No brand deals

Smart home specialist with 10+ years running a self-hosted Home Assistant setup — Zigbee2MQTT, Frigate NVR, and local-first automations. Independent coverage for UK homes, no brand deals.

LinkedIn →

Citing this page? Please use a dofollow link back to the original article — it helps us keep the data on this page accurate and up to date.

Related reading