Piston responding to buttons not linked to it. Why?

triggers

#1

Hi. In the past week I’ve been redesigning all the pistons that control my blinds because of a firmware update that makes them “dimmable” instead of just having up/down/stop commands.

I had a really complex system and this update lets me simplify things, but in the meantime I’m discovering some problems:

I use 4-button controls to set my blinds. I’m using 3 buttons only for the blinds, button #4 is set in a different piston for lights control.

I created this piston that is triggered by button presses #1, #2 and #3 of my 3 button controllers and sets up some variables that will then be processed in the end.

When I press buttons #1, #2 and #3 ir works exactly as I wanted. Basically I’m defining 2 pre-set percentages to each button, and looping between them if the button is pressed again.

But when I press button #4 this piston is triggered anyway and repeats the last action. In my previous design I had all the buttons in a separate piston defining global variables, do I need to do it that way?

Thanks!


#2

Without looking at it in detail, try adding a trigger for button 4 that does nothing :slight_smile:


#3

The thing is that anything that triggers the piston will end up doing something… If I’m not adding this specific button to this piston, why is it reacting to it?


#4

pic

I suspect the subscription is on “Keypad X’s button”… (shown highlighted above) Once any button triggers the piston, then webCoRE determines which button was pressed.

Since you have no code for button 4, then all the IFs are skipped, and the piston continues with all the commands outside of the IFs.

Essentially, even if you add code for button 4 to do nothing, it will still execute all lines not blocked by conditions. (lines 82 thru 500)


Another way to say this: You have subscribed to “Keypad 1’s buttons”, so any button presses on that device will trigger any piston that is subscribed to “Keypad 1’s buttons”.

This is one of those cases where I would put all of “Keypad 1’s buttons” in a single piston, since they are really all the same trigger. (the specific button pressed is not evaluated until after the trigger comes in)


#5

Okay, thanks! Maybe this already happened to me :sweat_smile: I just wanted to understand the reason or if it was a bug.