Timer keeps restarting within speaker volume control


#1

1) Give a description of the problem
Within my piston to control the volume of my speakers, i created a variable true/false, with a 30 minute wait, so each time i unmute the speakers, it doesnt send a volume command, the variable SHOULD wait 30 minutes to become true again, however, each time i unmute the speakers the timer RESTARTS again, and starts counting down from 30 minutes.

I see the countdown timer in the dashboard, i just want it to complete the countdown of 30 minutes regardless of other activity. I’m sure someone here know’s what to do. Maybe there’s a better way completely to automate the volume levels throughout the day?

Near the bottom of the piston is the timer,
IF variable is false,
Wait 30 minutes
set to true.


#2

I’ve had mixed luck using a boolean as a ‘lockout’ for a period of time. Also, since your WAIT 30 minutes is in an async branch, all these others can run at the same time and modify it again, probably resetting your timer (hard to tell without logs):

Instead of using true or false, what if you set your @volumeChange to the time you want it to expire? Then you can say “IF $now is after @volumeChange, carry on and do blah blah blah, else stop messing with my volume”. Or vice-versa, I’m not sure I full grasp the piston yet.

Here’s an example you can use though - let me know if it works for you?