Passing variables through pistons


I just took everything out and reran, here are the screenshots


the value of the passed in argument seems to be null. any idea why that argument was not passed in?


I have no clue:-( My push notifications seem to indicate that the calling piston is passing them correctly


create a trimmed down caller piston and pass the right arguments from there. lets see if it shows up correctly in the called piston.


Here you go, thank you so much for helping me. I dont see anything wrong with this caller piston.


now in the called piston add a log statement for $args … lets see whats going across.


Everything except for the device seems to be getting passed correctly


i wonder if its really getting passed in as an array. change the first log line to string($args.CurrentSwitch) and lets see what we get.


nope nothing changed…


before you try the following … not sure why in the set variable there is square brackets enclosing the set variable statement.

please remove those square brackets only and try. if that still does not work … then try the second one below:

change that set variable line to the following and try please:

set variable Switch = mid(string($args.CurrentSwitch), 1, length(string($args.CurrentSwitch)) - 2)


heres a working example of passing in a device from one piston to another piston at runtime:


You are the man!! The simple example worked, I will now try to add a second device and see if it still works. I did not add the ‘[’ to the variable, this must be a weird webcore thing. Thank you again for your help, I had literally spent days trying to figure it out.


if you insist :slight_smile:

adding in a second device will not work i suspect given the string passed is wonky … it will need to be parsed properly to work


and you are correct again:-) It did not work, more work to do. Is this a webcore bug we have discovered? I am signing off for tonight had enough webcore fun for a day. Thanks again.

Multiple web requests

we discovered more than one bug. :slight_smile:


Why don’t we just goo over to Features and Suggestions and ask for a way to pass device names from piston to piston via arguments or Global variables or some other method.

I would think that’s an easy ask.


Will do, though @bangali found a workaround that solves this issue for now.


@bangali I don’t want to take up your entire evening on this again, but in the thread where I first found you, you mentioned that
" also fyi piston parallelism when turned on creates a 2nd instance of the piston to handle incoming events. while there will be 2 instances of the piston all variables in the define block are shared and each piston does not get its own instance of variables."

Is there a way to instead of using a With ‘switch name’ to turn the device on/off to use a With ‘location’ and then access the attributes of the device directly (via the $args variable) so you could execute commands at the device level?


no worries. you didnt take up my entire evening … it was only a few minutes between what i was working on yesterday evening. :slight_smile:

no. you are executing them at the device level … the with statement specifies the device to execute commands on.


Any insight if this feature was implemented? I find myself trying to pass a device name from piston to piston and struggling