If you have created when you get home turn on the lights. (the saem logiblock can be used.)Then you have already solved the problem
You basically need applets from your presence sensor via IFTTT to Apilio. One needs to set boolean to “home” to true when you are home and one to set “home” false if you are not home.
you need to have a weather applet to set boolean night time to true after sunset and false after sunrise.
Then 2 time applet to set boolean value to true if after 1530 (or 15 minutes before your earliest sunset depending where you live) and set it to false after 2300. This will make sure it does not run whilst its still day light
Select all three on your logiblock with Evaluate this logicblock when any connected variable changes. selected in advance options.
With action chains positive turning on lights and action chains negative turning of the lights when result is negative.
What I have explained will even run if you arrive home after dark.
Yes, if you don’t have life360 (Free great if you have more then one person at home) or samsung smartthings installed on your mobile. they offer applets in IFTTT for setting Apilio to home
Alternatively IFTTT offer location services but i found it to be unreliable
Hi @francesco.bagnera!
quote=“francesco.bagnera, post:1, topic:951”]
I have created with many difficulties If I GET home at night turn on light 123
[/quote]
Awesome! To rephrase your current applet, it would say “Every time I come home and it is between sunset and 11pm, turn on the lights”. So the “I come home” is the trigger and the “between sunset and 11pm” is the condition.
So now you have to switch the logic. “Sunrise” and “11pm” become the triggers to run the Logicblock, and “I am home” becomes the condition.
How did you trigger the “I come home” in your current working example? With a geofencing app?
Yes I used for "I come home Life 360 (geofencing)"via IFTTT I still wonder If I am able to run the light on if I AM at home, Is there any way to run the light if I am home without using a presence per motion?
then Apilio will know you are home. You will also need to do another one for when you leave home so Apilio knows you are not home.
This will tell Apilio when its night. You will need to do one for sunrise so Apilio knows its day time
Change the times and names to suite you but this is an example of an Applet to tell Apilio that the time is before 11pm
Sorry but I have tried all the different ways to set this:
If I AM Home between sunset and 11 pm turn light 1,2, 3 on.
Previously I set up “when I arrive home between sunrise and sunset” by following this link step by stepby PEBNETER (Apilio team)
And it does work. Probably I don’t understand how apilio works in accordance with IFTTT
Is there anyone (Pebneter) can publish step by step (like the previous link) the action:
If I AM Home between sunset and 11 pm turn light 1,2, 3 on.
Sure, we can help you with this.
So just to be clear: If it is dark and before 11pm (e.g. 10pm) and you ARRIVE at home, the lights should not turn on. Correct?
Hi @francesco.bagnera! I think you have all the right components, but to show you what this looks like step by setp, this is how you would turn the light on automatically if you are home at night:
If I’m home → we will store this in a boolean variable. It’s true when you get home and false when you leave. So if you are home, it stays true all the time.
and it’s between sunset and 11PM → we will store this in a boolean variable as well. It will become true at sunset and false at 11PM.
then turn the lights on → this works exactly as what you have setup already, so there is nothing to change here
How to setup the condition to check you are home
We’ll use a boolean variable to know you are home:
Create your variable in Apilio. Set it to true if you are currently at home when setting it up:
If you are already home at sunset, then the lights are turned on
If you get home after sunset, then the lights are turned on for you then (and not before when you were not home)
This way you can keep both the current behaviour you have and this new one when you are at home
To turn the lights off, it depends on what you want to do. Some options:
you could create a logicblock that turns them off using the second condition we used here, so you can add more conditions to consider
You could just create an IFTTT applet that turns the lights off at 11PM every day if you don’t need to check any additional conditions. (In this case we could also simplify the time condition used here, but I wanted to keep it flexible just in case you need it )
I think that once you have these variables and conditions setup from the step-by-step, you’ll be able to play with it and build your own logic just how you want it
I just wanted to thank you for putting this awesome tutorial together. I just discovered Apilio today and have a similar situation to the OP. I have since set up most items in Apilio/IFTTT, and am looking forward to seeing if it works!
The only part which I did not quite follow was the “Auto Evaluation” under “Advanced options”. Would I want this box checked all the time, given that my motion sensor is feeding a change in variable that is linked to my logicblock? (see attached screenshot for a glance of my setup).
I’m not sure how to edit my previous post, but the sun just set and short story is: yes, automatic evaluations need to be turned on for my particular scenario. Works like a charm now!
Next steps:
Figure out how to shorten the latency between motion sensing and turning the lights on. Currently, there is about a 2 second delay (which I chalk up to the time it takes for IFTTT to communicate with Apilio).
Anna thank you so much for posting step by step directions. Everything is set up and can’t wait to see how it will work later . Will let you know.
Thank you again for the support. Now I think with your explanation I better understand how apilio works
I think I need to write a detailed article on automatic evaluations, they can be a very powerful help for some scenarios!
Basically the simplest case is that you would trigger a logicblock with an event from IFTTT:
if something happens (for example, it’s Monday at 10AM), then tell Apilio to evaluate a logicblock.
But it is also common that your conditions can also trigger your logicblock evaluation. For example, if you have a variable that stores if you are connected to your home wifi or not. This is another good way of checking whether you are home. By selecting the automatic evaluation when a variable changes, this means that every time the variable that stores if you are connected to your home wifi changes to true or false, Apilio will check the full conditions in the logicblock. In a nutshell, this is it:
If I connect/disconnect from my home wifi, check if it’s time to run some actions in this logicblock.
This way you can have logicblocks that are evaluated according to this information that you are already storing to decide if it’s time to run your actions or not. Very handy in many situations!