Jump to content
C4 Forums | Control4

Trying to Join Rooms with Volume Button, Conditional Limit?


Recommended Posts

I have an EA-5 controller running version:

Composer Home Edition 2.10.5, Build 554601-res 
Director version: 2.10.5.554707-res  Oct 12 2018 12:11:15

I am trying to use the volume up on my "Ensuite" keypad to do the following:

If the Ensuite is on, turn up the volume.

If the Ensuite is off, join another room, in the priority of "Master", "Kitchen", "Theater", and "Living Room" to either the digital media or the current selected device.  I then want the volume set to 50

I have gone through these forums and the script below seems like it should work.  I do not get consistent results. 

The volume up always works if the room is on, so that is not an issue

The add zone does not work until I turn the master on and then execute the script (I usually do this from Home Composer).  Once I do that, I can turn both the Ensuite and Master off and the script will work as expected with all other priority rooms.  Once playback is done and all zones are turned off, it won't work again.  When I turn a zone back on again and try to have the ensuite join it with this script, it doesn't do anything.

I had the conditional statements built to include 2 more rooms, but I couldn't get that to work at all.  Is there a limit to how many conditional statements that Control4 is able to handle?  Am I doing something else wrong?

I appreciate your time for reading this and any advice would be welcome.  Please let me know if any other information would be relevant.

 

image.thumb.png.1431a8f97d604feb116b4b5d31e8cd4f.png

Link to comment
Share on other sites


Your logic looks good to me.  You could use “else” and get rid of some of the ”stops”.  You could also get rid of the volume commands by setting default volumes for the various rooms.  However, none of that changes the fact that your logic looks fine to me...

There is no limit to the number of “ifs” that you can have AFAIK.  I have certainly used a lot more than you have here with no issue.

I wonder if your En-suite is staying on without you knowing it? You could test this by dropping the first 4 lines of code and seeing if it then works consistently.

Link to comment
Share on other sites

Thank you for the reply.  I have wondered about the room being on in the background.  I have tried to read up on what defines a room as "On" or "Off", but I couldn't really find anything.  Is there a definition somewhere in the documentation of what conditions define if a room is considered on or off?  Is it possible for a room to be on but not show up in the zones section of the app and navigator? 

I will remove the lines of code that you are suggesting and try it for a while see if that is the problem.

I played with the media scenes, but they seemed very rigid.  I have 14 audio zones in my house and it looked to me that I would need to create a media scene for each possible combination and then use a similar conditional statement approach to define which media scene to activate based on which scene is on.  Perhaps I missed something with the media scenes.

Thank you again for your reply.

Link to comment
Share on other sites

On 4/5/2019 at 3:23 PM, mrjones1425 said:

I have an EA-5 controller running version:

Composer Home Edition 2.10.5, Build 554601-res 
Director version: 2.10.5.554707-res  Oct 12 2018 12:11:15

I am trying to use the volume up on my "Ensuite" keypad to do the following:

If the Ensuite is on, turn up the volume.

If the Ensuite is off, join another room, in the priority of "Master", "Kitchen", "Theater", and "Living Room" to either the digital media or the current selected device.  I then want the volume set to 50

I have gone through these forums and the script below seems like it should work.  I do not get consistent results. 

The volume up always works if the room is on, so that is not an issue

The add zone does not work until I turn the master on and then execute the script (I usually do this from Home Composer).  Once I do that, I can turn both the Ensuite and Master off and the script will work as expected with all other priority rooms.  Once playback is done and all zones are turned off, it won't work again.  When I turn a zone back on again and try to have the ensuite join it with this script, it doesn't do anything.

I had the conditional statements built to include 2 more rooms, but I couldn't get that to work at all.  Is there a limit to how many conditional statements that Control4 is able to handle?  Am I doing something else wrong?

I appreciate your time for reading this and any advice would be welcome.  Please let me know if any other information would be relevant.

 

image.thumb.png.1431a8f97d604feb116b4b5d31e8cd4f.png

I also think you may benefit from deleting the double nested commands. If your target room is on, you probably don't need another conditional for it being in a session--it's either in a digital media session or playing some other media--either way, it's on. That way all of your commands are nested under the same conditional and you only have your volume command in there once...and only one "stop" command.

Agree with @South Africa C4 user, you could set a default value for your Ensuite and eliminate that coding script as well. 

Link to comment
Share on other sites

3 hours ago, rea said:

I also think you may benefit from deleting the double nested commands. If your target room is on, you probably don't need another conditional for it being in a session--it's either in a digital media session or playing some other media--either way, it's on. That way all of your commands are nested under the same conditional and you only have your volume command in there once...and only one "stop" command.

Agree with @South Africa C4 user, you could set a default value for your Ensuite and eliminate that coding script as well. 

The if for “in a session” is needed to determine whether this is digital media and thus an add rooms to current session scenario or whether setting the CURRENT SELECTED DEVICE will do the trick.

Link to comment
Share on other sites

17 hours ago, mrjones1425 said:

Thank you for the reply.  I have wondered about the room being on in the background.  I have tried to read up on what defines a room as "On" or "Off", but I couldn't really find anything.  Is there a definition somewhere in the documentation of what conditions define if a room is considered on or off?  Is it possible for a room to be on but not show up in the zones section of the app and navigator? 

I will remove the lines of code that you are suggesting and try it for a while see if that is the problem.

I played with the media scenes, but they seemed very rigid.  I have 14 audio zones in my house and it looked to me that I would need to create a media scene for each possible combination and then use a similar conditional statement approach to define which media scene to activate based on which scene is on.  Perhaps I missed something with the media scenes.

Thank you again for your reply.

You will be able to see if a room is on in the navigator.  Simply press the music note icon. Some drivers can deliberately leave the room on for a (short while) in case of new streaming being detected (e.g. Shairbridge can be set to stay in for a period after music stops).

In terms of Media Scenes, they are quite rigid. I use these for obvious combinations (e.g. I have my bedroom and en-suite in one scene; my living room, dining room and kitchen in another scene called DOWNSTAIRS and my patio and jacuzzi area are in another scene called OUTSIDE) and I use your methodology (excluding the volume but) for everything else.

Link to comment
Share on other sites

  • 2 weeks later...

programming should look like this.

set misc room volume on to 50 to get rid of the volume programming

when up is released 

           Stop volume up

when up is pressed

     If suite is on

               Start volume up

     else

if 1st room is on

        set suite to value of 1st room

else

if 2nd room is on

    set suite to value of 2nd room

else 

etc

                    

 

 

Link to comment
Share on other sites

  • 11 months later...

It has been about a year but I was finally able to get this to work so I thought I should post what I did in case anyone else ends up looking at this.  The problem seemed to be with the conditional statement of "If Room xxxxx is On" and how the conditionals were processed.  I tried it the same statement with the "Power State" variable and it didn't seem to help.  For some reason if the condition of the first room being off was met, it never seemed to get to the second condition of telling if a room was on.  

My fix was to build a string variable for each room that simply changed from "Off" to "On" with the Power State and then build "If" and "Else" statements from those string variables.  It has been working flawlessly since I did this.  It seems like a bit of a glitch to me, but I'm sure that something is going on that I just don't understand. 

I made a variable like this for each room.

image.png.273e2778db5196ff025370248ca8c6cc.png

And here is the "If" and "Else" statements that I used

image.png.57b75f668be38e437c86e61c4b7bcf09.png

Hopefully this will help someone who may find themselves in a similar situation.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.