Issue with looping button pushes


#1

1) Give a description of the problem
Two action sets (1st and 2nd). Only the first set of actions is executing. 1st action set keeps repeating.
The issue is with the button, everything else is functioning as it should.

2) What is the expected behavior?
There are two button action sets. It needs to toggle between them without restrictions.

Rundown of what’s supposed to happen:

  1. Push button
  2. First set of actions happen. - Does action and pauses another piston
  3. Once the button is pushed again (regardless of the amount of time has passed)
  4. Second set of actions happen - Basically resumes the paused piston and resets the switch
    to how it was before the first press. (loop)

What’s actually happening:

  1. Push button
  2. First set of actions happen. - Does action and pauses another piston
  3. ^^^^Repeats. 2nd set of actions never happens.

Context: This is on a motion dimmer. The button essentially puts the dimmer in manual mode so it doesn’t go off while i’m in the shower. So i can push the button, dimmer goes into manual mode, finish shower, push button, dimmer returns to normal, other piston resumes.

I’m pretty new to webcore so i appreciate all the help.

Also, is there a guide equivalent to learning Python or another language for Webcore?
Like how it starts you off with “Hello world” and then progresses?

Thanks!


#2

This should work for you. Basically add a variable ‘ true / false ‘ when button push 1 is pushed set to true, then when button push two happens and variable is equal to true, do button pushb2 stuff. Then set variable back to false, waiting for button bush 1 again.

As far as a manual, there is the wiki you can reference or this community. They are both areas of great help.


#3

Hey @Gopack2,
Tried It out. The action sets are working except they are both executing at once.
I’ve included the log below.


#4

shouldn’t the second IF block be a separate block by itself instead of being embedded inside the first IF block?


#5

Oops, yes it should. My fault!


#6

@jkp , Ah nice catch

@Gopack2 no no that’s my bad. My flaw in the piston design.

Though, I separated the two IF blocks and it’s still giving the same result.


#7

Hi @Gopack2,

Was wondering if you had a chance to look at this. I am unfamiliar with the true/false stuff so i’m unsure on how to proceed.

Thanks


#8

Try this… the log to consoles are just place holders for stuff you want to do. I used them to quickly test


#9

Works great! Thank you very much for your help!