Passing variable info between two pistons to ignore motion trigger?

  1. Give a description of the problem
    Background: I have two pistons, one turns on a set of office lights if various conditions are met…such as motion detected. This piston is auto-triggered. I have a second piston that is ONLY called via a web call that turns off all office lights. This ‘all off’ piston is triggered via a HTTP call from Apple Script on my Mac.

Problem: Sometimes when from my Mac I call the ‘all off’ piston and walk out of the room, the motion is detected and immediately turns the lights back on. What I would like is for there to be an “ignore” motion event period (say 30 seconds) if the ‘all off’ piston is called, where the office lights won’t be triggered.

I don’t know how to set some type of global variable in the ‘all off’ piston which the Office Light piston can read and IGNORE motion triggers for 30 seconds. Or, maybe there’s a different way to do this?

  1. What is the expected behaviour?
    I would like a 30 second ‘ignore’ period for the motion detected if the ‘all off’ piston is fired, such that the lights will stay off when I walk out of the room…even if I trigger motion.

  2. What is happening/not happening?
    If I trigger the ‘all off’ piston via HTTP and walk out of the room, sometimes my motion is detected and the lights get turned back on.

  3. Post a Green Snapshot of the piston![image|45x37]

  4. Attach logs after turning logging level to Full

n/a need design help before I might need to troubleshoot via logs.


maybe the off piston could check motion status, and wait 30 seconds before running, or wait for motion to end in a loop with waits?


What I ended up doing was using a global variable. I’m still in the testing phase, but I think it is working. The “off” piston immediately sets a global variable to ‘true’, waits 30 seconds, then sets the variable to ‘false’. The “motion” piston checks for the global variable state, and won’t turn on lights if the variable is ‘true’. Need more night time testing to verify it’s 100% working.