To “close the loop” on this one, here is what I found works better than stays:
The important bits (for others that might come across this later):
- Since the motion sensor is in a condition, not a trigger, and since there are other triggers in the piston, the Subscription Method attribute of the condition needs to be changed to Always. (Otherwise the piston would not subscribe to the motion sensor’s events.)
- The Task Execution Policy attribute of the with statement (or all the statements in the then clause if there were more) need(s) to be changed to “on condition state change only”. (I put a “C” in the comment since this attribute is hidden in a “with Location” statement. This setting is needed, otherwise the tasks in the with statement would start over if the piston ran again while the motion sensor was still inactive - e.g., if the button was pressed.)
- The if statement’s Execution Method attribute needs to be changed to Asynchronous. (Otherwise if the piston runs again for another reason - say the button was pressed - the if statement’s condition would not change and the statements following the if statement would be skipped. IMHO this is a bug, but changing the if to asynchronous makes it work.)