This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
Location / presence detection solution IFTTT with multiple users
muesli
Member
A lot of homey users like me have problems with presence detection to trigger flows. Since build-in presence detection is not working (most of the time) i'm using a different solution. I tried to install Mosquitto on my Raspberry but the attempt failed because my distro was not up to date and i couldn't update. Better Presence and Smart Presence were not suitable for me, i wanted GPS detection. You can only connect one IFTTT account to Homey, so that's a problem for personalized actions (flows with different lightning, different music, temperature, alerts etc). However, there's a workaround...
What's the alternative? Use as many IFTTT accounts as you like. Trigger an applet based on GPS location and execute a get webrequest via maker webhooks. You can use the Webhook Manager app in the Homey appstore to get an webhook URL. This way you can execute a flow. If you're new to this, it's not as difficult as it sounds. Follow the steps below:
1. Install Webhook Manager app from Homey app store
2. Create a flow with webhook (name) and action
3. Go to settings and click on Webhook Manager app. Copy and modify the url. My url is https://webhooks.athom.com/webhook/xxxxxxxxxxxxxxxxxx/?token=xxx&event=webhook-x-home (the bold letters should contain your own token and eventname)
4. Got to https://ifttt.com/create (create an account if you don't have one) and create an applet.
4.1 Use a 'location' trigger, connect and set an area
4.2 Create an action 'maker webhooks' and connect*
4.3 Paste the modified url: https://webhooks.athom.com/webhook/xxxxxxxxxxxxxxxxxx/?token=xxx&event=webhook-x-home
4.4. Method should be 'GET' and Content type 'Application/Json' and Save
Note: on Mac/Linux you can test the maker webhook > flow in your terminal: curl -X POST https://maker.ifttt.com/trigger/webhook-x-home/with/key/xxxxxxxx
Now when you exit or enter the area the flow should be executed. You can make it as complicated as you want.
So if your wife of children have other IFTTT accounts, you still can use the same url to trigger a flow.
My flows are a little bit more complicated since i use the 'Better logic' app to set the status of everyone's presence. If nobody is at home anymore, the alarm will be armed. If anyone is coming home, then the alarm will be unarmed.
Good luck, i hope it is useful to anyone!
What's the alternative? Use as many IFTTT accounts as you like. Trigger an applet based on GPS location and execute a get webrequest via maker webhooks. You can use the Webhook Manager app in the Homey appstore to get an webhook URL. This way you can execute a flow. If you're new to this, it's not as difficult as it sounds. Follow the steps below:
1. Install Webhook Manager app from Homey app store
2. Create a flow with webhook (name) and action
3. Go to settings and click on Webhook Manager app. Copy and modify the url. My url is https://webhooks.athom.com/webhook/xxxxxxxxxxxxxxxxxx/?token=xxx&event=webhook-x-home (the bold letters should contain your own token and eventname)
4. Got to https://ifttt.com/create (create an account if you don't have one) and create an applet.
4.1 Use a 'location' trigger, connect and set an area
4.2 Create an action 'maker webhooks' and connect*
4.3 Paste the modified url: https://webhooks.athom.com/webhook/xxxxxxxxxxxxxxxxxx/?token=xxx&event=webhook-x-home
4.4. Method should be 'GET' and Content type 'Application/Json' and Save
Note: on Mac/Linux you can test the maker webhook > flow in your terminal: curl -X POST https://maker.ifttt.com/trigger/webhook-x-home/with/key/xxxxxxxx
Now when you exit or enter the area the flow should be executed. You can make it as complicated as you want.
So if your wife of children have other IFTTT accounts, you still can use the same url to trigger a flow.
My flows are a little bit more complicated since i use the 'Better logic' app to set the status of everyone's presence. If nobody is at home anymore, the alarm will be armed. If anyone is coming home, then the alarm will be unarmed.
Good luck, i hope it is useful to anyone!
Comments
- Should the IFTTT app be installed?
- Should it run in the background?
- Should Location detection be switched on?
I have done some trials and it does work fine following above tutorial. I was wondering though if it would also work with a different status of above three points.
Each of the IFTTT apps on the mobiles can connect to the same IFTTT channel. Let's say that one of the main account.
Install the IFTTT app on each phone with its own user and connect to the Homey channel, using the id of the main account.
When you trigger a geofence on the IFTTT script for that particular user on the mobile, have it connect to the Homey channel and provide the 3 variables that are supported via the Homey channel with values of your choice.
I am using the first variable to indicate the user triggering the event and other variables to indicate leaving/entering and the 3rd to say where from. With this setup, I can trigger flows in Homey, for example to put the outdoor lights on when any of my family members are getting close to home.
This feels a little more straight forward than the setup with webhooks.
Curious to hear others who may have even simpler solutions.
- Should the IFTTT app be installed? YES, each phone needs the to have the IFTTT app installed.
- Should it run in the background? No, as long you are signed in in the IFTTT app.
- Should Location detection be switched on? YES, and the IFTTT app should be set to Always use Location Services.
Please correct me if I'm wrong.
-In homey I used two flows with as trigger IFTTT: "IFTTT someone comes home", "IFTTT someone leaves" (I used the first variable from IFTTT to set which person is coming home / leaving).
-In IFTTT I used the Location, You enter an area, as a triggger for the homey flow "IFTTT someone comes home"
-In IFTTT I used the Location, You exit an area, as a triggger for the homey flow "IFTTT someone leaves"
-In IFTTT I used the "Android device connects to specific WIFI network" as a triggger for the homey flow "IFTTT someone comes home"
-In IFTTT I used the "Android device disconnects from a specific WIFI network" as a trigger for the homey flow "IFTTT someone leaves".
The flows in Homey with the IFTTT Trigger only sets the person away status (and a debug push message to my phone for now). All other flows with the trigger "A person left" / "A person came home" are run then automatically. So IFTTT is only replacing the homey app presence detection so to say.
As homey changes the home/away tag using this way the triggers "nobody is home" etc are usable as well. Also it is possibile to use "a specific person came home" etc.
It is possible in this way that a person is leaving twice shortly in a row, but as the homey status of that person is set to away the first time, no flows are triggered the second time. For coming home the same, it is possible a person comes home twice shortly in a row, but nothing happens the second time.
I already noted now that not always both IFTTT events are triggered, so it is a nice backup in this way.
I hope you can follow my explanation, if not just ask
PS I turned off the presence detection in the homey app for now, to prevent interference
Can you post printscreens of the flows, cause as a newby I cannot follow the description.
Base-elements are there: IFTTT-app installed btoh on iphone and homey. Now get them to work together ....
Thanks in Advance
I think I managed (ifttt finds the flow.... now I must make the flow working).
The trigger is part of the "Android Device" set in IFTTT:
This is my flow (in dutch, I'm sorry). I blacked out our last names in the screenshot, no relevant info there.
For away it is the same, only difference is it sets persons as away instead of home
PS it is @KvM not KMV :-)
for me this is still working quite well. Most of the time the WIFI triggers first (both when coming home and leaving) sometimes the GPS is quicker and the lights turn on when I'm still parking my car :-)
I added a time-out (60sec) for the "nobody home flow" to prevent the lights to go off when a short glitch in the WIFI connection is experienced. Normally this is no issue when more than one user is at home, but last week one time the lights went of when I was home alone
Want to test the maker webhook > flow in terminal. What is expected as a key in this URL "curl -X POST https://maker.ifttt.com/trigger/webhook-x-home/with/key/xxxxxxxx" ??
My token or what? I constantly get a "You sent an invalid key" no matter what I try.
/POB
Var2 I use for the debug message, debug message tells me if it is triggered with GPS or WIFI.
General update: I had some issues on the Samsung Note 8 closing the background IFTTT app every week or so, but since the last android update this is resolved. 100% stable / accurate on a Galaxy S7 as well. Debug messages are still on but I never miss a trigger both the GPS and Wifi trigger are working perfectly :-)
I use 2 IFTTT accounts however. Both IFTTT accounts I connect to Homey in the IFTTT Web interface. Click "settings" in this screen (www.ifttt.com/homey):
And then you get this screen where you can connect with your homey credentials:
In this way, both you're IFTTT accounts can be connected to homey.
Next, in homey you make a flow with a IFTTT trigger:
And then when you make an applet in IFTTT you can choose this as an action:
I hope you understand better now, if not let me know :-)
Just found this post, and looks like a nice system.
I configured an applet to test with my IFTTT-account when I leave home.
The url I use is:
https://webhooks.athom.com/webhook/xxxxxxxxxxxxxxxxxxxxxxxx/?token=xxxxxxxxxx&event=IFTTT_Fire69_Away
I created a flow with webhook-trigger "IFTTT_Fire69_Away"
The applet runs (I set an alert in IFTTT) but the link to Homey isn't working.
When I test with curl it returns this message:
"ok_but_no_matches"
Any idea what I could be doing wrong?