Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Deselect vs select groups for mutlizone audio

I have read the tutorials and searched for an answer, but I am still not understanding select groups vs deselect groups. As most, I appear to have the selection working, but not the deselection. I have 6 toggle buttons that turn ON/OFF a single zone each. I am trying to create a Party toggle button (all zones on/off). Each of the 6 toggle buttons has a unique select group tag and a unique deselect group tag. I applied all select group tags to the party button select group, and selection works. I applied all the deselect group tags to the party button deselect group and it does not deselect the 6 zones. What am I doing wrong?
1 person has
this question
+1
Reply
  • If you are using the one button as a toggle I don't think the deselect group will work since every tap of the button will register as a select and the deselect group will be ignored. The good news is if you are a pro user you can achieve what you want to do with variables and conditionals with the single button as a toggle. You can also use two buttons for the party select / deselect in which case group tags will work.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited

  • Steve if you send a backup file to support@iruleathome.com we can load the setup to test and help identify the issue you are having.

    Karn Evil's suggestion will also work if you would like to change images using variables.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • The way iRule describes Select and Deselect Groups is kind of confusing.

    An example. Let's say I have 3 inputs in my system, and I want to show which is selected. There is only ONE tag for each input. I will call them Input1, Input2, and Input3. (Very creative, I know.)

    In the button for input 1, I type "Input1" in the Select box. In the Deselect box I type "Input2, Input3". This makes input 1 use the Selected image, and input 2 and input 3 use the default image.

    In the button for input 2, I type "Input2" in the Select box. In the Deselect box I type "Input1, Input3". This makes input 2 use the Selected image, and input 1 and input 3 use the default image.

    For button 3, I put "Input3" in the Select box and "Input1, Input2" in the Deselect box.

    To get your Party buttons to work, you could use a Party On and a Party Off button. The Party On button would contain commands to turn on all zones, set the input for each zone, etc. Put the tags for all 6 zones in the Select box. All zones should be on and Selected after the button is pressed.

    The Party Off button would contain commands to turn off all 6 zones. Put the tags for all 6 zones in the Deselect box. All zones should be off and Deselected after the button is pressed. I don't think you can use a toggle button for the Party On/Off.

    Triple-check your work for typos. iRule will NOT detect them, and they will goof things up!
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited

  • You are correct Mike, this is exactly what I have done, although you need one more tag to "deselect" the Party ON button when the Party OFF button is pressed. The Party ON button needs a deselection tag that the Party OFF button references in the deselection group.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited

  • Ya, know what.... this really doesn't work either. Although, All ON and All OFF do the correct thing, selecting a single zone does not. If you select a single zone, then the All ON button will get selected even though only one zone is selected. You need to be able to define a tag to a button independently from the tag selection or deselection group. This way each button would have a unique selection tag and deselection tag, that can be grouped any way you please. The inheritance of tags through groups is what's so confusing.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • Seems variables and conditionals are the only way to do this... So, I've been thinking on this for a day or so, and just don't seem to know enough about how iRule works to complete this. Here's what I would like to do,

    One button for All ON/OFF. Six buttons, one for each zone 1 through 6. All on button should select itself and all six zone buttons and should deselect itself and all six zone buttons. Selecting a single zone button should select itself and no others, unless the number of zones selected equal 6, then the All zones on should be selected. And the reverse should occur when the zones selected is < 6. Make sense?

    So I see using expression variable ButtonCount as a counter, inc'ing and dec'ing on each zone selection would work. What I don't get is what image variable do I modify on each button, selected, default, pressed? Also, should the button be type toggle or no toggle? Also, if toggle is used, should I add the second OFF state to selected? And what do I do with the tag groups, leave them blank or set them to a unique tag each?

    Sorry lots of questions but its hard to know what exactly is happening behind the scenes with these button states and images.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • Steve,

    I thought about your program some more, and I have some more thoughts. Hopefully they will be helpful.

    Select and Deselect groups are really intended for setting up "radio buttons", where pressing 1 button selects it and deselects all the others. This is fine for situations like selecting an input, where it makes logical sense for only 1 selection to be selected at a time. It doesn't work for your application, where multiple selections may be on at the same time.

    Your application needs something like this:

    Assume you have 2 graphics images, "111" is ON, and "000" is OFF. Each Zone button has a variable that controls that button's image. The variable for Zone 1 is $Zone1Image$, Zone 2 is $Zone2Image$, etc.

    Put the following macro in the Zone 1 toggle button:

    IF $Zone1Image$ = 111
    command: execute Zone 1 off code on device
    Set Variable: $Zone1Image$ = 000
    ELSE
    command: execute Zone 1 on code on device
    Set Variable: $Zone1Image$ = 111
    ENDIF

    The above example should turn the zone off or on each time you push the button. It will not be correct if for some reason the command is not executed in the device. It is a good way to go if your device does not have feedback, or you are not using it yet. When you initially sync the Handset to your iPad, the buttons may not be right until you push them a time or 2, but they will sync up on their own.

    This would be the code for the Party On/Off button:

    IF $PartyImage$ = 111
    command: execute Zone 1 off code on device
    Set Variable: $Zone1Image$ = 000
    command: execute Zone 2 off code on device
    Set Variable: $Zone2Image$ = 000
    command: execute Zone 3 off code on device
    Set Variable: $Zone3Image$ = 000
    etc. ...

    ELSE
    command: execute Zone 1 on code on device
    Set Variable: $Zone1Image$ = 111
    command: execute Zone 2 on code on device
    Set Variable: $Zone2Image$ = 111
    command: execute Zone 3 on code on device
    Set Variable: $Zone3Image$ = 111
    etc. ...

    ENDIF

    If you are going to use feedback to control the button images, the setup is different. Set up the buttons as toggles with these 2 commands:

    command: execute Zone 1 on code on device
    command: execute Zone 1 off code on device

    Then you setup this code IN THE FEEDBACK:

    IF $FeedbackVariableZone1$ = On
    Set Variable: $Zone1Image$ = 111
    ELSEIF $FeedbackVariableZone1$ = Off
    Set Variable: $Zone1Image$ = 000
    ENDIF

    This arrangement breaks the program into 2 separate parts, the part that executes the commands and the part that controls the button image. I had a lot of problems trying to control commands with feedback from my receiver. If and when the feedback does not work properly, you may not be able to get back in sync because the IF statement is evaluating the wrong data.

    Good Luck!
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited

  • Steve, I think this is what you are trying to accomplish. In this example all zones can be selected or deselected individually as a toggle. Zone buttons light up when on. If no zones are selected the party button will turn on all zones. If one or more zones but not all are selected then the party button will stay green and pressing it will turn on the remaining zones. If all zones are selected either one at a time or by using the party button then the party button will turn red and pressing it will turn off all zones and all the zone buttons lights will turn off. There are no group tags in this example. This example is for 3 zones but can be expanded to as many as you need. Panel has been shared. Search community panels for 3 zone example. You may have to create a Google Nexus 7 1280x800 handset to import it if you are unable to import it into a different devices handset. Not sure about that. I would personally create a new handset since all my devices will likely come over when you import it in which case you will need to delete them plus you would not want a conflict with your existing devices. You can always copy the page from the new handset to your own or just use my example panel as a guide. Always backup your setup before experimenting. If this is not exactly what you need then I hope it puts you on the right track.

    It looks like the compression of images on this site degraded the quality of the image. I can send you copy that will be easier to read. karnevil9.nj@gmail.com

    good luck

  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited

  • Karn/Mike, thanks for the reply's really appreciate it. I was confused as to what type of button to use, whether I should be using tags, and which button image to manipulate. After reading through your replys, I believe the answer is as follows; Buttons are standard ie. not toggle, have no tags, with only the default image set. The default image is the one that is manipulated via a variable. This is all very helpful, thank you. I'll get back here after some coding time and let you know the results.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • OK. Works! Couple of things I discovered along the way.

    1. My image ID's are the same from zone button to zone button, simply because I used the same button image for all zones, blank with text. This made cut/paste work easier simplifying the edits.

    2. Not sure I understand this, maybe its the way I defined my variables, but I found on the first zone button press, the ELSE case is taken even though the zoneon variable is defaulted to no. I added a set variable to the entrance setting zoneon to no and it fixed it. My zoneon variable is defined as a Label with default no. Its almost like its pointing to a different zoneon that was not initialized. Is this possible?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • I have see this before with defaults not being picked up. I think it is a bug or something. The only possible problem I see with using an entrance is the set variable will be invoked every time you enter the panel when you may not want it to. Perhaps you can code it to run only once using a conditional. I was able to get around some of my defaults not being recognized by using != (not equal) eg.

    Instead of

    IF $zoneon$ = no

    you can try

    IF $zoneon$ != yes
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • I actually have this on a drawer that overlays a Network Player. I used the entrance from the Main panel. But thinking about it, I might have to attempt feedback from the device to figure what zones are turned on vs off. Say you enter iRule, turn on zones, exit iRule then enter iRule again. Unless the Main entrance turned off all zones and set the variables off...probably not ideal.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • With my macro, the best way to start up would be to turn all the equipment off and all zones off. Then sync the iPad to load the new program. So you start from a known state, at least it is known to you.

    The first time the button is pushed, the ELSE branch is executed, so the Zone is turned on, and the image is set to the on image. Now the image and the zone are in sync.

    The next time the button is pushed, the image variable equals the on number (111), so the IF branch is executed, and the zone is turned off, and the image variable is set to the off image number (000).

    So the macro will resync itself with a button push or two.

    If you want to flip the macro, enter this:

    IF $Zone1Image$ = 000
    command: execute Zone 1 on code on device
    Set Variable: $Zone1Image$ = 111
    ELSE
    command: execute Zone 1 off code on device
    Set Variable: $Zone1Image$ = 000
    ENDIF

    Now the first time the button is pushed and $Zone1Image$ does NOT equal 000, the ELSE branch is executed, Zone 1 is turned off, and the $Zone1Image$ is set to 000.

    You can also try this code, but I don't recommend it:

    IF $Zone1Image$ = 111
    command: execute Zone 1 off code on device
    Set Variable: $Zone1Image$ = 000

    ELSEIF $Zone1Image$ = 000
    command: execute Zone 1 on code on device
    Set Variable: $Zone1Image$ = 111
    ENDIF

    The problem is that if $Zone1Image$ is not equal to 000 or 111, then neither branch is executed, so you can not turn Zone 1 on or off, and you can't change the variable, either, so you are really stuck.

    I suppose you could add another ELSEIF to the code, and run this:

    IF $Zone1Image$ = 111
    command: execute Zone 1 off code on device
    Set Variable: $Zone1Image$ = 000

    ELSEIF $Zone1Image$ = 000
    command: execute Zone 1 on code on device
    Set Variable: $Zone1Image$ = 111

    ELSEIF $Zone1Image$ != 000
    AND $Zone1Image$ != 111
    command: execute Zone 1 off code on device
    Set Variable: $Zone1Image$ = 000
    ENDIF

    The second ELSEIF only executes if $Zone1Image$ is not equal to 000 or 111. It should only run on the first button press when $Zone1Image$ is not equal to the expected values. You could also turn Zone 1 on instead of off, and $Zone1Image$ to 111 instead of 000. You could also just set $Zone1Image$ to 000 or 111, so the button would work on the next push.

    One more thing. Entrances do not work on Drawers. You have to put your code in the Entrance to the Page. The developers may get Entrances working on Drawers in the future.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited

  • Oh my God ! 5 years later, I could find a Solution for my case here in this tread. Thanks to all and hope you all are doing great !
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited