Custom commands for Sonos Voice Control [developer API?]

  • 19 October 2022
  • 5 replies

Userlevel 3

I was wondering if there are any plans to expose some kind of developer API or custom commands for Sonos Voice Control?

What I have in mind is invoking a webhook with a command recognized by Sonos. I’d love to use Sonos in my home automation system e.g. by saying Hey Sonos, turn off the lights.

As developer I don’t actually need Sonos to integrate with any of the home automation systems. What I would be happy to have is Sonos system to call a defined webhook with recognized words or broadcasting this with MQTT or any other common protocol.

In ecosystems like Google Assistant or Alexa these are vastly more complicated, but having this kind of easy-access API would open Sonos to home automation community and similar enthusiasts.

This topic has been closed for further comments. You can use the search bar to find a similar topic, or create a new one by clicking Create Topic at the top of the page.

5 replies

If Sonos would provide such an API that would be a game changer for smart home users that value their privacy. Especially since Home-Assistant focusses heavily on voice integration in 2023 and decent hardware is always hard to find. Personally I’m very happy with the Sonos Voice Control of my Sonos Roam and I’d love to be able to control my smart home through it as well.

Another vote for an option to pass commands on to Home assistant for processing.   It would all me to completely abandon my Alexa devices and purchase Sonos to replace them.

I’m not convinced that Sonos Voice Control (SVC) is fully capable of converting voice commands to text that can then be passed on to home assistant or some other smart home controller.  What I think is actually happening is that the speaker intself is capable of recognizing a set of common words (play, pause, up, down, group, Amazon, Apple, typical room names, etc), but will actually send a phonetically sounded out version of your command to your music service for the rest of the interpretation and retrieving music from the services library.  Here’s why I think that’s the case.

1 - The speakers have fairly limited resources.   Seems unlikely that a library of every English (or other language supported) is contained on the speaker locally.

2 - Only certain music services are supported, and your local library is not.  That could be a legal issue in some way I don’t quite understand, but it seems as if though some sort of cloud service needs to be provided by the music service provider for this to work. Perhaps a way to translate an SVC phonetic version of your command, the part that’s a song title or artist etc.

3 - Sonos doesn’t provide a text version of what SVC heard,  like cloud based services (Alexa) does.  That could be because there is no actual conversion to text occurring.

4 - Other voice services have migrated to do some local processing, but still do most processing in the cloud.  That could be because of their interest in data, but it would make more sense for them to process everything locally, and send processed data only to the crowd.


Just my guesses, but if this is the case, that would mean that Home Assistant or some other in between process, would need to do some additional processing of a voice command to modify it further into a text command.    Then again, SVC should already be familiar with common room names and there are some overlapping words between music control and smart home control.  It might not be too big of a step forward to add “lights, “camera” type words and pass a semblance of a command to home assistant.

“Custom commands for Sonos Voice Control [developer API?]”

Sonos is based on Snips AI, which is precisely what it was designed to do.

that would open so much possibilities if sonos would provide a local API for sonos voice control.

some thoughts:
* expose all commands as webhook (if possible as STT, if that can not be processed it would be already a huge win to get the audio stream)
* only forward commands to a API endpoint which can not be handled by sonos locally (e.g. “play radio in kitchen” would not be forwarded, but “turn on kitchen lamp” would be exposed to webhook/… and can then be processed by a local server like home-assistant