Closed chilloutboy closed 7 years ago
@rgraciano if my comments are correct maybe I can rework some parts of the readme and submit a pull request if that would help. Lots of people new to aws lambda services (myself included)
Thanks jzajac2 You have been very helpful. I renamed the options.example.js to options.js zipped up the contents of the src folder and uploaded it.
I am still getting an error...
{ "errorMessage": "Cannot find module '/var/task/index'", "errorType": "Error", "stackTrace": [ "require (internal/module.js:12:17)" ] }
Thanks for you help ;-)
When I had that error it was because of the structure of my zip I believe. Confirm yours is exactly as mine which works?: src.zip --sonosProxy (folder) --AlexaSkill.js --index.js --options.js
Also make sure you have pulled latest from master. I believe there was a recent update: https://github.com/rgraciano/echo-sonos/commit/43af5f952e306a76cae0585fe37e724be581aa82
Thanks again jzajac2 for your help.
I'm getting closer, i did have a mistake with the zip file, all fixed now,
just getting an invalid application ID error now.
I've double checked the APPID is correct, i even tried inserting it directly into the options.js file but still get the same issue.
{ "errorMessage": "Invalid applicationId" }
Any help (again) would be appreciated :-)
Make sure you don't forget these steps:
And if you 'publish' new versions, seems you need re-add that trigger each time. (so I stopped publishing new versions)
try to keep it out of the options.js file. It will work.
Thanks once again jzajac2 for your help, without you I wouldn't have got this far.
I've managed to get Lambda working, i recreated both the Lambda function and also the Alexa skill. I think the issue was that previously i created the Alexa skill and changed the Language to English (UK), by recreating the skill and using the default English (US) Lambda is OK.
I still have a couple of issues: - Alexa wont perform any "ask sonos" functions, she just says "Hmm something went wrong, try again in a few minutes" I believe this is caused by the second issue, which is a configuration problem.
I don't understand how the custom slot types work, i understand that these are used for selecting options however, I am assuming that NAMES are all my ARTIST names as specified in my sonos music library, is this correct?
SERVICES - within this list are the music services, i assume i would be using LIBRARY if i want to play music from my sonos library? Also is the PRESETS option here to allow a subset of the custom slot type PRESETS?
PRESETS - is this used for genre or playlists or am i missing something here?
I have been testing using the Service Simulator in the Amazon developer in my Alexa skill. The only thing i can actually get to work are playlists. So if i type "start playlist test in bedroom" this creates a call to http://mydns:5005/bedroom/playlist/test and works correctly. However if i ask Alexa "ask sonos start playlist test in Bedroom" she tels me "something went wrong" I have tested my DNS and this all works correctly.
So I'm making good progress but still failing.
Any advice appreciated. Thanks in advance :-)
I can't answer all of this right now, however, start with just using presets and Favorites. I have been most successful with Favorites. Presets are what you define in your node-sonos-http-api repo AFAIK
So I'm super embarrassed, even though I'm a newbie... however, I cannot locate the file options.example.js. Pulling my freakin hair out! Can anyone please help?
Relative to the download of this repo's master branch: lambda/src/options.example.js
https://github.com/rgraciano/echo-sonos/blob/master/lambda/src/options.example.js
Thanks for the reply, but the link is 404. I'm simply stuck at step 5 of the process. I can locate the options.example.js on github, but I cannot figure out what to copy and paste it to? I assume I am looking locally for the file options.js, and adding the contents of options.example.js... as described in the instructions. However, I cannot find options.js locally anywhere...
Hi loftgren
Try this https://github.com/rgraciano/echo-sonos/tree/master/lambda/src
Thanks very much, but I have already located options.example.js. What i am having trouble with is what to do next. The instructions say to copy and paste it to options.js, but I cannot find that file anywhere (i assume I'm looking locally?) Then Im supposed to upload it to Lambda, but Im not actually sure what file Im supposed to upload. Sorry to be a pain...
@loftgren Just rename the file options.example.js to options.js
Then you are going to create a zip file called src.zip. Include in the zip file the options.js file along with index.js, AlexaSkill.js and the directory sonosProxy (along with all the files in sonosProxy)
So are these to be downloaded to my mac, then uploaded in a zip file? When I try to download them they are a .html. Is that correct?
Download master.zip file and unzip master.zip to your computer. The files you need are contained in this zip file. https://github.com/rgraciano/echo-sonos/archive/master.zip
Once you unzip the master.zip file, the files you are looking for will be in the directory echos-sonos-master/lambda/src/ on your computer. They are not html files. The will all end in .js
ok. making progress! I think I have that set... now Im looking for a place to enter my appid?
Any idea where I enter that? It says to do so, but I find no area to enter appid or host.
Still in the 'CODE' tab once you have uploaded your zip file, just below the code you see an Environment Variables section Enter APPID in the left hand side and on the right paste your Application ID from the Developer Console. Likewise enter HOST on the left below the APPID and your DNS address on the right
You will need to setup an Amazon AWS account. Then go to lambda to setup APPID. https://console.aws.amazon.com/lambda/
Once you've setup your lambda function, the first tab Code is where you enter environment variables. Scroll down to the bottom of the Code page and look for Environment variables section.
You will have to type in the information. You should see a field for Key and one for Value. For Appid you would type APPID in the Key field and your Amazon appid amzn1.echo-sdk-ams.appxxxxx in the Value field. You will need to add all the key and values needed. ADVANCED_MODE ture/false, USE_SQS true/false etc.
Seems like I have it right, but I keep getting this message: Array.from requires an array-like object - not null or undefined any idea what that refers to?
Hi GregRocket, we both answered the same question... I have only been able to play playlists, have you had much luck with radio stations, albums or individual tracks?
@loftgren Sorry I don't know what that message means. Did you follow all the instructions to complete the setup?
Yes. Im sure i have it all correct, but it won't let me create the function... keep giving me that error.
@chilloutboy Yes I can play radio stations, sonos playlists and local playlists using preset.jsons. I can also ask for artist or album (although I don't use that feature much.)
@loftgren I'm not sure what that means. I would suggest you step away for a bit. Then read all the instructions again. Start from the beginning and just do the whole process again.
ok thanks. I really appreciate your help!
GregRocket so can you please just explain the custom slot types you have used... NAMES - All of your artists? PRESETS - Genres? SXMCHANNELS - ? SXMSTATIONS - Radio names or Sonos favorites radio names
Thanks
@chilloutboy Names - I just put in the default ones. I don't think this is needed much anymore. But if you have an artist that does not work, stick it in here.
PRESETS - Exact same name as preset.json For example is preset.json is named eagles.json then I put eagles in the list. I don't have generic preset for rock, pop etc. I only put the exact name of each on my preset.json files. In this example my eagles.json calls an amazon prime music station eagles radio. The preset.json, custom slot name and sonso favorite must all match exactly.
Some of my presets: all 80s - An Amazon Prime Station beatles - An Amazon Prime Station classic hits - An Amazon Prime Station classic rock - An Amazon Prime Station classic soft rock - MP3.m3u on my NAS box Disney's greatest - MP3.m3u on my NAS box eagles - An Amazon Prime Station easy pop - An Amazon Prime Station
I don't use SXM so I can't help you there, but I do use Amazon prime music and pandora. Just put the name you have in your sonos favorite for the radio station.
To search for an artist or album, I've only used that on my local mp3 files. But this should be the same method for some radio stations that are supported for search. I just issue the command "Alexa, ask sonos to change music to library." Then to play an artist "Alexa, ask sonos to play ARTIST NAME in the ROOM." If I ask for Rod Stewart and assortment of song from him come up, after a pause while the search is made, and start playing. When I'm done I issue the command "Alexa, ask sonos to change music to presets"
Thanks Gregrocket that has really helped me. I will give it a go.
Thanks
@GregRocket you are a star :-) I can now play library items, playlists and radio stations.
Also thanks @jzajac2 for all your help getting me through the install/configuration
@chilloutboy Awesome! 👍
@jzajac2 - definitely, please do feel free to submit a PR for README tweaks if you can see areas to be improved
Hi, i'm very new to this (not again, i hear you say). I've run through almost everything but am stuck at steps 5 to 7...
I believe I've missed something out as when i test i get an error
"START RequestId: f6c318a0-01ec-11e7-8a91-7b35a3c0420f Version: $LATEST Handler 'handler' missing on module 'index' END RequestId: f6c318a0-01ec-11e7-8a91-7b35a3c0420f REPORT RequestId: f6c318a0-01ec-11e7-8a91-7b35a3c0420f Duration: 30.08 ms Billed Duration: 100 ms"
Thanks in advance :-)