stevenleeg / geemusic

A bridge between Google Music and Amazon's Alexa
GNU General Public License v3.0
664 stars 181 forks source link

How to create an Alexa Skill in new Developer Console #277

Closed cigdangle closed 5 years ago

cigdangle commented 5 years ago

I had GeeMusic working at one time, but am no longer able to get it working. The issue is I am unsure how to setup an Alexa skill in the new Alexa Developer Console. There are a number of additional options, and I'm too unfamiliar with what they are asking.

HELP!

fergyfresh commented 5 years ago

You're going to have to be WAYYYY more specific.

cigdangle commented 5 years ago

The directions do not apply to the current Alexa Developer Console, so you cannot follow them to create a skill. Here is a small snippet of what is needed to create a skill now:

image

The name and the endpoint are obvious, but the rest is confusing.

fergyfresh commented 5 years ago

LOL. It seems like they change the interface, but the big pieces are still in there.

cigdangle commented 5 years ago

Yes, I think so too, but it's just confusing me. For example. when you click #2 above, you see this: image

RandyCupic commented 5 years ago

@cigdangle Yes, it's a little bit different and I had some difficulties as well, but carefully following the instructions and looking for similar options, I've managed to get it working. For example, the last image you posted: the instructions contain a table which says:

Skill Type | Custom Interaction Model

So this is telling you that you should select the Create custom intent option on your image. If you will have any more difficulties, just ask and I can try to help you since I got it working on the "new" console a week ago :)

fergyfresh commented 5 years ago

If anyone notices any changes with the setup feel free to update the README. I'm looking at you @RandyCupic and @cigdangle. I set it up once like 18 months ago and haven't had to change it since. I just push code updates to my Lambda function.

RandyCupic commented 5 years ago

@fergyfresh I hope you don't mind if I use this issue to ask a question what's been bothering me: for what are we using the S3 bucket? I don't really understand this whole concept over AWS but I noticed that it generates a lot of traffic and it started pumping my AWS bills. There are around 8 GBs already of data, but I don't think that I've been listening to such a huge amount of songs.

What is the S3 bucket used for and can I somehow prevent the traffic to go over AWS? Can't we just feed Alexa with direct streaming URL on Google servers and stream from there? Or is there some kind of API limit so that we're forced to cache songs?

I tried to disable the S3 bucket but now I'm not getting any audio. I tried to test in the Alexa developer console and the returned JSON still contains link stream URL to my app.

fergyfresh commented 5 years ago

You need the S3 bucket for the redirect proxy. Since Lambda is ephemeral we need something to persist the response to Alexa. We are using S3 for that.

https://github.com/stevenleeg/geemusic/blob/master/geemusic/controllers.py#L57

I play about 100-300 songs a month and only get charged 0.11 GB and about 0.01 cents, they actually do not charge me at all though. I don't know what international billing rates are, but I am not seeing this as an issue. Can you see where the traffic through S3 is?

RandyCupic commented 5 years ago

Well 100-300 songs is nothing :) I listened to about 50 songs only yesterday. But the price is different than yours. They charged me 0.16 $ for these 50 songs. Even though, 50 songs I have scrobbled in last.fm, in reality, there's probably at least 30% more, since I like to skip songs a lot.

But how do you get only 0.11 GB for 300 songs? When I open my S3 bucket, I can see tons of entries there. I guess that each entry is a song, right? And lots of them have over 10 MB. So 100 songs = approx. 1 GB. Let's say that I listen to at least 1000 songs monthly -> that's 10 GB * 0.09 $ + VAT -> at least 1$ monthly. I'm currently at 0.56$ for this month.

Here's my bill: image

I was reading a little bit about S3 buckets on Google and I've found out that bad settings with servers and zones could cause bigger charges. I'm from Croatia, but my Echo Dot is set to Seattle, because Amazon doesn't support Croatia, and so that I can use Pandora which is not supported in Croatia.

I'm thinking about creating my own server on Raspberry PI but I wanted to check first if there's an option to disable S3 or to change some settings to decrease costs a little bit. Up to 1$ monthly is fine with me since the Raspberry Pi would also consume some electric energy.

fergyfresh commented 5 years ago

Yeah. You don't have to use S3. It's actually an environment variable. USE_S3_BUCKET. You could add another proxy_response implementation that uses your Rasperry PI as a proxy instead of S3 (if you wanna still use Lambda) Or you could just deploy this to your server in house which is what I think a majority of users here do. I am the black sheep here that uses AWS Lambda + S3 + API Gateway.

The function you'd have to implement if you ONLY wanna move from S3 is here https://github.com/stevenleeg/geemusic/blob/master/geemusic/controllers.py#L12. This would allow you to use AWS Lambda + API Gateway + Your Raspberry PI Redirect server.

fergyfresh commented 5 years ago

Does that make sense? @RandyCupic.

RandyCupic commented 5 years ago

Yes, thank you :) I just wanted to check before moving to the local server, if there's anything I could do. Lambda will do for now, until I get some time to set-up my local server.

fergyfresh commented 5 years ago

The default deployment setup I think @stevenleeg geared towards a local server. FYI

cigdangle commented 5 years ago

Can we get back to my question now? :)

@RandyCupic can you provide some step-by-step guidance setting up the Alexa Skill? I'm just lost!

fergyfresh commented 5 years ago

Try and try again. You'll learn enough. Honestly everything in that screenshot is what I made the current README off of. Many others have successfully done it from this readme. You have to try a little. I am busy, I'm sorry.

ev0ldave commented 5 years ago

@cigdangle cigdangle, I just finished this

  1. Invocation name, gee music
  2. intents, samples, slots: left panel under Slot Types is JSON Editor, drag and drop the json file at speech_assets/interactionModel.json
  3. Interfaces at left panel, turn on Audio Player
  4. Endpoint, set as described in the current README as well as the ssl setup in drop down
  5. Click on the Build in the top bar then click on the 3. Build Model on the right panel (This will build your skill)

Once the build is done click on the "test" in the top bar. enable testing in development. If using Heroku I had to explicitly call out the full URL instead of letting HEROKU_APP_NAME resolve, it would not work.. You will see all of this output in the JSON Output window to see if URLs are building properly. Once tested I had to split from the current README and fill out Distribution section, Privacy & Compliance. I had to do this in order to enable beta test under the Availability Tab there and get it onto my echo. I added myself to the beta test list and copy/pasted into new browser window the invite URL.

Edit My alexa account was not properly linked to developer account so beta run canceled and skill is activated in alexa while testing drop down is enabled. Testing in the skill web browser works for me; however behavior is different on the actual device, almost like it is not seeing the skill. I see the ask show up on alexa when asked via the skill development window but asking via the device does not recognize "gee music". In other words, take the above setup with a grain of salt (everything appears as though it should work)

fergyfresh commented 5 years ago

Thanks @ev0ldave. Didn't notice this.