Presence awareness for families - Part I: knowing who is at home

Is anyone there? :house:

A very common quest among smart home owners is to automate events based on the presence of any family member: Turn lights on/off, reduce/increase heating or cooling, arm/disarm video cameras and so on.

Therefore it’s a common need for your home automation system to know if someone is at home or not. There are multiple approaches to solve it:

  • there are some specialised apps that can track all family members,
  • presence detection is built into Apple HomeKit and Google Home,
  • another idea is to check if someone is connected to your home WiFi to know if they are home (here’s an article on how to do this),
  • and many others!

In this article, we’d like to demonstrate how you can get the needed information in Apilio by using a specialised smartphone app for geofencing. This is quite easy to setup and doesn’t give you the feeling like you were spying on your family members :male_detective:

Setting this up, step by step:

Variables: store who is at home

Let’s imagine a family of four: Laura, Pete, Jessica, Max.

Apilio uses Boolean variables to store simple yes / no information (or in this specific case: “Home” / “Not Home”).

So let’s start by creating Boolean Variables for each person:

  • laura_home
  • pete_home
  • jessica_home
  • max_home

Being privacy-conscious and knowing if your family is at home

So far we have prepared a place to store the state for everyone - great! But how can we update those automatically?

In this example we will use a smartphone app to achieve this. You can use any app that does geofencing and can call a web URL (often referred to as “webhook”) on entering or exiting an area.

It’s great to know that this approach is privacy aware: You are not tracking your family member’s exact position nor is Apilio. The only information the app provides to Apilio is that there was an entry/exit event for some geofence somewhere on Earth. A geofence is only there to tell “In” or “Out” - and nothing more.

There are multiple apps available in the app stores. We have tested and liked Locative for iOS and GeoFencer for Android.

Sidenote: On iOS, there is also Apples Shortcuts app which looks like it could do the job through “Automations”, but unfortunately it doesn’t, as it needs you to tap an icon to confirm whether you are at home (check the list of automations that cannot be run automatically: https://support.apple.com/en-gb/guide/shortcuts/apd602971e63/ios), so it won’t serve our purposes.

Linking in your family

Kindly ask your family to install the geofencing app of your choice and you are set to start your Smart Home revolution! :stars:

In the meantime, go to each Boolean Variable created, copy the URLs for “Set true” / “Set false” to a message and send them to the right person (they contain a long, impossible-to-memorise string, so dictating is not an option).


Full documentation: How to use webhooks to update variables and trigger logicblocks in Apilio

Then each one shall create a geofence in the app and configure the individual “Set True / Set False” webhook URLs provided by you. One URL will be triggered when they exit the geofence (set to false) and the other one (set to true) when they enter it.

And that’s it! Now Apilio will store the information “Home” / “Not Home” in a Boolean Variable for each family member. Send everyone off for a walk out of the geofence (assuming you are not under Covid lockdown :grimacing: ) and check the Apilio event log on your dashboard (here’s some details regarding this log) to review if everyone’s status was updated correctly.

How to use those states in automation: part II

Now that you have a nice switch that tells you wether each family member is at home right now, we’ll see in the next article how to setup the conditions and logic you need to automate things based on who is at home:

3 Likes

Good to know about that app. I didn’t know it.

2 Likes

I’ve been using locative with my Apilio smart home set up for approximately a coupe of months now. It’s been a great success as I have a similar Apilio setup to the example for my wife and I. Since using the locative app on both our iPhones I’ve found it reliable and accurate. Something I couldn’t say for the standard IOS location app.

Would highly recommend this solution.

2 Likes

Thanks for the feedback, very helpful.

I found this Android presence sensor, as I’m not that technically minded I am not sure if its any good or if it can be used
https://owntracks.org/booklet/

2 Likes

That is nice project, but as far as I know it is designed to constantly send location data, not just geofence events (which is a lot more than Apilio needs to work)
The idea is that a user hosts his own server (for privacy reasons).

1 Like