I just took everything out and reran, here are the screenshots
Passing variables through pistons
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.
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.
before you try the following … not sure why in the set variable there is square brackets enclosing the set variable statement.
first:
please remove those square brackets only and try. if that still does not work … then try the second one below:
second:
change that set variable line to the following and try please:
set variable Switch = mid(string($args.CurrentSwitch), 1, length(string($args.CurrentSwitch)) - 2)
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
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
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.
@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.
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