Is This The Smartest Way to Leave Your House?

Hi everyone,

I just finished putting together a video showcasing my absolute favorite automation. I wanted to solve two common problems: knowing exactly when I’m leaving (vs. just opening the door) to trigger weather reminders, and ensuring the entire apartment shuts down only when it’s truly empty.

It relies on combining multiple sensors to determine direction and presence with high confidence, namely

The Logic: The corridor is covered by the battery-powered FP300, while the FP2 handles the complex zones in the living area. By correlating the timestamp of the door sensor with the specific zones on the presence detectors, HA figures out if I am entering or leaving.

  1. Leaving in the morning: It checks the forecast and reminds me via the Nest Hub if I need rain gear for my bike commute.
  2. Leaving for good: When I hit the T1 switch to turn off the hall light, it verifies that the rest of the house is empty (via the FP2/FP300) before killing power to all other smart devices.

:tv: Check out the video for the full walkthrough

The two screenshots below show how I set up the automation logic and conditions in Home Assistant.

Let me know what you think or if you have any questions about the config!

8 Likes

Very cool. I implemented this very similarly with Home Assistant, but person-specific using cameras and facial recognition. That way, you can distinguish who is leaving or entering the apartment. Each person in the household then has the status “leaving”, “arriving”, “has left”, “has arrived”, “away”, or “home”.

4 Likes

Oh nice. What do you use for face recognition @JohnD. How accurate is it (especially in low light scenarios)? And how did you position the camera to both catch people leaving and arriving?

1 Like

Hello @markus
Thanks for sharing your automation.

:omzdu6fxikcn5wgqqcyj9q_62:

1 Like

I use two Aqara G5 Pro cameras. Bought second-hand on eBay, so it wasn’t quite as expensive.

It works accurately because you have to walk right past the camera in the hallway. There is also a camera outside that you have to walk toward. This allows me to distinguish between coming and going.

I can’t comment on low light scenarios, as motion detectors always ensure good lighting. But the G5 Pro delivers good images even in the dark, so I would imagine that it also works well in the dark.

If you position a mirror in the hallway, it could probably also work with one camera. And, of course, in combination with a door sensor.

The other stadiums are then automatically set after a timer expires or via other integrations:

  • iCloud3 v3: iDevice Tracker
  • FRITZ!Box Tracked device
  • HA Mobile App

And another automation that can also correct a person’s status, for example:

  • iPhone connects to Carplay → Person absent
  • Only one person is present and the door lock is closed → Person absent

Proximity is also quite interesting if you want to see how far away someone is and how long it will take them to get home.

3 Likes

Oh cool. Wouldn’t have thought of using mirror… good idea! Do I understand correctly that you use directly the G5 Pro’s face detection and share it via the “Signal synchronization” feature with Home Assistant? Didn’t realize that’s possible before your post. Now I’m even more excited about that camera :slight_smile:

1 Like

Correct. Aqara calls it Advanced Matter Bridging.

Of course, you can also use other software. I am currently trying out Synology Surveillance Station, as I have a Synology NAS that also runs HA. When a face is recognized, it should be possible to pass this information on to HA via Webhook. However, I am still testing this.

I recently saw a video about LLM Vision Integration. It’s also very cool. It allows you to do even more complex things. For example, you could send images from the camera to the AI and ask if there is a man putting on a jacket, and only then start automations.

1 Like

Nice! This is definitely an area I’ll have a closer look at over the holidays. Thanks a lot for sharing all this background and links John

1 Like

I have a similar setup, but running through Aqara system only and then use Geofencing as coming home or leaving function and registering all the phone in my household so nothing is enabled while someone might be home asleep e.g. :+1:t2:

I tried geofencing as well initially but it was both to slow and often not accurate enough. I really wanted to know whether someone is entering or leaving (incl. guests) and didn’t find another way yet. I guess the canonical way would be some more sensors outside or using a camera as John does