I have geo location setup using Life360 to turn on and off the camera when I enter or leave home.
I now want to setup my porch light that is on a wemo switch, to turn on when i arrive home but only if the hour of day is between sunset and sunrise.
Ia this possible?
Here are my steps
Apilio
Created boolean variable "Night_Time"
Created condition "It'Night Time"
IFTTT
Created app with weather. If Sunrise make web request (url where "Night_Time" set to false)
Created app with weather. If Sunset make web request (url where "Night_Time" set to true)
Created app with Life360. When person arrives home, turn on wemo light switch
I think this is where I am getting lost and spinning myself further into confusion.
Hello, I am new to all of this as well, Many thanks to cghall and pebneter for the information so far. Being a newbie, it took me a while to work through the steps above and my setup does not work so I deleted all of the Applets, Aplio commands etc and started new. I thought I would write out the steps I took to. Maybe someone will be able to point out where I went wrong.
I have a Wemo Insight switch connected to my garden_lights. They work fine on the Wemo app and/or with a simple IFTTT recipe.
I know the Life360 geofence is running as I set up IFTTT recipes to SMS my phone when I arrive/leave.
I know the Weather Underground is working and identifying sunset as I get the notification that the Applet has run.
Lastly, I also get a notification that the ‘Maker event maker_wemo_on, then turn on garden lights’ applet is running as well.
So here’s the steps I took:
1. Log into Apilio
2. Follow the link on the Apilio page to the Maker channel key page https://ifttt.com/services/maker/settings
3. Click on Connect. This updates your Account Info and gives you an URL address, something similar to https://maker.ifttt.com/use/a12BCDEfg45hi67JKl89
Copy this URL and paste it into a Word/text document.
4. In Apilio, create a Boolean Variable called “night_time”, leave the Value as True, click Save. You will be presented with three URLs under the headings Set true, Set false and Toggle. Copy these URLs to Word.
5. In Apilio, click Conditions, Click create a New Condition for Boolean Variable, name it “it_night-time”, the Variable box will already contain “night_time”, I left the Required state as True and left the Unmodified since and Modified within boxes empty, click save.
6. In IFTTT, click the down arrow in the top right corner, click New Applet. Click This and then search for “Weather Underground”, click on Sunrise, click on that, search “Maker” and click on the Maker logo, click on “Make a web request”. In the URL field paste the URL from under the Set False heading in step 4., Click Create Action, Click Finish.
I did not know what to in this step with all the options in Maker. I did not click + Ingredient, the Method was left as the default GET and I left the Content Type and Body field as they were.
6. In IFTTT, click the down arrow in the top right corner, click New Applet. Click This and then searched for “Weather Underground” again, click on Sunset, click on that, search Maker and click on the Maker logo, click on “Make a web request”. In the URL field paste the URL under the Set True heading in step 4., Click Create Action, Click Finish.
7. Create an account on Life360.com and set up a Place. I made an area covering about a mile radius from my house. I called it Home. I also added the Life360 app to my phone.
8. In IFTTT, click the down arrow in the top right corner, click New Applet. Click This and then searched for Life360 and clicked on the logo, click on “You arrive at a specific place”, it loaded my place called Family-Home in the drop down box and I clicked Create trigger. Click on that, searched for Wemo and clicked on Wemo Insight Switch, click on Turn on, in the drop down box selected “Garden Lights”, click Create Action, click Finish.
9. In Apilio, click Logicblocks, click New Logicblock. In the Name field I wrote wemo_on_dark. I checked the Conditions box next to it_night_time. Under the heading IFTTT Maker Channel Event Name heading, in the IFTTT Maker Channel Event Name I entered “maker_wemo_on”. Left everything else the same and clicked Save. I received a message that said Logicblock was successfully created and Note: Your Logcblock can not trigger any actions until you save your IFTTT Maker Channel API Key
10. I clicked on the link to create an IFTTT Maker Channel API Key, paste the URL from step 3. Click update, click save.
11. Click Logicblock, click on edit next to wemo_on_dark, click save and then copied the URL under the heading “Evaluate”.
https://apilio.herokuapp.com/logicblocks/wemo_on_dark/evaluate/with_key/123435466[edited]
12. In IFTTT, New Applet, this, search maker, click on Maker Logo, Click on Receive a web request, Event Name “maker_wemo_on” as in step 9, click create trigger. Click that, search Wemo, click Wemo Insight Switch, garden Lights, create Action. Click Finish
13. In IFTTT, click on My applets, click on Life360 applet I created earlier (If you arrive at Family – Home, then turn on Garden Lights). Click gear icon at top right and deleted this Applet.
14. In IFTTT created a new Life360 Applet, click this, search Life360 and click on logo, click “You arrive at a specific Place”, let Life360 load my Family – Home, click Create Trigger, click that, search Maker, click on logo, click on Make a web request, in the URL I paste the URL from step 11, click Create, Click Finish.
1. Apilio - Create a Boolean Variable:
I named mine “night_time".
This is a true/false scenario. If it is after sunset when you create the setup, set the value as ‘True’. Alternatively, if it is before sunset, set the value as ‘False’
Save the Boolean Variable and you will be provided with Once three URLs, one for each; ‘Set true:’, ‘Set false:’ and ‘Toggle:’
Copy the three URLs to a text document. You will need these details later.
2. Apilio - Create a Condition:
I named mine “It_night_time”
The Variable is the one you created in step one, in my case “night_time”
The Required state is "true"
Leave the Timestamp restriction fields blank.
3. IFTTT - click on ‘Get More’, then ‘IfThisThenThat’ to create a new applet.
Click ‘This’ and search for ‘Weather Underground’ and choose the ‘Sunset’. Change the location to your area and click ‘Create trigger’
Click ‘That’ and search for “Webhooks’. Click on ‘Make a web request’. In the URL field, enter the details of the ‘Set True’ URL you were provided in step 1.
The Method is "GET"
Leave the other options empty. Click ‘Create action’ and then ‘Finish’
4. IFTTT - click on ‘Get More’, then ‘IfThisThenThat’ to create a new applet.
Click ‘This’ and search for ‘Weather Underground’ and choose the ‘Sunrise’. Change the location to your area and click ‘Create trigger’
Click ‘That’ and search for “Webhooks’. Click on ‘Make a web request’. In the URL field, enter the details of the ‘Set False’ URL you were provided in step 1.
The Method is "GET"
Leave the other options empty. Click ‘Create action’ and then ‘Finish’
5. IFTTT - click on ‘Get More’, then ‘IfThisThenThat’ to create a new applet.
Click ‘This’ and search for ‘Webhooks’ and choose ‘Receive a web request’
As an Event Name I entered ‘webhook_wemo_on’
Click ‘Create trigger’.
Click ‘That’ and search for Wemo. Select your device type and the action to turn the device on.
6. Apilio - Create a Logicblock
I named mine ‘arrival_at_home’
I checked the condition ‘It_night-time’ (created in step 2)
In the ‘Actions for a positive result’, ‘IFTTT webhooks service name’ field I entered ‘webhook_wemo_on’ (created in step 5)
Click save
Apilio produces a URL similar to https://maker.ifttt.com/trigger/webhook_wemo_on/with/key###
Copy this URL
7. IFTTT - click on ‘Get More’, then ‘IfThisThenThat’ to create a new applet.
Click ‘This’ and search for ‘Life 360’ and choose “You arrive at a specific place’. Select the area you have set up in Life 360 and click ‘Create Trigger’
Click ‘That’ and search for “Webhooks’. Click on ‘Make a web request’. In the URL field, enter the URL from step 6.
Previously, the Webhooks to turn the switch on was running at 8:44pm everyday (when the conditions have been met), regardless of what time the sunset or what time I arrived home. I reset everything, deleted all the applets and services and started again. Now, my lights come on everyday at 10:34pm.
It has to be an issue with IFTTT. My other applets are running in batches. When I check 'my activity', I can see the delay and where different services are all running in the same minute - hours after the event.
The problem solving continues:
Yes - I am pretty sure I have updated API keys in Webhook and Apilio.
Still no joy. They run according to time, not event.