Skip to main content
A Customer of mine wants a waterproof volume control in the shower. However simple this seems its not quite that easy.



Does someone with some programming knowledge know if a raspberry pi could use its built in web server to control sonos from a contact closure?
The latest version of the RPi has builtin WiFi. It can use UPnP to find Sonos zones, and subscribe to their services. I have a Raspberry Pi programmed to do this so that it can detect and record Sonos track play events.



I can't address the volume adjustment part. I only needed to monitor the Sonos zones, not control them. It is possible, as there are various projects controlling Sonos zones in this way, eg Sonospy.



The RPi also has GPIO pins, so it presumably it could detect rocker switch adjustments.



However simple this seems its not quite that easy.

That would be correct.
Thanks to Jishi in our community, it actually is rather easy. Have a read:



http://jishi.github.io/node-sonos-http-api/
thanks for the link.



I have looked, across technologies, to Jishi's project from time to time. Not seen that. It looks great.



Thanks to Jishi in our community, it actually is rather easy

I still think that it is too hard, just to allow some one-off dude to adjust the volume of muzak in his shower. 🙂
FWIW I plan to put an Amazon Echo Dot in our bathroom expressly to control Sonos, once the integration is out of beta.
Lots of open source home automation solutions support Sonos. Home-assistant supports it out of the box, Sonos devices get auto detected. See https://home-assistant.io/ .
Its a bit old school but have you considered a CR100 controller? I had a cradle (with power) installed in our bathroom and I just grab the CR100 as I jump in the shower. Works a treat and is completely off the shelf. In both senses of the phrase.