Stable presence solution (IFTTT)

On the old forum there is a post with this tittle. I have used this for testing a presence solution.
So far it seems to work. Finally i have found something that does work on my devices.
However still having some questions so placing it here again.

In the post i find a picture made by rickp

II made the same flow in my homey and IFTTT and so far it works even installed simple log so that works also. However the part of “better logic” i don’t understand . Installed better logic but never worked with it.

What does this part do? If i copy it it gives an error. But if i don’t know where its for also don;t understand it.

Can someone explane me this part.

So far happy wit the IFTTT presence part.

greetz Frans

1 Like

Did you first define your better logic variable?? before you use it in the flows.

Hi Roy,

No i did not define a logic variable. I have no idea how to use this "beter logic "part.
Is there no Tutorial somewhere? Of course i can ad this but i have no idea what is does?

greetz Frans

Hi frans. You could do without betterlogic. I use it to have a better view of when a states changed for the last time and to make it more easy to switch a status manually.

This gave me more insight on whats happening inside homey and to find out why some flows weren’t working as planned.

If you would want to use it you need to make, as suggested by Roy, a value in betterlogic. Go to settings, betterlogic, give it any name you want, chose boolean and hit add. Now you can use that exact boolean value in the flow.

But if you have no need for trouble shooting and your system isn’t build on/with betterlogic I would suggest just to stick with the normal precense. (“mark home/markeer als thuis”)

Oke i have got i working without the use of better logic now. However i would love to learn more about this. So far i can’t find a smal tutoral about this app. I am not yet 100% happy with the IFTTT flows so still working on that.

greetz Frans

Well, in short and to stay somewhat ontopic, i set boolean’s when a status switches. This way i can see if and when a switch happend so i can easily see if something, for example presence, is working. If necessary i can also switch manually by pressing the edit button.

Then in flows i use them in as example "if motion detected in overloop AND overloop donker is true THEN switch light.

All these functions can be made in lots of different ways, for example with tags. I chose this way for the earlier ment reasons. If you have more questions about betterlogic you might make a topic for that to keep everything clear:)

Hi Rick,

Thanks for the explanition. I will have a try to see what hapens .
And your right i am going off topic so when i wil have some more time i will start a new topic about the functions of Better logic.


How did you use IFTTT for both different flows? I made an IFTTT applet myself, firing when I’m at home or leaving home, but I can only find one applet that applies for both exiting and entering an area.

I have made one flow for entering in Homey. I made one applet that uses location and one that uses the wifi connection. So when you connect to the wifi it runs the same flow as location does.

It runs but is not :100: %. Because we Both have android phones (Huawei) it sometimes disconnects the WiFi. When i am alone at that moment Homey set the alarm to ON. Therefore we user the wifi applet only for entering now. So its 2 applets for entering and one for leaving (location baard)

I’m using this applet for location right now:

But it fires ‘Exited’ and ‘Entered’.

The app works fine for pushing presence to Homey, but is it possible to distinguish between entering or exiting in Homey? How should I be doing that?

Make 1 applet for “i entered a area” on ifttt and connect this to your homey flow (set home).
Make another appled with “i exited a area” on ifttt and connect this to the homey “away” flow/status.

Thats why i didn’t use wifi to set the away status. Also sometimes i turn of wifi to try stuff out wich also armed the alarm. Location works fine for me (leaving). Sometimes its a bit slow but it does work. Huewei phones demand a big range. Their gps positions go way off when the phone goes into dooze mode.

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 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.



Thank you, that helped me big time! Hopefully it works!

1 Like

Hi, first of all thanks for the explanation how to set this up. I managed to do so successfully for 3 of the 4 family members, one iphone 7, one nexus 5x and one CAT40. The problem is the fourth one (also a nexus 5X). This one is not triggering the presence flow. I have checked and IFTTT has access to the location on the mobile. Any suggestions as to how to do debugging? Can I somehow see whether or not the applet did indeed trigger and tried to connect to Homey? Thanks!

This is best working Solutions.

Weird that Homey app doesn’t always trigger correctly where ifttt does.

Does anyone know if this workaround / solution is still necessary as of now?

At the moment I have better results with the homey app. IFTTT drops me all around my house and at a very uneven interval. The homey app works like a charm.

I user both combined at the moment.

Atm I’m using a. Bluetooth beacon and I’m very happy with that. Gf’s huewei phone was a hell to get working properly due to huewei battery saving.

Must admit i havent tried the homey precense for some time now. Still sick and tired about that

i tried it for a few days with my huawei mate 20 pro. Still doesn’t work reliable.