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)