I now believe I have got this working. At least mostly working.
If I manually (using my phone sonos app) start a track or playlist running on a sonos speaker, for example in the kitchen, I can then do the following:
Alexa, ask sonos to pause in the kitchen
Alexa, ask sonos to add the utility room to the kitchen
Alexa, ask sonos to resume in the kitchen.
However, what I cant get it to do is actually start playing something of my choice.
I have tried âask sonos to play artist queen in the kitchenâ, have tried with or without the word âartistâ, and differing artists.
The response from Alexa (as mirrored in the developer test page when I write the phrase in), is: âQueued and started artist queenâ
However, nothing starts playing, there is no action on the sonos and I see the following error in the npm/git console:
2016-10-05T09:05:36. 953Z ERROR Invalid music service
I have the following set in my opitions file:
defaultRoom: âkitchenâ, // Allows you to specify a default room when one is not specified in the utterance
defaultMusicService: âspotifyâ, // Supports presets, apple, spotify, deezer, or library
advancedMode: true, // Allows you to specify and change default rooms and music services. Requires additional AWS setup
Ive tried removing the apostrophes around the word spotify, but that just breaks in and there is no response at all from Alexa.
Ive also tried âAsk sonos to play favourite BBC Radio 2 in the kitchenâ. This results in the same error as above.
Anyone any ideas on how to resolve these issues?
EDIT - I tried one of the advanvced features and asked sonos to change music to spotify.
Alexa responded with OK. There were no messages appear in the npm/git console to confirm or deny this had happened.
When I then try âtell sonos to play artist queen in the kitchenâ I hear âqueued and started artist queenâ from Alexa, though nothing happens on the sonos, and I receive the following error in the console:
2016-10-05T09:45:15. 098Z ERROR No matches were found
Trying with a different artist, such as ârobbie williamsâ then results in the following error (again nothing happens on the sonos):
Error
at Object.invoke (C:\Users\chris\projects\sonos\node-sonos-http-api\node_modules\sonos-discovery\lib\helpers\soap.js:92:10)
at Player.addURIToQueue (C:\Users\chris\projects\sonos\node-sonos-http-api\node_modules\sonos-discovery\lib\models\Player.js:533:15)
at C:\Users\chris\projects\sonos\node-sonos-http-api\lib\actions\musicSearch.js:299:48
at process._tickCallback (node.js:369:9)