Use IFTTT URL's in List Variable

variables

#1

Looking to trigger pistons using the IFTTT virtual device and have several different URL’s I’d like to use and wondering if it’s possible to include each URL in list variable and then have an IF statement that says

IF IFTTT URL IS X THEN DO X ACTION
IF IFTTT URL IS Y THEN DO Y ACTION
IF IFTTT URL IS Z THEN DO Z ACTION

However I’d like to somehow do it all in one single statement if at all possible, but no clue how or if it’s even possible.


#2

Curious what the use case is… maybe there’s another way to it.


#3

$args can be added to the end of the URL, and a single piston can process differently depending on which args are passed.


For example, when I pass args from an external app, I add them to the end of the piston’s URL, like this:

Then my piston can use code like:

temp
Do stuff…

Note: The receiving piston should have no triggers whatsoever.
Once saved, you should see this up top:

This method assumes that all the URLs are the same, but the endings are slightly different.
(IE: the same piston is triggered each time, but the $args changes the path of execution)


For what it’s worth, I know it is human nature to reduce & compartmentalize, but when it comes to coding, oftentimes a longer clean code will process better than a single line of craziness…

IE: If written well with indented conditions, it is usually possible to get less code processing with each execution… and of course, less processing means less lag in our SmartHome.

Just my two cents.