DLite Posted April 24, 2022 Share Posted April 24, 2022 I have two outdoor zones -- Back Patio and Back Yard. I'd like to write code that joins the two zones together if either one is playing music. I'd like the code to do something like the following: If Back Yard is playing music, then use Room Control driver to set Back Yard as music source and Back Patio as music destination; Else if Back Patio is playing music, then use Room Control driver to set Back Patio as music source and Back Yard as music destination. I'm struggling to figure out the most efficient way to design the "if [Room] is playing music" conditional. We use Sonos equipment. I know that I could do something like the following: If (Back Yard source is Back Yard Sonos & Back Yard Sonos is Playing) OR (Back Yard source is Kitchen Sonos and Kitchen Sonos is Playing) OR Etc etc However, since we have 12 different Sonos zones, any of which could be the source, this approach is incredibly cumbersome, and I'm assuming there has to be a better way. What am I missing? Thanks! Quote Link to comment Share on other sites More sharing options...
Neo1738 Posted April 24, 2022 Share Posted April 24, 2022 When Back Patio audio selected is xyz ? Back Yard is off -> Room control join zones Quote Link to comment Share on other sites More sharing options...
DLite Posted April 24, 2022 Author Share Posted April 24, 2022 59 minutes ago, Neo1738 said: When Back Patio audio selected is xyz ? Back Yard is off -> Room control join zones Thanks! Would you mind clarifying the following details: for the first step, would I be using the "Current_Selected_Device" room variable, the "Playing_Audio_Device" room variable, or something else? Quote Link to comment Share on other sites More sharing options...
jlemonakis Posted April 25, 2022 Share Posted April 25, 2022 I like using the room control driver event "Listen device selected" as a "music is playing here now" trigger. If you're specifically only using Sonos, look deeper into the Sonos network driver events/actions, since that is what directly controls Sonos matrix. On the output tab of the network driver events, "When audio [int] changed" directly correlates to the Sonos room joins, and is bidirectional with C4 at this point. "Audio x" is determined by which rooms are connected to the network driver audio zones. When I program stuff like this I like to have a list of each Sonos zone written down and the corresponding C4 Sonos network audio number that's associated with it. Quote Link to comment Share on other sites More sharing options...
DLite Posted April 25, 2022 Author Share Posted April 25, 2022 2 hours ago, jlemonakis said: I like using the room control driver event "Listen device selected" as a "music is playing here now" trigger. If you're specifically only using Sonos, look deeper into the Sonos network driver events/actions, since that is what directly controls Sonos matrix. On the output tab of the network driver events, "When audio [int] changed" directly correlates to the Sonos room joins, and is bidirectional with C4 at this point. "Audio x" is determined by which rooms are connected to the network driver audio zones. When I program stuff like this I like to have a list of each Sonos zone written down and the corresponding C4 Sonos network audio number that's associated with it. Thanks! I never thought to look there. Quote Link to comment Share on other sites More sharing options...
jlemonakis Posted April 27, 2022 Share Posted April 27, 2022 On 4/25/2022 at 10:23 AM, DLite said: Thanks! I never thought to look there. When you play with the Sonos network driver programming, leave the Sonos app open in front of you with the rooms screen up and you'll see what I'm referring to. 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.