Stable presence solution (IFTTT)

Original artikel

So I think most of us are still battling presence detection or have given up on it. After a lot of testing with owntracks, better presence, gps trace and others i almost gave up. None of them worked reliable, or it worked on my phone but not on my girlfriends. She didn’t like the alarm arming when i left because homey thought she wasn’t home too. I got presence stable for the last 4 weeks and tested this solution also on a friends homey. Since phone brands behave quite different i need to add this works with;
Galaxy s7 Edge
Galaxy s8 +
Galaxy s9+
Huawei p10 mate (less accurate gps in sleep mode!)
Iphone (some number)

The solution has a double trigger for entering home and a single geo trigger for leaving. I made a ifttt flow that uses geo to trigger a flow that set a boolean and homey’s own presence. I took a range of about 500 meters and put the center of the range circel not straight over my house but more to the direction i take when i travel home. By doing this i can keep the range smaller while the phone gets more time to pick up my location. Most of the time I take the same road home so how earlier i enter the geo fence how bigger the chance it picks me up in time.

The second flow uses wifi connection. I could have done this through the asus function ifttt has but chose to do this phone based to test this for most situations. It simply triggers the same flow wich sets the same boolaen/presence. Sometimes the gps is just too slow, seems depending on the sleep state of the phone and the interval. When i get home and the phone connects to the wifi the flow triggers and things happen. Most of the time it seems that this also makes the phone update the location since the geo flow always runs after the wifi connects.
(Note, i could’t find this on the iphone version so i used only geo on the apple device, wich works stable)

I use 2 flows because i want a back-up. If the geo is too slow or my wifi is off i still don’t want to reach for my phone to disarm my alarm. In daily use it works 70/30 gps/wifi. Only when i’m in a huge hurry and rush to the front door it triggers to slow. Then i have to wait a few seconds with the key in the door till i get the push message. In normal use it works great for me.

To leave the house i use geo location. I draw a circle with my house in the middle. When i leave the circel it triggers a flow that sets the home boolean to false and marks the homey presence to away. I don’t use wifi for this one because sometimes my phone isn’t on wifi, for example when i’m testing things. I made the circle about 150 meters. On my girlfriends huewei phone this needed to be a lot bigger, around 600 meter. The huewei phones seem to drop accuracy a lot while in sleep mode. Earlier tests with owntrackes showed accuracies of up to 1300 meters! 600 seems stable for us. Sometimes it suddenly triggers but that also seems to wake the phone and then it triggers the home flow within seconds again. The nice thing about IFTTT is that you can fine tune this per device. Its a bit of try and error to get the area as small as possible but still reliable.

So, how do you set this up?

  1. Install https://apps.athom.com/app/com.ifttt on homey. Go to settings, ifttt and connect with a account.

  2. Install IFTTT on your device and connect to the same account and stuff.

  3. Make a flow, start with IFTTT and fill in whatever you want. This will be your trigger. In the THEN column set your presence in a way that suits your flows. I’m using boolean but in the end it depends on how your system is build. Also make a similar flow that marks you away.

  4. Take your device, open IFTTT, press my applets in the bottem right, then the + in the top right. Press the blue “+ this”, type “android”, select android device, connects to a specific wifi network. Type the name of the network, this is case sensitive! Has to be exact!
    Press the V on the right top and then you get to press the blue “+that” button. Type “homey”, select and press trigger a flow. A drop down box shows up and you can select the flows you already made in 3. I can use the variable’s as tags but i left them blank. Press the V on the right top and press finish on the next screen. Thats it.

  5. Same as 4 but type “location”, select you enter an area, press edit location, press get current location and adjust the range circle to your needs. Save in the top right , then again the top right V, and then do the exact same as 4, connecting to the same flow.

  6. Same as 5, but select “you leave an area” and connect this to your “leave” flow.

Done. You might need to fine tune the ranges but this will be specific for your phone and needs.

Good luck and let me know how this works for you. Also it might be handy if you post your phone brand and range settings so other people using this solution got an already tuned range to start with.

Happy to answer questions.

Pics/screens

4 Likes