Call a logicblock from a logicblock

Probably a wise idea to not trust me.

1 Like

I second the request, call a logicblock without the need of go to IFTTT would be great, and in adition also the possibility of update the value of a variable directly from apilio logicblock

6 Likes

I would also find this useful. Having to send a variable to IFTTT in order to update a second variable seems redundant, but I’ll happily keep doing it if that’s the only way.

2 Likes

Hello! I’m new here, but this is what I came to ask about!
If it was possible to call an Apilio logicblock as an action instead of an ifttt action.
I’m doing sort of a complicated chain of blocks in the free trial (6 conditions, 10 logicblocks, and 18 ifttt actions) to cycle through different lighting scenes with the push of a smart button. I got a little carried away with the testing spamming my smart button and I was suspended for 5 minutes… lol!
So now that’s got me thinking of how I can make my creation much more optimized and faster going back and forth between ifttt and apilio as little as possible. I think half my ifttt applets are initiating an apilio logicblock from an apilio action. strictly Apilio ifttt applets.
Any advice? Thanks in advance!

3 Likes

Hi @Caustik,
you probably managed to create an endless loop :smiley: That was the initial reason why there is no direct chaining in Apilio.
We are aware that many users do chaining via IFTTT (which is fine), but we have not implemented an internal trigger yet.
We have sped up development of new features in the last couple of weeks and this request is among the top of the development backlog. But I can’t give an ETA at the time.

2 Likes

Thanks for the quick reply!
I think Im just going to have to get creative! :slight_smile:
I’ve already minimized my blocks and ifttt actions, but now I think I just need to sleep on it.
Exciting news about internal triggers being in the plans!
I’m sure I will be subscribing once my trial is up, Im having a blast!

2 Likes

Thinking about these Apilio actions, I wanted to ask if you could share more examples where you need to update a variable from a logicblock, or launch a logicblock from another logicblock.

It would be great to check if you all have scenarios that are always similar in some way, where you would need to use one of these Apilio actions. For…ehm… science! :woman_scientist:

Thanks @jrmckins for the super detailed example! https://iused2besmart.wordpress.com/2019/10/29/the-new-apilio/

Maybe @Caustik, @jp1, @tavo682, (maybe you, visitor of this thread! :eyes: ): can you share a scenario where you would use these actions if possible?

Thanks so much! :grin:

2 Likes

My example is as follows. I have logi block that i use to define when people are home. So positive result it will send a request to IFTTT which hands it back as set boolean value home to true. And if no one home to false.
Same for the heating. if someone arrives home or moving around the house i send a request to IFTTT to evaluate the temperature logiblock. if the evaluation is true
Evaluate the brightness if its daytime etc
Of course the one you have already mentioned

3 Likes

Quick bump , so i can reduce my IFTTT reliance further.

1 Like

Could you give examples where you are concatenating different pieces of logic? It’s really helpful to have detailed ideas when working on the more “abstract” part of the design :nerd_face:

If you were able to update a variable as an action in a Logicblock (imagine having an action that toggles a variable, or switches it to true or false), would that cover all your cases?

Given that a variable is checked by a condition and these can function as a trigger for your logicblocks, updating a variable as an action would evaluate a different Logicblock as a result. I’m wondering if an action to update a variable from a logicblock would then accomplish the goal of evaluating a different piece of logic instead of selecting a specific Logicblock :thinking:

How does that sound?

1 Like

ooh it feels like this might be getting closer, yay!

1 Like

@Anna

Example.

Depending on how bright it is in the passage way I have lights come on when a motion sensor is triggered. It also assumes that if some one is going up stairs it will turn on bedroom lights if the passage way is dark. And turns off after a certain time.
One of the rooms is the kids room so that has its own separate logicblock to turn the bedroom light on to colour red if dark and after a certain time then turns off at sunrise or certain time.
What I have at the moment is when the logiblock that looks after the hall and bedroom lights goes negative the hall light and bedroom lights turn off apart from the kids room. this sends a request to IFTTT that then loops it back to Apilio that initiates a evaluation of the the children’s room logiblock. This will make sure its not turning off the light in the children’s room if its meant to stay on. It of course switches off of the result is negative

1 Like

Yeah, great use case - I would love this too!

1 Like

I understand there is a concern for the endless loop, but I would just love to be able to “chain” logic blocks together using IF and AND so that we get the right out come depending on conditions
I used to use Stringify till the got bought out and service withdrawn. And that use to be perfect for setting up “flows” to achieve my desired results. And it was visual which made it a lot easier me to follow

1 Like

Another use case: I want to close the garage door via voice and get a notification in case the door could not be closed.

It would go like this:
Alexa command “close door” -> IFTTT -> Logicblock 1 (close the door via SmartLife) --> wait 15 sec --> Logic Block 2 (verify door is closed via SmartLife sensor) --> Notify user via IFTTT is door is not closed.

Right now, I need an IFTTT applet in the middle which does nothing but invoke the second LB:
Alexa command “close door” -> IFTTT -> Logicblock 1 (close the door via SmartLife) --> wait 15 sec --> Trigger IFTTT applet via Apilio event --> Logic Block 2 (verify door is closed via SmartLife sensor) --> Notify user via IFTTT is door is not closed.

4 Likes

Hello :slight_smile: we now have a way to stay within Apilio and connect your Logicblocks: you can call a Logicblock from a Logicblock using the new webhooks.

This is how you could set it up:

  1. Go to the Logicblock you want to evaluate as a result of another evaluation and, from the show view, copy the evaluation webhook:

  2. Now go to the second Logicblock, the one that is going to call the first one, and create an HTTP action

  3. In the action, paste your evaluation webhook in the URL.

  4. Save your Logicblock

Now when you evaluate the Logicblock that has the HTTP action, it will launch the evaluation of the other Logicblock.

You can also use this method to update a variable as a result of a Logicblock being evaluated: use the webhook URL to update the variable in a webhook action.

I’ll probably write a more detailed step-by-step guide on how to set this up :slight_smile: Let me know if this initial idea helps! Thanks

1 Like

#amazing :bowing_man: thank you!

@Anna, is there any reason why you selected “PATCH” as HTTP method in your screenshot? I always use GET to call other logicblocks

2 Likes

Woops, sorry about that funky screenshot! I didn’t notice.

You are totally right, Apilio only accepts GET or POST. I’ve fixed the silly screenshot:

1 Like

No problem, I guessed so.

1 Like