Getting started - An introduction to Apilio

With Apilio, you can connect smart devices and services to create your own custom routines. If you would like to do things like:

  • Control all the lights at home depending on who is there and what time of the day or the year it is, adding delays to turn things off
  • Save money by running your AC or heating depending on the temperature difference between inside your home and outside and the weather that day

Then keep on reading because Apilio is perfect for you! :smiley:

Logicblocks evaluate conditions and execute actions

Logicblocks are what we call routines in Apilio: they combine lists of conditions and lists of actions, like this:

:point_right: IF all these Conditions are true, THEN run all of these Actions

Most routines usually just check if all conditions are met, but Apilio logicblocks can handle more customization, like:

:point_right: IF any of these Conditions are true, THEN run all of these Actions
:point_right: IF this and this or that, THEN run all of these Actions

Conditions

Your Conditions are the requirements that must be met for Apilio to execute a list of actions:

  • It’s between Sunset and 12PM
  • I’m connected to my home wifi (so that means I’m home)
  • The weather today will be “snow”

Actions

Your actions are what you want Apilio to do when your conditions are met. You can add delays (like a pause before the action is executed) and combine different types of devices and services:

  • Turn on the foyer lights
  • Send an email notification to Abby telling her I’m home
  • 30 minutes later, turn off the foyer lights

Using your smart devices and Apilio

Thanks to our native integrations with IFTTT and Tuya (Smart Life), you’ll be able to connect with close to 700 brands of devices and services from Apilio! LIFX bulbs, TP-link plugs, Neatmo stations, Tuya (Smart Life) sensors… and many more, all combined in one single logicblock if you want to.

To allow you to use your devices with Apilio and build Conditions that use those devices, IFTTT can send event information over to Apilio. Apilio will then store this information about your devices in its “memory” in the form of Variables.

You can store yes/no (on/off) information, text or numbers. For example:

  • In a yes/no Variable (we call these Booleans), you can store whether your phone is connected to you wifi. Use this to create a condition that knows when you are home.
  • In a text Variable (we call these Strings), you can store what the weather will be the next day. Use this in a Condition to decide if tomorrow is a good day to water the garden.

You can find more examples and inspiration here. All comments and questions are welcome! :slightly_smiling_face:

:bulb: Related articles

The Apilio team and the Community are here to help!

If you have any questions or need help getting started, simply open a new post :slight_smile:

2 Likes

I am using the foyer light logic block to turn light on when ring doorbell detects motion between certain times. However if I turn the light on manually outside of the logic block condition time and motion is triggered the light turns off 5 minutes after motion trigger. I can’t understand why this happens outside of the time condition?

1 Like

Thanks for this @fcc2611 - perhaps you could share a bit more info? Are you using a time condition and a detection condition or how do you have it setup? DanT

1 Like

I suspect is because you have switched the light on outside the time frame you have set. So when a trigger (motion) is activated the logic block will switch of the light as it is a negative result. I assume that you turn the light on as it is to dark outside your time frame. I had the same problem and instead a used a light sensor instead of times to get round the problem

Thanks. Yes that’s what is happening. My trouble is that I only want the light to come on for 5 mins between 11pm and sunrise if motion is triggered at the door.

If I use a light sensor instead of time condition, I would have thought the same would happen if I turn my light on at say 9pm when it is dark? It would turn off after 5mins of detecting motion.

If you have included a time condition “from 11 pm to sunrise” in your logicblock, that logicblock should not be triggered outside that time interval.

Can you paste a few screenshots with your time condition and logicblock configurations? There must be something wrong.

Does your logic block have a negative condition that turns the light oFf after 5 minutes. Then that’s where the problem may be. Instead set the logi lock to only respond to a positive result that turns the light on. Then after 5 minutes turn the light off. If at anytime during the day you manually turn the light on it will stay on as nothing is run

1 Like

Thanks, any chance you could share the relevant Logicblock so we can see the evaluation logic?

I have an idea why this happens. To be sure, can you also share your Logicblock configuration?

1 Like

1 Like

Thanks, that’s helpful. I think it’s happening because your logicblock is being evaluated negatively outside of your time window so although the light will not come on outside your time window it will still go off as the Logicblock is always evaluated negative outside of your time window. I normally set one logicblock action for lights on and then another for lights off so I can be more explicit about behaviour.

So for lights on I normally have a condition for the PIR trigger and use AND with the time condition in a lights-on logicblock so that the lights only go on during the time window.

I then add a second condition for lights off that requires the PIR trigger when it switches to None - with a delay of 5 mins in case the PIR sends a None event sooner than I want it. I then have a lights-off logicblock to AND with the time condition so it will only turn lights off during the time window. The :mage: @pebneter always has a better, more succint way of doing it but I’m not a developer and so I can understand the logic with this method. Hope this helps! DanT

1 Like

Thanks for the screenshots, @fcc2611: This confirms my hypothesis.

To understand the unwanted power off, think of when the Logicblock will be triggered:

  • Someone triggers the motion sensor
  • Motion sensor times off

So if you switch on the lights, say at 22pm, and then someone walks past the sensor, the Logicblock will be negative (because its before 23pm) and the light will immediately switch off.

You could avoid this by using multiple Logicblock as @DanT described, or by putting the “off” action in the the same action chain as the “on” with a fixed delay of 5 minutes in between.

2 Likes

Thank you all, makes perfect sense and seems to have done the trick! Fantastic!

2 Likes