Garage Door Poll Switch To Execute


1) Give a description of the problem
(I created a piston to send me a message when the contact switch for my garage is open. The problem is I only want to do this in certain modes. If the location mode crosses over, and the switch is already on, the piston does not execute. I would like to create a routine where there is a loop to poll the switch, and based off that poll status, execute the piston when in certain location modes. I am coming up a little short. Can someone give guidance?)

2) What is the expected behaviour?
(For the polling to occur every so often and execute a routine based off that status only when in certain location modes. )

3) What is happening/not happening?
(Piston works as coded, trying to check status of switch to executer. )

4) Post a Green Snapshot of the pistonimage



For routine polling, I often use the “EVERY” trigger.
(+ add a new statement > add a timer)


Note: This command must be top level (extreme far left)

Inside that “EVERY” block, you can add conditions to check for location mode and switch positions etc. (just do not add any triggers there)


Alternatively, you can expand your current logic:

Whatever piston that is currently triggering on location mode changes, you can add a new block to check if the door is open. If so, let that piston send you a text.

IE: One piston checks the location when the door changes…
and one piston checks the door when the location changes.
(you’ll be covered from both angles)


This method also has the added benefit of allowing different (customized) reactions to the event…
(Depending on which was the trigger)


Thanks. So, I would set that up under an action to poll? I am digging around, but don’t seem to see exactly how to reference my switch when I get the poll command in. Once I have that, could I use an “If” block to reference the data from each poll and then execute the action to text me from there?


Here is the basic structure I mentioned in my first post above:
(import code: x9ye)


Notice that the only trigger is the “EVERY 30 MIN”…
The door and location must remain conditions for this to work.

For what it’s worth, I usually follow the advice in my second post.


Ok, yes, I see now. All conditions need to be true execute the SMS message. The trigger just causes the piston to run and evaluate the conditions. Thanks!


Yup, you nailed it!

I usually recommend a single trigger (or less) in each piston, but there can be dozens of conditions beneath it, to control the logic path.