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
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.
Hello 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:
-
Go to the Logicblock you want to evaluate as a result of another evaluation and, from the show view, copy the evaluation webhook:
-
Now go to the second Logicblock, the one that is going to call the first one, and create an HTTP action
-
In the action, paste your evaluation webhook in the URL.
-
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 Let me know if this initial idea helps! Thanks
#amazing 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
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:
No problem, I guessed so.