Toggle multiple commands with a single button

In iRule you can set a buttons properties to “toggle commands” which will allow you to add two or more commands to a button which will fire incrementally on each button press. For example my DENON has an ECO button which has three states ON, OFF and AUTO. I would like to combine these commands into one button instead of three. Is this possible in THR? Every attempt I have made so far results in the commands all firing one after another on a single click.

Thanks

Toggle buttons only have 2 states, Checked & Unchecked. You can run a set of actions when it is Checked & you can run another when it is Unchecked. You can’t do 3 states. I’ve included a link to Brian’s video because he gives a great overview that will help you understand exactly how Toggle Switches & Toggle Buttons work.

You could probably get similar behavior by using a standard button and a variable that tracks its current state, so that you could both (1) send the appropriate command and (2) update the label/button state. I gave an example of this in a slightly different context here, but you should be able to do effectively the same thing with multiple data/event triggers on the same button. That said, I haven’t tried this out, so there may be some other limitation I’m overlooking at the moment.

You can do this by layering 2 buttons one on top of the other and using visibility. One button controls two states and the other controls the third.

The attached project should give you an idea.

demo.hrp (101.7 KB)

Thanks, I will give it a try.