Adjust Group Volume in python?

Posted on
Tue Nov 17, 2015 8:40 am
rapamatic offline
Posts: 276
Joined: Aug 03, 2015
Location: Glencoe, IL

Adjust Group Volume in python?

I am trying to use a dummy dimmer load to enable me to control a sonos group using lighting controls. The sonos spekars will turn on when the dummy lighting load is on, turn off when it is off, and the volume level should mirror the brightness level of the light. I can easily handle the on/off with triggers, but am running into a little problem with the volume. I have this code running in a trigger that's activated by any change in brightness on the load. The problem is it is only changing the volume on one player in the sonos group. Is there a way to send a command to change the volume for all speakers in the group? Similar to the behavior in the sonos app?

Here's the code I'm using:

Code: Select all
lutronDim = indigo.devices[1880929602] # "Dummy Load Sonos"
volVar = lutronDim.brightness
SonosPlugin = indigo.server.getPlugin("com.ssi.indigoplugin.Sonos")
if SonosPlugin.isEnabled():
    SonosPlugin.executeAction("actionVolume",  props={'setting':str(volVar)}, deviceId=1645583775)

Posted on
Fri Jan 01, 2016 2:58 am
koensayr offline
Posts: 90
Joined: Jul 10, 2013

Re: Adjust Group Volume in python?

Did you ever figure this out?

Curious to see how your solution panned out as I'm working on the same type of thing

Posted on
Fri Jan 01, 2016 7:12 am
rapamatic offline
Posts: 276
Joined: Aug 03, 2015
Location: Glencoe, IL

Re: Adjust Group Volume in python?

I never got the group volume working, but this has been on the back burner for me. Without a function to do this in the plugin, I think the solution is with some Python coding to figure out all the group members, and adjusting the volume individually...

Posted on
Fri Jan 01, 2016 9:47 pm
koensayr offline
Posts: 90
Joined: Jul 10, 2013

Re: Adjust Group Volume in python?

I think you're probably right. When I get to that stage, I'll take a stab at it myself

Posted on
Sat Jan 02, 2016 6:28 am
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Adjust Group Volume in python?

Gentlemen: Group Volume actions have been added in v0.8.32. I just posted the update. Hope it suits your needs.

Posted on
Sat Jan 02, 2016 7:28 am
rapamatic offline
Posts: 276
Joined: Aug 03, 2015
Location: Glencoe, IL

Re: Adjust Group Volume in python?

Awesome. Thanks! I'll test it out later today. Thanks for staying on top of all of our edge cases :)

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests