Detecting when you are away

I’m looking for a way of being able to detect when a person is present in the house or not.

This is so when they are not present (i.e. house unoccupied) I can automatically trigger presence simulation, putting certain lights on around the property in the evening, etc.

Options could be looking for specific network devices connected to the Wi-Fi (i.e. our phones), a long-range RFID tag of some sort that could be detected inside the property (but that would require extra hardware), geo-fencing using an app, or something else?

Open to any ideas :slight_smile:

There are many examples in this forum. I use the Network Binding to ping for our phones.

What phones have you got?

Thanks for the response.

I’d searched the forum but not found anything relevant (everything I found referred to presence simulation, not detection).

The Network Binding looks to be what I’m after!

We have Android phones (Samsung).

what else do you have in your system? Any door contact switches or motion sensors?

This looks interesting to me.

1 Like

Everyone in my family uses Life360 to track our whereabouts, but presently there isn’t a Life360 binding. As a workaround, I use Node Red. There’s a Life360 plug-in that tells you when members of your circle enter or leave a zone (node-red-contrib-life360 (node) - Node-RED). There’s also a OpenHAB plug-in for Node Red (node-red-contrib-openhab3 (node) - Node-RED). With both of these, I can know when the entire family has left the home zone.

I also use the Network binding to ping phones, however two of my family members use Apple phones and they can go offline for minutes at a time. To help with that, I put a timeout on each of the phone items (using a timer) so I delay taking any action until they’ve been offline at least X minutes.

I use a variation on this excellent work here to have a compound definition of house presence with exceptionally high accuracy (each family member’s phone status, various motion sensor status, security camera status, door status, tv status, sonos speaker status, google home status all contribute).

Here’s the workup I made for OH3 for it:

1 Like

Many thanks for the response, plenty to consider for the best way forward :slight_smile:

No door or motion sensors (yet!), mostly just lighting.

I used to make it really complicated but I’ve simplified a lot. We all have Android phones so we use the openHAB Android app’s feature where it will report the WiFi SSID the phone is connected to to an Item. If that Item matches my home WiFi name, that person is home.

If I wanted to be sneakier, I could use Tasker’s ability to report nearby WiFi SSID names and update an Item with that list. Is one of my home WiFi SSIDs are in the list, I’ll count that person home.

Geofencing is usually too slow and inaccurate.

Pinging the phone with the Network binding took too much fiddling (note, modern phones will randomize their MAC addresses and they go to sleep so you need to reconfigure the network settings to turn off random MAC addresses on the phone for hping to work).

Reporting the WiFi is accurate enough that I’ve not needed to go down the Bayesian route or the Wasp in the Box algorithm.

And I’ve no motion sensors at all but even if I did we couldn’t rely on them because of the dogs.

Sometimes simple can be good enough.

You might be interested in Generic Presence Detection if you want to add a little bit of a delay before marking someone as away. It can be implemented using the Debounce rule template so all you’ll need is some Item configuration.

My Away/Home logic is used primarily to run lighting programs to simulate us being home; I’m concerned with “away overnight” rather than short-term absences, so I set away mode when the alarm has been armed in “away” mode for more than 12 hours and cancel it when the alarm is disarmed. In away mode, it runs a few programs to turn lights on during the evening, and then runs our usual bedtime program to turn everything out for the night.

My Away/Home logic is used primarily to run lighting programs to simulate us being home; I’m concerned with “away overnight” rather than short-term absences, so I set away mode when the alarm has been armed in “away” mode for more than 12 hours and cancel it when the alarm is disarmed. In away mode, it runs a few programs to turn lights on during the evening, and then runs our usual bedtime program to turn everything out for the night.

That’s pretty much my use case here. If I’m out for the evening I want “out” mode to activate (I have three states - Home/Out/Away) which makes sure lights are on, but doesn’t switch them off late evening.

Not got the alarm integrated yet (next project!), want to use some of the alarm sensors to trigger stuff, check doors are closed etc.