How do I get automatic evaluation of logic blocks

Hello all! I’m glad I found Apilio! I think it is perfect for what I want to do after playing with the basic IFTTT logic. I am having difficulty with automatic execution of logic block. My goal is to get my curtains to automatically close with weather, time and maybe a few more input. I want my logic (as a start) to be:

If time is between 1 pm and 6 pm AND is sunny, THEN close curtains.

I set up a time condition for the time variable and got the wunderground connection in IFTTT to change my boolean variable in apilio, but I cannot find a way to get it to execute and check that it is sunny during the times.

I read some posts here that I could set up a trigger within IFTTT to run the logic block, but that is based on a specific time. I want the logic to be if its cloudy at 1:32 pm, then keep the curtain up, but if its sunny at 2:20 pm, then close them

Essentially I want to check my logicblock every minute (or some set time interval)

Thanks! Hopefuly I desscribed my problem, but if not, happy to share screenshots of what I have right now :slight_smile:

3 Likes

Clarification, how will you know its sunny? I have light sensors and when they go above a certain brightness the can initiate a logi block

1 Like

And would you like them to open again if it stops being sunny?

@Drivingforce I wish I had a light sensor! No, I’m acutally using the Wunderground applet in IFTTT to change a Boolean variable in Apilio. Wunderground has a function that looks at current weather condition (Sunny, Cloudy, Rainy and Snow) that changes when the condition changes.

@DanT Yes, if its still between the hours of 1pm and 6pm, and the condition changes from cloudy to sunny, then close the curtains

1 Like

Thanks for the info

I would do the following
Logiblock with the time variable 1300-1800 as you have now.
Ensure the “trigger logicblocks using this condition” is selected.

I would have a boolean value set to true if it is clear
I would then have cloudy and rain set the boolean value to false

So if its clear sky outside and the time is 1300 it will shut the curtain and when it reaches 1800 the will reopen.

I have found that the wunderground has an up to 15 minute delay before it changes so you will need to take this into account

Your Boolean variables has conditioned linked to it. So when its clear the boolean value is true. When its raining/Cloudy the variable is false making the condition false. within the condition ensure the trigger condition is ticked. This will auto evaluate your logiblock if it changes

So for example at 1300 the time variable will trigger the logiblack to close the curtains if clear is true.
later on at 1400 the wunderground say its cloudy the “clear” boolean value will change to false. As you have selected the trigger condition when it changes it will re-evaluate the logiblock and as the result has changed negative the blind will open.

Your action chains i assume as follows

If logiblock is true (between 1300-1800, clear skys) the curtain will close
If logiblock is false (outside time frame or cloudy/raining) the curtain will open

Hope this makes sense

2 Likes

Right on time with the freshly released new feature :grin: :tada:

2 Likes

Good job it does or I would have caused confusion :rofl:

1 Like

Ahh yes. I think I was getting hung up on the opening at 1300. Looks like I missed the “trigger logicblocks using this condition”! option for the time variable!

Thank you! I think I finally understand the flow of Apilio and ready to make some cool logic elsewhere-Great job to the Apilio team! Of course I will share! :slight_smile:

3 Likes

Do not worry, you didn’t miss it. I was lucky enough to have beta access (forgot I had it :woman_facepalming:) so was talking about something that wasn’t available to you untill today.

3 Likes

Hmmn, I realise I’m a bit of an old timer but does WU update the Boolean to false if it’s not clear? I don’t think so, so it’s likely you’ll need to add a few more applets to take care of all weather conditions. The following suggestion is in the interests of information sharing…

  1. I’d set an Apilio timeframe condition from 13:00-18:00 each day.

  2. I’d then set up 4 x IFTTT applets to get WU to update an Apilio string Variable, maybe called “current_weather” when the weather changes. I’d then link that Variable to an “is_it_sunny” Condition in Apilio that would only be TRUE if the “current_weather” string Variable contained the text “clear”. I’d tick the Trigger box to make sure we trigger Logicblocks using this Condition whenever the Condition changes.

  3. I’d then add a Logicblock that is triggered by a change in the weather Condition to check we’re within the timeframe condition AND that the weather is “clear”. If so I would then add an action to close the blinds.

  4. I’d then add a second Logicblock that is triggered by a change in the weather Condition to check we’re within the timeframe condition AND that the weather is not “clear”, i.e. the weather variable Condition does not contain “clear” and use the Condition change to trigger the second Logicblock which has an action to open the blinds if it’s 13-18 and not clear.

I think you need the second Logicblock rather than using a negative action in the first Logicblock as otherwise the blinds may be triggered to move outside of the 13-18 window (pardon the pun!).

Hope that helps rather than complicates!

Dan

Yes. It validated everything that I had just finished coding yesterday! I’ll have to take a look at the second logicblock. It worked fine yesterday, but having some hard logic won’t hurt!

The main problem I ran into is the WU applet. Seems delayed to trigger updates for the 4 conditions. Any ideas for a better source of weather?

2 Likes

I am not aware of any alternative, although I’m sure there are other services outside IFTTT that provide free weather data. If we could find one offering a push web hook, you might be able to push the info through IFTTT to Apilio.

1 Like

I’m using OpenWeatherMap integrated to IFTTT via Integromat service.

3 Likes

Thanks, I will definitely give that a try…