Presence based notification that loops until button press


#1

1) Give a description of the problem
I want my “Laundry Piston” to pester everyone that is home until the dash button is pressed. But instead, pressing the dash button justs triggers the piston again.

(yes a door sensor would make sense but I’m not ready to glue anything to my washer yet)

2) What is the expected behavior?
If either the counter reaches a threshold, or a button is pressed, the Piston stops looping.

3) What is happening/not happening?
When the virtual switch is pressed, it just runs the loop again and sends all the notifications instead of exiting the loop.

**4) Post a Green Snapshot of the piston!

**5) Attach any logs
As you can see in the logs, the piston starts, and is waiting at the pause then another event comes when I press the button (dash button that triggers “Virtual Test Switch”)


#2

The only thing that triggers this piston is the button press, you can tell by the lightning icon on the left.

How are you expecting to trigger the piston, you could change the line Switch 12’s switch changes to Switch 12 changed in the last X minutes. The issue you have is the switch won’t still be in the state you want when the next loop checks the condition to start again.


#3

I’m triggering the Piston via web request using iftt webhooks. My washer is a “smart” lg washer, and that part works fine


#4

In that case, I think the easiest way to do this is to create a global variable and check that in this piston. In another piston use the dash button press to change the variable.


#5

I tried your suggestion, but it seems like it’s still subscribing to that event to run the piston instead of end the loop.

Granted I have not tested this yet. I feel like I’ve got to be doing something dumb.


#6

Sorry should have been more prescriptive. Don’t check the variable to see if it’s changed, just check its value.

So as default have it set to 0 say, when someone presses the button set it to 1. Set the loop to run until the variable equals 1, then set the end of the piston to reset the variable to 0.


#7

I changed that, then all my conditions were changed to subscriptions! :frowning:

That lead me to this… Conditions and Triggers: What's the difference?
Basically, webcore will consider conditions as triggers if there are no triggers. Since I’m triggering this one “manually” that was intentional.

Then I learned, you can manually force conditions (or triggers) to “Never Subscribe” Which seems like a good answer to my original piston design.

See…