I've done quite a bit of work on 'presence' detection in all sorts
of ways. Recently I turned my attention to personal/bodily
presence. I want my house to know if I'm at home. Like so
many things, this sounds trivial & it isn't.
To cut a long story short I determined that the presence of my
mobile phone in my house was good enough to decide if I (or
Elvis!) is at home. It seems that this isn't an original idea - a
few other people beat me to it. I'll add links if I find them
again.
Recipe
We know Elvis's IP address from his phone and/or we can fix this
as long as we know his MAC address. I constrained my router to
ALWAYS assign the IP address 10.0.0.106 to Elvis:

We 'ping' his phone which tells us if he's in WiFi range.
If he's gone for more than, say half an hour, we assume that
'Elvis has left the building.'
We need to know!

So - in the Node Red flow above, we ping Elvis every 5 minutes. If
we don't get a positive response after half an hour we assume that
he's left the building...
If he's gone I'll get a text message (the red box)
The picture above might look abstract. It isn't. This is a REAL
program.
This could be extremely useful, BUT there's a
snag. My iPhone (& every other iPhone!) disables WiFi when
it's in standby & there isn't a simple way around this.
However, all is not lost! WiFi IS enabled when my iPhone
is charging & when I use it, so the strategy here does have
some use, even if it's limited!
Perhaps a reasonable expectation would be to conclude that I'm not
at home if I don't respond to pings for a few hours? Perhaps I've
gone away for a few days & forgotten to turn off the heating?
To my acute embarassment, this took me ages to debug! I'd
go shopping with my phone & check it for messages. Eventually
I realised that all I needed to do was switch off the WiFi on
my phone... Der...
Here we go:

Ian Sexton 2015