Closed jplourde5 closed 7 years ago
Spotify changed their search API and it now requires authentication.
So where are you stuck? Are you trying to get the proxy to work?
I thought maybe I would start from scratch as far as my node-sones-http-api-master running on my server, and I was hoping that you would walk me through it? Im actually not sure what I'm supposed to download anymore.... your version, or the other, or what? any chance you could walk me through it?
Follow the readme on this site, line by line, as well as the node-sones-http-api. Do not bother with the sqs-proxy. You can come back to the proxy if you get the rest working.
ok thanks... do you mean this READ ME? https://github.com/jishi/node-sonos-http-api
or this one: https://github.com/rgraciano/echo-sonos/blob/master/README.md
or both?
Start with echo-sonos which should be your main guide, and drill down to node-sones-http-api for the Spotify and Pandora setup
so I have installed node-sonos-http-api without error... next is the presets folder. This has never made sense to me. When I had things working I never messed with it. Is it ok to just leave it alone?
Yes, I don't use presets either. Make sure at this point that you get the Spotify and Pandora settings in place and tested successfully by invoking the urls as described in the readme.
do you have any clarity on copying options.example.js to options.js? Seems very confusing
Just fill in these three values and ignore the rest.
appid: "Your app ID from the Lamda console", host: "your public IP address on your firewall for getting to node-sones-http-api", port: "The port that you are using for node-sonos-http-api. Default is 5005 I believe",
i thought advanced mode took care of that? do i need to actually enter that information in the options file?
i just keep getting the Invalid music service message in my terminal window. I can get my zones, I can play/pause... I can enter http://myserverip:5005/kitchen/playlist/alarm and it works, but nothing involving Spotify or Pandora.
this is my setting.json file: { "pandora": { "username": "acct email", "password": "acct pw" }, "spotify": { "clientId": "clientid", "clientSecret": "secret" } }
What url are you using to play a Spotify song?
And you did fill in actual values in the settings.json file, correct?
even though I have enabled advanced mode and have entered that info there?
sorry... yes, I did that. it is located in the same directory as the node-sones-http-api-master
does that look right?
when i paste this:
myserverip:5005/kitchen/musicsearch/pandora/station/jazz%20anova
i get this in cloud watch:
Let's get one thing working before we move on to the next. At this point we want to get node-sonos-http-api working locally inside your firewall using your browser to invoke the urls. On the server that you installed node-sonos-http-api on, invoke http://localhost:5005/kitchen/pandora/play/{station name} where {station name} is one of your valid, existing station names. BTW, your url above is not correct. There is no pandora service for music search. Pay very close to the example URLs in the readme.
{"status":"error","error":"An unexpected error occurred [1002]","stack":"Error: An unexpected error occurred [1002]\n at Request._callback (/Users/christophermurray/Downloads/node-sonos-http-api-master/node_modules/anesidora/anesidora.js:39:33)\n at Request.self.callback (/Users/christophermurray/Downloads/node-sonos-http-api-master/node_modules/request/request.js:188:22)\n at emitTwo (events.js:106:13)\n at Request.emit (events.js:191:7)\n at Request.
This is what I posted: http://localhost:5005/kitchen/pandora/play/{Adele Radio}
Also tried it with "Radio" and without {}
This in terminal window:
2017-06-27T20:37:54.944Z ERROR
Error: An unexpected error occurred [1002]
at Request._callback (/Users/christophermurray/Downloads/node-sonos-http-api-master/node_modules/anesidora/anesidora.js:39:33)
at Request.self.callback (/Users/christophermurray/Downloads/node-sonos-http-api-master/node_modules/request/request.js:188:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request.
There should be no {} in the actual url. Pull up Pandora in your Sonos controller app and use one of the stations that you see there, spelled exactly like you see it in Sonos.
Straight from Pandora within Sonos app:
74.75.123.155:5005/kitchen/pandora/play/Amy Winehouse Radio
returned same as above.
Tried it with and without spaces
Let's switch to Spotify. Try
74.75.123.155:5005/kitchen/musicsearch/spotify/song/artist:boston
That worked!!!
Getting somewhere! Try
74.75.123.155:5005/kitchen/musicsearch/spotify/song/more than a feeling
and other songs and artists
I tried adele twice... the first time it played a Paul McCartney song, but the second time it played Adele.
but the more than a feeling did not work....
it actually pulled up a Google search...
I just went back and tried the first Boston link and it did not work....
it actually played a song called Boston Manner by Be Nothing
Trying it again it is just coming up with random songs... now another Paul McCarthey and Wings...
Now it did come up with Boston Rock and Roll Band
but not able to get individual songs....
Still can't do anything with Alexa without getting "Invalid Music Service" though... but making progress! But she will still play and pause etc...
Hi all. First thanks for all your hard work here. Much appreciated. Im a total noob here, but managed to get mij Echo dot communicating with my Sonos 1 with rgraciano's instructions and files. Till now I can only do the basics, like start en resume playing a radiostation I mostly have on Sonos. Im ready to make the step to Spotify but I cant manage to figure out what exactly im supposed to edit or add. I have my spotify client ID and API key. Should I just zip all the jplourde5 files in lib, upload in lambda funtion and edit spotify ID and Key in the code once in Lambda?
Try 74.75.123.155:5005/kitchen/musicsearch/spotify/song/track:more than a feeling
Vurnen, You should use the normal distributions, not any of my forks. The instructions for getting Spotify to work can be found in the node-sonos-http-api readme in the settings.json file section.
When I added %20 between words it worked! http://74.75.123.155:5005/kitchen/musicsearch/spotify/song/track:more%20than%20A%20FEeling
But Pandora still a no go...
Ok! I got Pandora working! I had a misspelling in the setting.json credentials.... Ugghhh! So now I can call to both Spotify and Pandora, but not through Alexa.
I feel like we are soooo close....
So the problem is clearly with Lambda Configuration I think. I can test a request in the Alexa skills test area and all looks good.
Catching up. Great progress. So you are able to play music using the Alexa Test function?
Saying "Alexa, open Sonos" or "Alexa, start Sonos", etc. invokes Sonos. The current room and service are indicated followed by a "What would you like to do next?". You can continue to perform multiple commands without having to repeat "Alexa, ask Sonos...". You can conclude at any point by answering "I'm finished", "Finished", "Done", etc.