Skip to content

Setting up haaska

Anthony Lavado edited this page Mar 15, 2019 · 2 revisions

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.


Set Up Login With Amazon

  1. Sign in to the Amazon Developer Console.
  2. Click the link for "Login With Amazon" in the top navigation bar.
  3. 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"
  4. Click "Save" to continue.
  5. On your new Security Profile, click the gear button, and choose "Web Settings".
  6. Make note of the Client ID, and Client Secret. Keep this window open for reference.

Set up Alexa Skills Kit

  1. Open a new browser window, keeping the previous one open for later.
  2. Click the "Developer Console" link at the top right of the page.
  3. Look for "Alexa" in the navigation bar, and choose "Alexa Skills Kit".
  4. Click on the "Create Skill" button.
  5. 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
  6. Click the blue "Create Skill" button at the top right.
  7. Make note of the Skill ID listed (e.g. amzn1.ask.skill.ed66dfa4-1185-492e-bf6e-1f70e90fb018).

Preparing AWS Lambda Access

  1. Open a new browser window. Please keep the previous windows open for later.
  2. Sign in to the AWS Console.
  3. Click on the "Services" button at the top left, and in the list, locate the "Security, Identity & Compliance" section.
  4. Click on "IAM" in this section.
  5. On the left hand side bar, click on "Roles". Then, click on the blue "Create Role" button.
  6. On this page, make sure the tile "AWS service" is selected. Click on "Lambda", then click the "Next: Permissions" button at the bottom right.
  7. On this new page, enter "basic" in to the search box. When it appears, check the box beside "AWSLambdaBasicExecutionRole".
  8. Click the "Next: Tags" button on the bottom right. Do not enter any tags. Click "Next: Review" to continue.
  9. In the box for "Role name", please put in "lambda_basic_execution". Click "Create Role" at the bottom right.
  10. Click on the AWS button at the top left, to return to the main console.

Region Select

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)".


Setting up AWS Lambda - Part 1

  1. Click on the Services button at the top left. In the list, look for the "Compute" section, and click on "Lambda".
  2. Click on the orange "Create Function" button.
  3. Make sure the "Author from scratch" tile is selected.
  4. Set the following options:
    • Name - "haaska"
    • Runtime - Python 3.6
    • Role - "Choose an existing role"
    • Existing Role - "lambda_basic_execution"
  5. Click the "Create Function" button.

Setting up AWS Lambda - Part 2

  1. 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.
  2. 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).
  3. Make sure "Enable Trigger" is checked. Click "Add" at the bottom right.
  4. In the "Designer" section, click on the name of your function (e.g. "haaska").
  5. In the "Function code" section, look for "Code entry type". Click on this menu, and select "Upload a .zip file".
  6. Click the "Upload" button, and select the zip file we downloaded earlier (e.g. haaska_1.1.0.zip).
  7. In the "Handler" box, replace what is already there with "haaska.event_handler".
  8. Click "Save" at the top right of the page, and wait for it to load.

Configure your haaska Function

  1. In the "Function code" section, you will see a list of files. Double click on "config.json".
  2. In the URL section, add your remote Home Assistant URL (e.g. https://my-hass.example.com:8123)
  3. In the Bearer Token section, add your Long Lived Token that you saved earlier (e.g "amcb3i2248yfm...")
  4. Click "Save" at the top right.

Linking AWS Lambda to Alexa Skills Kit

  1. 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.
  2. Go back to your Alexa Developer Console window. Paste the ARN in to the box labelled "Default endpoint".
  3. VERY IMPORTANT. From the checkboxes available, click the "Endpoint region" that matches your Skill Language/Lambda Function Region from earlier.
  4. Paste the ARN in to the region box.
  5. Click the "Save" button at the top right.

Linking Alexa Skills Kit to Login With Amazon

  1. Click the "Setup Account Linking" button at the bottom of the page.
  2. 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
  1. You will see a list of Redirect URIs. Please copy these down.

  2. Click Save at the top right.

  3. Go back to the Amazon Developer Console/Login with Amazon window. Click Edit at the bottom right.

  4. In "Allowed Return URLs" section, click "Add another" until you have three lines.

  5. On each line, add one of the Redirect URIs from the "Alexa Developer Console" window. Click Save.


You made it!

At this point, haaska is essentially set up. There's just a few last steps to go. Check out Testing haaska.