-
Notifications
You must be signed in to change notification settings - Fork 135
Setup
-
Ensure that you're currently running Home Assistant version 0.62 or greater.
-
You can clone the repository if you'd like, but the fastest way to get started is to Download the ZIP of all files.
-
Enable the Alexa component in Home Assistant
-
In the
config/directory, copyconfig.json.sampletoconfig.jsonand update it. Below is a listing of properties thatconfig.jsonwill accept. -
Run
maketo build a deployable package of haaska. This will generate ahaaska.zipfile that you'll upload to AWS Lambda (if you're used to docker you can try running make withdocker build -t haaska . && docker run -v "$PWD":/usr/src/app haaska -
Register with an OAuth provider, such as Login with Amazon.
- To use the current version of Login with Amazon, you must go to the Developer Console
- Under "Apps & Services", select "Login with Amazon" (not "Security Profiles")
- Click "Create a New Security Profile"
- You can enter anything for the name (which is shown on the login page) and the privacy URL
- Note the "Client ID" and "Client Secret", as you'll need those later
- To use the current version of Login with Amazon, you must go to the Developer Console
-
Create an Alexa skill and Lambda Function by following these instructions (with the modifications noted below).
- The name of the Alexa skill doesn't matter, but I'd suggest "haaska"
- The name of the Lambda function does matter; use "haaska", otherwise you'll need to modify the
FUNCTION_NAMEvariable in theMakefile. - For "Runtime", select "Python 3.6" as in the example
- Select "Upload a .ZIP file" for "Code entry type", and upload
haaska.zipthat you created in step 1. - For "Handler", enter
haaska.event_handler - For "Role":
- Select "Choose an existing role", and underneath, select
lambda_basic_executionif it exists - If
lambda_basic_executiondoesn't exist, select "Create a custom role" instead, and enterlambda_basic_executionas the "Role Name"
- Select "Choose an existing role", and underneath, select
- Leave the rest of the defaults alone, and click "Next"
- Add the Alexa Smart Home trigger and insert your skillID. Test your Lambda function now to make sure it works.
- Under the "Account Linking" section:
- Set Authorization URL to: https://www.amazon.com/ap/oa
- Set the Client ID to the previously noted value from Login with Amazon
- Set Scope to:
profile - Set Access Token URI to: https://api.amazon.com/auth/o2/token
- Set Client Secret to the previously noted value from Login with Amazon
- Note the one or more "Redirect URL(s)"
- There are two properly sized Home Assistant logos in the images/ folder which you can upload to Amazon for use with your skill. Upload both on the "Publishing Information" step of the process.
-
Go back to Login with Amazon, select "Web Settings" under "Manage" for your security profile, and add each "Redirect URL" from the Lambda function as an "Allowed Return URL".
-
Send a test event by running
make discover, which will validate that haaska can communicate with your Home Assistant instance. Note that you must have the AWS CLI and jq installed. This should return a JSON listing the devices exposed through the HomeAssistant API.
| Key | Example Value | Required? | Notes |
|---|---|---|---|
url |
https://home-assistant.io/demo/ |
Yes | The API endpoint of your Home Assistant instance. |
password |
securepassword |
Yes | The API password of your Home Assistant instance. |
ssl_verify |
mycert.crt |
No | This will be passed as the verify parameter for all requests; see here for options. |
debug |
false |
No | When enabled, the haaska log level will be set to debug. If not provided, this defaults to false. |
New Documentation (incomplete)
- Before You Begin
- Downloading and Preparing for haaska
- Setting up haaska - Amazon and Config
- Testing haaska
Old Documentation