-
-
Notifications
You must be signed in to change notification settings - Fork 117
Setting up haaska
Here's the long part. Please follow these steps very carefully.
Please remember to review the previous steps, Before You Begin, and Downloading and Preparing for haaska. Without those completed, you will not be able to continue.
All these steps were accurate as of February 18th 2019. If anything has changed, please let us know through our "Need help?" section.
- Sign in to the Amazon Developer Console.
- Click the link for "Login With Amazon" in the top navigation bar.
- Click the gold button that reads "Create a New Security Profile".
- Enter any security profile name you'd like, e.g. "haaska"
- Write a short description, e.g. "haaska for my Home Assistant"
- Add any url you'd like for the privacy notice, e.g. "https://myhass.example.com"
- Click "Save" to continue.
- On your new Security Profile, click the gear button, and choose "Web Settings".
- Make note of the Client ID, and Client Secret. Keep this window open for reference.
- Open a new browser window, keeping the previous one open for later.
- Click the "Developer Console" link at the top right of the page.
- Look for "Alexa" in the navigation bar, and choose "Alexa Skills Kit".
- Click on the "Create Skill" button.
- On this new page, enter the following:
- Skill Name - This can be anything you want, e.g. "haaska"
- Language - Choose the correct language you would like to use, e.g. "English (CA)"
- Click on the "Smart Home" tile
- Click the blue "Create Skill" button at the top right.
- Make note of the Skill ID listed (e.g.
amzn1.ask.skill.ed66dfa4-1185-492e-bf6e-1f70e90fb018
).
- Open a new browser window. Please keep the previous windows open for later.
- Sign in to the AWS Console.
- Click on the "Services" button at the top left, and in the list, locate the "Security, Identity & Compliance" section.
- Click on "IAM" in this section.
- On the left hand side bar, click on "Roles". Then, click on the blue "Create Role" button.
- On this page, make sure the tile "AWS service" is selected. Click on "Lambda", then click the "Next: Permissions" button at the bottom right.
- On this new page, enter "basic" in to the search box. When it appears, check the box beside "AWSLambdaBasicExecutionRole".
- Click the "Next: Tags" button on the bottom right. Do not enter any tags. Click "Next: Review" to continue.
- In the box for "Role name", please put in "lambda_basic_execution". Click "Create Role" at the bottom right.
- Click on the AWS button at the top left, to return to the main console.
This step is VERY IMPORTANT.
At the top right of the screen, there is a button next to your username, but before the "Support" button. It may have the name of a region. You must click it and select the correct Lambda Function Region according to your Alexa language.
Amazon provides a list of regions and languages. Here is a copy:
Skill language | Endpoint Region | Lambda Function Region |
---|---|---|
English (US), English (CA) | North America | US East (N. Virginia) |
English (UK), French (FR), German, Italian, Spanish (ES) | Europe, India | EU (Ireland) |
English (IN) | Europe, India | EU (Ireland) |
Japanese, English (AU) | Far East | US West (Oregon) |
For example, I am located in Canada, and my Amazon Echo devices are set to "English (CA)". For this step, I would choose "US East (N. Virginia)".
- Click on the Services button at the top left. In the list, look for the "Compute" section, and click on "Lambda".
- Click on the orange "Create Function" button.
- Make sure the "Author from scratch" tile is selected.
- Set the following options:
- Name - "haaska"
- Runtime -
Python 3.6
- Role - "Choose an existing role"
- Existing Role - "lambda_basic_execution"
- Click the "Create Function" button.
- In the "Designer" section of your new function, click on "Alexa Smart Home". If you do not see this, then you have not set the correct region.
- A section titled "Configure Triggers" will appear. In the "Application ID" box, copy and paste the "Skill ID" from the Alexa Developer Console window (e.g.
amzn1.ask.skill.ed66dfa4-1185-492e-bf6e-1f70e90fb018
). - Make sure "Enable Trigger" is checked. Click "Add" at the bottom right.
- In the "Designer" section, click on the name of your function (e.g. "haaska").
- In the "Function code" section, look for "Code entry type". Click on this menu, and select "Upload a .zip file".
- Click the "Upload" button, and select the zip file we downloaded earlier (e.g.
haaska_1.1.0.zip
). - In the "Handler" box, replace what is already there with "haaska.event_handler".
- Click "Save" at the top right of the page, and wait for it to load.
- In the "Function code" section, you will see a list of files. Double click on "config.json".
- In the URL section, add your remote Home Assistant URL (e.g.
https://my-hass.example.com:8123
) - In the Bearer Token section, add your Long Lived Token that you saved earlier (e.g "amcb3i2248yfm...")
- Click "Save" at the top right.
- At the top right of the Lambda window, there is an ARN (e.g. "arn:aws:lambda:us-east-1:111234567890:function:haaska"). Copy this text and save it.
- Go back to your Alexa Developer Console window. Paste the ARN in to the box labelled "Default endpoint".
- VERY IMPORTANT. From the checkboxes available, click the "Endpoint region" that matches your Skill Language/Lambda Function Region from earlier.
- Paste the ARN in to the region box.
- Click the "Save" button at the top right.
- Click the "Setup Account Linking" button at the bottom of the page.
- Enter the following:
Field | Setting |
---|---|
Authorization URI | https://www.amazon.com/ap/oa |
Access Token URI | https://api.amazon.com/auth/o2/token |
Client ID | The Client ID from your Login With Amazon window |
Client Secret | The Client Secret from your Login With Amazon window |
Client Authentication Scheme | HTTP Basic (Recommended) |
Scope |
Click + Add Scope and enter: profile
|
Domain List | Not used |
Default Access Token Expiration Time | Not used |
-
You will see a list of Redirect URIs. Please copy these down.
-
Click Save at the top right.
-
Go back to the Amazon Developer Console/Login with Amazon window. Click Edit at the bottom right.
-
In "Allowed Return URLs" section, click "Add another" until you have three lines.
-
On each line, add one of the Redirect URIs from the "Alexa Developer Console" window. Click Save.
At this point, haaska is essentially set up. There's just a few last steps to go. Check out Testing haaska.
New Documentation (incomplete)
- Before You Begin
- Downloading and Preparing for haaska
- Setting up haaska - Amazon and Config
- Testing haaska
Old Documentation