No subscription when using variable with list of physical devices in IF statement


#1

1) Give a description of the problem
Variable with list of Physical Devices used in IF statement doesn’t cause subscription

2) What is the expected behavior?
I would expect that using the variable would cause the piston to subscribe to every device listed in the variable.

3) What is happening/not happening?
No Subscription - If I replace the variable with the same list of devices, it works.

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)


#2

Not sure here, but I think you will need to define your DOORS as Device Doors = , not dynamic Doors.

You could also eliminate the first IF…

If {Doors} changes to ‘open’
then with switch 30
do turn on
else with switch 30
do turn off


#3

Tried the piston below and it showed up as subscribing, but didn’t trigger when I opened a door.


#4

Don’t nest IFs like that. Make the first IF ‘changes to open’ or ‘is open,’. Then add another IF at the same level for ‘changes to closed’ or ‘is closed’ instead of using ELSE.

‘Is closed’ or ‘is open’ are conditions not triggers but if you only have conditions and no triggers the conditions should act as triggers,