Hidden Labels based on a Variable

More
8 months 2 weeks ago #4560 by bitzerjd
Hidden Labels based on a Variable was created by bitzerjd
I want to display the Volume of the currently active Speakers...  It would be the AVM, or the TV, or the Soundbar.  I have a variable that is thrown when either system is used.  I would like the page to display the value of the active system.

Any ideas??

Please Log in to join the conversation.

More
8 months 2 weeks ago #4561 by Nillaz
Replied by Nillaz on topic Hidden Labels based on a Variable
I'm not in front of the computer I use for configuring my system so I'm just spitballing a bit here, but maybe set a custom variable that tracks which speakers are active. Say, something like AVR = 1, TV = 2, and soundbar = 3. When you change the active speakers you could use a SetVariable command to update this value appropriately.

Then, in MyDesigner you could create 3 different buttons, with one using the volume level variable for the AVR as the button label, another for the tv, and another for the soundbar.

I think you could then go into the button's label state and set your custom variable as the reference variable, and set 1, 2, and 3 as their respective state values. Set each one to show when the correct variable is active and hidden when set to anything else. You can then stack the buttons one on top of each other. If done correctly I think this should hide/show the correct volume depending on which system is active.

I can envision other ways to achieve this as well, but I hope this sets you on the right path or at least gives you some ideas! 

Please Log in to join the conversation.

More
8 months 2 weeks ago #4562 by bitzerjd
Replied by bitzerjd on topic Hidden Labels based on a Variable
Thanks... I've tried it and I cannot get it to work. I have a variable "htstatus", 0 = Off, 1 = On. I have the correct command in the "Active Label" field, but it doesn't show up.

I need to try it on the remote to see if that makes a difference.

Please Log in to join the conversation.

More
8 months 2 weeks ago #4563 by aa6vh
Replied by aa6vh on topic Hidden Labels based on a Variable
This is actually very simple.

Create a "server variable". I usually start the name with "user" so that I can recognize that it is my variable, not the systems.

For example, I have a variable to indicate which input my AV is on, that I call "user_family_input". To set that variable:

SetVariable|user_family_input~GAME


On the smart remote, create a label with the label text as:

 {{user_family_input}}

If we have more detail on how you are approaching this and what you have tried, we might be able to help further.

Please Log in to join the conversation.

More
8 months 2 weeks ago #4564 by bitzerjd
Replied by bitzerjd on topic Hidden Labels based on a Variable
Here is what I want to do:

I have a Server Variable, "htstatus" with two values "0" and "1". "0" means that the Soundbar is active, "1" means that the Full Home Theater is active.

I want to have a single button that reflects the volume of the active device.
Volume: {{av_{{active_sonos}}_volume}}
-or-
Volume: {{av_7_volume_label}}

What I tried was to set in the Label State Tab the following:

htstatus = 0 (Reference Variable and state)

Then I added the above commands to the Active and Inactive State fields.

My assumption was that when htstatus=0 it would leverage the Active State command, and when it was Inactive (meaning htstatus=1) it would use the Inactive State command.

What I get is a blank button....no data. I've tried adding a simple label "test" and made the colors white and red so I could tell which was working....still nothing.

I must be doing something wrong, but cannot figure out what it is.

Hope this helps!

Please Log in to join the conversation.

More
8 months 2 weeks ago #4565 by bitzerjd
Replied by bitzerjd on topic Hidden Labels based on a Variable
Made some progress...

The Reference Variable needs to be {{variable}}
The Label needs a name on the first tab

A state of "0" doesn't work..."1" works fine

The displayed label (based on state) shows the text.... it doesn't execute anything, for example, this shows up in the label "{{av_7_volume_label}}"  This same command works perfectly fine when used in the Label field on the first tab. 

Please Log in to join the conversation.

Time to create page: 0.193 seconds