SONOS: Controlling the LED’s as you want, when you want :-)

During night hours, it could be great just to say: “When the sun goes down, turn off the LED’s on my Sonos devices”, and when the sun rises, turn them on again 🙂

From the Sonos APP, you can do it manually, but thats not we want!

Luckily I found this scripts from Simon Dettling (, where he made a Sonos Controller from Powershell. I just wanted a one-command-file and not a menu option for controlling music aso. but just for saying “LED OUT” or “LED-ON”.

So I used wireshark, and turned the LED on and on from my Sonos APP, and I found this:

<s:Envelope xmlns:s=”” s:encodingStyle=””><s:Body><u:SetLEDState xmlns:u=”urn:schemas-upnp-org:service:DeviceProperties:1″><DesiredLEDState>Off</DesiredLEDState></u:SetLEDState></s:Body></s:Envelope>

So I took the script, and modified all the parts except the SOAP-creating-sending process, and it gave me this:


So just alter the IP in the scripts below, make sure your Sonos MAC are locked in DHCP server so they always get the same IP.

Add it to a scheduled task in your Home Automation Controller or just windows, and you are good to go 🙂

I’m obviously not a programmer, as this could be remade with just one script file and use UPNP to find the SONOS devices without static IP, and then just, by it’s name, tell it to be controlled.

You can also download them here:


Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.