Alexa does Dolly, Part 4: Using Amazon Echo to control Sonos
In the previous parts of this blog series I shared my journey through integrating Amazon Echo and Sonos, setting up node.js on a Raspberry Pi, building an Alexa skill and exposing my home network to Amazon, all so that I could play Dolly Parton on voice command. So, now that I’ve got everything set up and have been using my shiny new integration for a while now, I can share a few insights into how well, or otherwise, it works.
Alexa, let’s boogie
So, first things first, it does work! I am able to control some (limited) functionality of my Sonos system fairly reliably, using voice commands.
This feature is pretty reliable and works the vast majority of the time:
“Alexa, ask Sonos to pause all”, will pause the music in every room of the house.
“Alexa, ask Sonos to pause in the lounge”, pauses the music in the lounge (or whatever room you choose).
“Alexa, ask Sonos to resume all”, and so on… you get the idea.
This is great for when you have 9 to 5 blaring out at full volume and you can’t find your phone, or are just too lazy to get off the sofa and go all the way over to the speaker to change the volume.
This feature works reasonably well.
“Alexa, ask Sonos to join the Dining Room to the Kitchen” will continue playing whatever music you have on in the kitchen as you move to the dining room.
This is really handy when you’ve prepared dinner, you’re carrying the plates through and want a seamless aural experience as you move from one room to the next. I am aware how this is most definitely a first world problem.
The one thing that my Echo seems to struggle with here though is joining the kitchen to other rooms.
“Alexa, ask Sonos to join the kitchen to the conservatory” doesn’t seem to work very reliably.
I’ve not done any in-depth analysis on this – it could be my northern accent or the positioning of the speaker. It does make it frustrating though when I need to move from drinking a G&T in the conservatory to preparing dinner, and would like to continue singing along to “I will always love you” (the original and, in my view, far superior Dolly version – not the overblown early 90s Whitney version).
Again, first world problems…
Ungrouping rooms seems to work well.
“Alexa, ask Sonos to leave the Lounge” is pretty reliable and results in removing the lounge from the group it’s in, and stopping the music.
Searching for Music
Frustratingly, this did work pretty well at first, but lately, I’ve not had much success.
“Alexa, ask Sonos to play artist Dolly Parton song I will Always Love You” did initially work but now doesn’t, even though Alexa responds with “Queued and started track: I will always love you”.
I suspect that that this could be a glitch with my Spotify setup or a change in the way Sonos connects to Spotify. I need to do a bit more tinkering with this to see if I can get it working again.
Changing the Volume
This works pretty well and I’m able to control the volume across the house pretty easily.
“Alexa turn the volume up in the Kitchen” usually works pretty reliably.
Similarly, “Alexa turn the volume down in the Lounge” has the desired effect.
Moving to the next track works pretty well.
“Alexa, ask Sonos to play the next track in the Lounge” has the effect you’d expect.
Random error messages
As with any beta technology, it has its limitations and I’ve definitely seen a few odd little quirks.
“The lambda service encountered an error, socket hangup”
“The lambda service encountered an error, connection refused…”
Alexa utters these from time to time. Often, the only resolution is to restart my Raspberry Pi – that’s right, switch if off and back on again.
Despite these minor hiccups, it’s definitely been worth integrating my Sonos speakers with Amazon Echo to surprise and impress visitors to my home. (As long as I remember to avoid moving directly from the conservatory to the kitchen.)