No each device gets passed separately, in this example it’s 2 devices and I can tell from the notifications that the variables get passed correctly each time the 2nd piston is called.
The variable that should control the actions are setup as a device in both pistons. When I receive the device variable (CurrentSwitch) in the Slave piston, it comes in as as the address and not the name, that’s why I needed the switch statement.
Passing variables through pistons
please clarify this part.
yes but you are using a switch statement there. tried assigning the args.currentswitch to the device variable directly?
i was looking for the thread where this was asked earlier … see here:
yeah its fine that you see the device hash … just try on/off on that device variable.
Thanks, but that’s not going to work, when I define the switch variable it doesn’t recognize it as a valid device. I thought you meant to do a ‘with location’ and then set each attribute in there. See screenshots…
lines 30 - 32 will not work and is the reason for those errors in the log.
if you do this it should work:
with switch
do turn on
end with
Nope, no joy. I had tried this multiple times in the past few days. My local variable is not getting recognized as a device.
lets try this:
- line 21 just define the device variable dont set it
- at the top of the piston
– log the value of args.currentswitch
– set device variable to args.currentswitch - with device variable turn it on
what happens?
I have already tried this a few times as well, still will not recognize it as a valid device. I will try again
please execute the version i shared. need to see what happens when those first few statements are executed without digging thru all the conditions to understand where its failing.
the value of the passed in argument seems to be null. any idea why that argument was not passed in?