Some hardware links on this page are affiliate links. As an Amazon Associate I earn from qualifying purchases. We may earn a commission if you buy through them, at no extra cost to you. See the affiliate disclosure.
GPS on a phone wanders. A fix that slides across the home zone while you are on the couch looks like you left. A router tracker is no better at the edge of the driveway, where the phone is still associated and you are already in the car. This pack refuses to change house presence until the entry door actually opens. For about 15 minutes after that, it watches the Companion Wi-Fi SSID sensor and the GPS device tracker. A real change in either one updates a home helper. Silence does not.
This is house-level home and away. It is not which room you are in. Room presence is BLE room presence or wasp-in-a-box occupancy. Those should key off this helper if you want them frozen while nobody is home.
Entity ids below are stand-ins (binary_sensor.entry_door, sensor.phone_wi_fi_connection, device_tracker.phone, input_boolean.phone_at_home). The home network name is a blueprint text input. Do not publish it, and do not publish a phone name.
What problem it solves
You want automations to believe you left when you walked out the door, and to leave you marked home when GPS jitters, without a presence flip every time the fix is poor.
How it works
For a contact with device_class: door, on is open and off is closed. Fix an inverted sensor before you trust the window.
- Door opens the window —
binary_sensor.entry_doortoonis the only trigger. Snapshot whether the SSID sensor currently equals the home network name, and whetherdevice_tracker.phoneishome. - Ask the phone where it is — call the Companion notify service with
request_location_updateso GPS is not a ten-minute-old fix. The SSID sensor updates on its own when the association changes. - Fifteen minutes — once a minute, read both again. Home SSID to anything else, or GPS
hometo nothome, turnsinput_boolean.phone_at_homeoff (exit). The opposite edges turn it on (entry). The first decisive edge stops the automation so a later blip in the same window cannot undo it. - No change means no change — if the door was a package handoff and both trackers still say what they said at the start, the helper stays as it was. The pack does not guess from the door alone.
- Between doors, GPS is ignored — nothing in this blueprint triggers on the device tracker or the SSID sensor by themselves. Drift while the door stays shut cannot mark you away, and a stale
homefix cannot keep you home after a later exit already cleared the helper.
unknown and unavailable are not an exit and not an entry. A phone that sleeps and drops the SSID sensor must not look like it left the network.
mode: single so a second open during the window does not start a parallel vote. One person per automation. A second phone gets its own helper and its own door window. Combine helpers in a person or a group if “anyone home” is the signal other automations should use.
Hardware notes
- Door. Any contact on the door you actually leave through. A back door that people use has to be in the same trigger (a group that is
onif any leaf is open). An interior door does not mean someone left the house. - Phone. Companion App. Enable the Wi-Fi connection sensor (it reports the SSID string) and the background location tracker. iOS and Android both expose those. The SSID string you type into the blueprint must match the sensor character for character, including a 2.4 GHz versus 5 GHz name if the phone swaps between them. Put both names in the input if you have two.
- Helper.
input_boolean.phone_at_homeis the state other automations should read. Do not also put the raw GPS tracker in the samepersonif you added this helper to escape GPS. The person would still flip on the raw tracker.
Snippet
Stand-in ids. The pack ships the same logic as a blueprint with !input selectors.
mode: single
max_exceeded: silent
trigger:
- platform: state
entity_id: !input door_sensor
to: "on"
variables:
home_ssid: !input home_ssid
action:
- variables:
ssid_now: "{{ states('sensor.phone_wi_fi_connection') }}"
gps_now: "{{ states('device_tracker.phone') }}"
ssid_was_usable: "{{ ssid_now not in ['unknown', 'unavailable', 'none', ''] }}"
gps_was_usable: "{{ gps_now not in ['unknown', 'unavailable', 'none', ''] }}"
ssid_was_home: "{{ ssid_was_usable and ssid_now == home_ssid }}"
gps_was_home: "{{ gps_was_usable and gps_now == 'home' }}"
- action: notify.send_message
target:
entity_id: !input notify_target
data:
message: request_location_update
- repeat:
count: 15
sequence:
- delay: "00:01:00"
- variables:
ssid: "{{ states('sensor.phone_wi_fi_connection') }}"
gps: "{{ states('device_tracker.phone') }}"
ssid_home: "{{ ssid == home_ssid }}"
gps_home: "{{ gps == 'home' }}"
ssid_usable: "{{ ssid not in ['unknown', 'unavailable', 'none', ''] }}"
gps_usable: "{{ gps not in ['unknown', 'unavailable', 'none', ''] }}"
left: >-
{{ (ssid_was_usable and ssid_usable and ssid_was_home and not ssid_home)
or (gps_was_usable and gps_usable and gps_was_home and not gps_home) }}
arrived: >-
{{ (ssid_was_usable and ssid_usable and not ssid_was_home and ssid_home)
or (gps_was_usable and gps_usable and not gps_was_home and gps_home) }}
- choose:
- conditions:
- condition: template
value_template: "{{ left }}"
sequence:
- action: input_boolean.turn_off
target:
entity_id: !input at_home
- stop: "Left during the door window"
- conditions:
- condition: template
value_template: "{{ arrived }}"
sequence:
- action: input_boolean.turn_on
target:
entity_id: !input at_home
- stop: "Arrived during the door window"
sensor.phone_wi_fi_connection and device_tracker.phone are the Companion entities for one phone. Replace them, or select them in the blueprint. The loop ends with the helper unchanged when neither edge appears.
Setup outline
- Confirm the door reads
onwhen it is open. Enable the phone’s Wi-Fi connection sensor and location tracker. Createinput_boolean.phone_at_homeand set it to match reality before you automate anything off it. - Import the blueprint. Select the door, the SSID sensor, the GPS tracker, the helper, the notify target, and type the home SSID. Start with a 15 minute window.
- Stand inside, open the door, close it, wait. The helper should not flip if the phone stays on the home SSID and inside the zone.
- Walk out with the phone. Within the window the helper should turn off, usually on the SSID change before GPS catches up. Walk back in. It should turn on when the SSID returns or GPS re-enters
home. - Sit on the couch and watch the GPS tracker wander to
not_homewithout opening the door. The helper stays on.
Troubleshooting
- Marked away while you were home. Something other than this blueprint is still listening to GPS. Check the
personentity and any device-tracker automations. This pack only runs from the door. - Never marks away when you leave. The SSID input does not match the sensor (a second band name), the door contact is not the door you used, or both trackers stayed
homefor the whole window because the phone never left the network and the zone is huge. Watch the two entities in Developer Tools while you walk to the street. - Marked away when you opened the door for a delivery. The phone’s SSID sensor went
unavailableand the condition treated that as “not on the home network.” Keep the usable-state checks. Anunavailablereading is not an exit. - Arrival is late. GPS was not refreshed. The location-update message has to go to that phone’s Companion notify target. A notify group that drops mobile commands will not wake the tracker.
- Two people, one helper. The second person’s exit overwrites the first person’s state. One helper per phone, then a group for “anyone.”
- Door contact is backwards.
onmeans open. An inverted contact starts the window when the door closes, which is the wrong edge.
Credits
Based on the community blueprint Presence detection using Door, Wi-Fi SSID and GPS. This write-up is an original home helper: the entry door gates a 15-minute check of the Companion SSID sensor and GPS tracker, and neither tracker can change presence while the door stays shut.