3 min read

Your phone checks you out while you’re at home: presence by movement inside, not just by GPS

A template sensor in Home Assistant combines the phones and an mmWave presence sensor: someone is home if a phone is home or a person has been detected in the last 30 minutes.

Level
Intermediate
Active time
30–45 minutes
Home Assistant required
Yes

Your phone tells Home Assistant that you are “out” while you are on the sofa: GPS is lost, the battery is in power-saving mode or the phone is charging in another room. The lamps go off, the heating is lowered. Movement inside is a second source of truth.

What you will get

One shared signal “Someone is home”, which is on if at least one phone is in the “home” zone or a presence sensor has detected a person in the last 30 minutes. Instead of reacting to GPS, the other automations use this signal.

What we need

  • Sonoff SNZB-06P: one presence sensor in the room where you are most likely to be. For a second room you need a second sensor.
  • Home Assistant with the Companion app on the phone, so that there is a person entity.

You need a Zigbee hub or Home Assistant with a Zigbee adapter.

  • Setup time: 30–45 minutes.
  • Skills: you add a Zigbee device and paste YAML into configuration.yaml.
  • Mounting: The SNZB-06P works on USB-C power, so it needs a nearby socket.

How it works

The SNZB-06P is an mmWave sensor: it also detects a person sitting still. According to the product description the range is up to 4 metres, the angle 150°. A PIR motion sensor sometimes “forgets” a person who does not move. The mmWave approach is better suited to presence.

We combine the two sources with a template binary_sensor. The rule is: someone is home if at least one person is home or if the sensor is on. The delay delay_off keeps the signal on for 30 minutes after the last detection, so that it does not flicker with a short pause.

Steps

  1. Add the sensor. Pair it through ZHA or Zigbee2MQTT. A presence binary_sensor appears (for example binary_sensor.living_room_presence).
  2. Position the sensor. Look over the room and avoid pointing it at a door, a curtain or a fan. The description recommends checking for motion through thin walls, moving curtains and fans before final mounting.
  3. Create the template sensor. In configuration.yaml add the block below, which is an example, and reload the templates (Developer tools → YAML → Template entities) or restart.
template:
  - binary_sensor:
      - name: "Someone home"
        unique_id: someone_home_presence
        device_class: occupancy
        delay_off:
          minutes: 30
        state: >
          {{ states.person | selectattr('state', 'eq', 'home') | list | count > 0
             or is_state('binary_sensor.living_room_presence', 'on') }}

The entity’s name becomes binary_sensor.someone_home or similar. Check it in Developer tools → States. The name is in English so that the entity ID is clear.

  1. Use the new signal. In your automations replace the check of person with this sensor. For example “turn off the lamps when nobody is home”:
alias: "Lamps: turn off when nobody is home"
mode: single
triggers:
  - trigger: state
    entity_id: binary_sensor.someone_home
    to: "off"
actions:
  - action: light.turn_off
    target:
      area_id: living_room

light.turn_off for the area living_room is an example: change it to your own.

Checking the result

  • The phone is at home. The signal is on.
  • The phone is lost, you are in the room. Turn off the phone’s location: the signal stays on because of the sensor.
  • Everyone leaves. After the last movement and a 30-minute pause the signal becomes off.
  • The sensor has no connection. Pull out the USB power: the signal follows only the phones.

If it does not work

  • The signal does not go off. A pet, a fan or a curtain is detected as presence. Move the sensor or reduce the range.
  • It does not light up while you sit. The sensor points sideways or is too far away.
  • It flickers. Increase delay_off.
  • There are no person entities. Settings → People: add a person with a phone track.

Limitations and switching off

  • The sensor covers one room. If you are in another, the signal does not see you, so keep the phone as a second source too.
  • Presence does not tell people from pets.
  • If the sensor or Zigbee has stopped, only GPS remains.
  • Switching off: return the automations to person and delete the template sensor.

Sources and verification status

The material follows the Home Assistant documentation, read on 22.11.2026. The topic is from Simeon’s list of ideas.

Need a hand?

We can set up and install everything in this project. In some regions we install it ourselves — ask us.

Contact us

Related projects

Sonoff SNZB-06P Zigbee Presence Sensor

14,90 €
View parts

What you need

Requires a Zigbee hub or Home Assistant with a Zigbee adapter.

Added to cart

Real Home Automations

Sign in to your account

With a code sent to your email

Continue with Google
or

By continuing, you accept the Terms and Conditions and the Privacy Policy.