mrjones1425 Posted April 5, 2019 Share Posted April 5, 2019 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. Quote Link to comment Share on other sites More sharing options...
South Africa C4 user Posted April 6, 2019 Share Posted April 6, 2019 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. Quote Link to comment Share on other sites More sharing options...
South Africa C4 user Posted April 6, 2019 Share Posted April 6, 2019 You can also do a lot with the much maligned media scenes where the activate command will deal with digital media or other media with one line of code... Quote Link to comment Share on other sites More sharing options...
mrjones1425 Posted April 6, 2019 Author Share Posted April 6, 2019 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. Quote Link to comment Share on other sites More sharing options...
rea Posted April 7, 2019 Share Posted April 7, 2019 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. 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. Quote Link to comment Share on other sites More sharing options...
South Africa C4 user Posted April 7, 2019 Share Posted April 7, 2019 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. rea 1 Quote Link to comment Share on other sites More sharing options...
South Africa C4 user Posted April 7, 2019 Share Posted April 7, 2019 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. Quote Link to comment Share on other sites More sharing options...
Matt Lowe Posted April 15, 2019 Share Posted April 15, 2019 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 Quote Link to comment Share on other sites More sharing options...
mrjones1425 Posted April 5, 2020 Author Share Posted April 5, 2020 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. And here is the "If" and "Else" statements that I used Hopefully this will help someone who may find themselves in a similar situation. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.