This smart automation was suggested by one of our users and since sharing is caring, here you have all the details to replicate this at your own home.
Imagine that you want to turn on your foyer lights on when it’s dark at night, but only as you get close to your home. You could use this to quietly let your partner know that you are almost there, or for creating anticipation for your waiting-for-their-night-walk pets . And, of course, to light your way in so you don’t step on anything you should not be stepping on!
For this setup, we are going to use IFTTT’s location service to determine that we are close to home and also any smart plug where a lamp is connected to, so we can turn it on and off.
You could also replicate this checking if your phone connected to your home WiFi for example (as this lets you know you are close enough to connect to your router) and any smart light bulb that you have available, following the same steps.
Quick start template (New!!)
If you are already on Apilio, this is the Apilio template that sets up everything you need:
https://app.apilio.com/quick-start/6
Manually setting up the complete routine
One Logicblock that combines:
- One Condition: check that it’s nighttime
- One external trigger: check that I’m close to home
- Two Actions: one to turn on the light and one to turn it off.
Over in IFTTT, you will be connecting 3 applets: one is the trigger and two are the actions.
1. Creating my Condition
At nighttime
This is a native Time Condition in Apilio: we will setup a time frame that goes from the sun setting to the sun rising.
2. Setting up the Logicblock
Your new Logicblock, ‘control_foyer_lights’, uses the condition we just created, plus an external IFTTT trigger we will setup later. Remember both conditions must be true: when the trigger happens, we check if the nighttime Condition is also true. Only in this situation we will run the actions.
Setup two IFTTT Actions with two event names such as: “foyer_light_on” and “foyer_light_off”. We will connect these later in IFTTT with an applet and your snart plug of choice.
3. Setting up my Actions in IFTTT
Our Logicblock has only two actions, both of them are in the positive actions chain. To turn on and off the light, we are controlling this with a smart plug. Apilio takes care of the 30 minutes delay, so that the IFTTT setup is easy-peasy. You will need the following two applets setup, just follow the steps:
To turn on my the foyer light on:
The applet we’ll enable is If IFTTT receives the event ‘foyer_light_on’ from Apilio, then turn on my LIFX smart light bulb. Here’s the applet you need to enable:
To turn my outside lights off:
- The applet I want to create will be: “If IFTTT receives the event ‘foyer_light_off’ from Apilio, then turn off my LIFX light bulb. Here’s the applet you need to enable:
4. Setting up the external trigger
This is the applet that you need to enable: when you enter a specific area (getting closer to home), run the Logicblock you have created for this automation:
And we are done! Now you have a light that will only turn on at night, when you are getting home.
Can you think of other situations where this might come in handy for you? Let us know how you have tweaked this example to suit your smart home needs below.
November 2020 update: If you don’t have a LIFX light bulb, we have a handy list of ready-made applets with many other light bulb brands.