Anthony Lavado edited this page Jul 29, 2018 · 5 revisions

Setup

  1. Ensure that you're currently running Home Assistant version 0.62 or greater.

  2. You can clone the repository if you'd like, but the fastest way to get started is to Download the ZIP of all files.

  3. Enable the Alexa component in Home Assistant

  4. In the config/ directory, copy config.json.sample to config.json and update it. Below is a listing of properties that config.json will accept.

  5. Run make to build a deployable package of haaska. This will generate a haaska.zip file that you'll upload to AWS Lambda (if you're used to docker you can try running make with docker build -t haaska . && docker run -v "$PWD":/usr/src/app haaska

  6. 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
  7. 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_NAME variable in the Makefile.
    • For "Runtime", select "Python 3.6" as in the example
    • Select "Upload a .ZIP file" for "Code entry type", and upload haaska.zip that you created in step 1.
    • For "Handler", enter haaska.event_handler
    • For "Role":
      • Select "Choose an existing role", and underneath, select lambda_basic_execution if it exists
      • If lambda_basic_execution doesn't exist, select "Create a custom role" instead, and enter lambda_basic_execution as the "Role Name"
    • 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.
  8. 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".

  9. There are two options for testing. Please see the "Testing Haaska" page for instructions.

Config Values

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.
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.