How to connect Alexa to your cloud Home Assistant, step by step

Your own Amazon skill, free and with no coding: 30 to 45 minutes of copy and paste to control your Home Assistant by voice with Alexa.

You can control your Home Assistant with Alexa without paying for any extra subscription. You create your own “skill” in Amazon once: it takes 30 to 45 minutes and you don’t need to code, just copy and paste carefully. This guide follows the manual method in the official Home Assistant documentation, adapted to a cloud instance such as Coiaca Cloud HA.

On Coiaca Cloud HA you already have the hardest part of this setup: a public HTTPS address on port 443 with a valid certificate. With Home Assistant at home, that would mean opening ports, dynamic DNS and a certificate.

What you need

  • An Amazon developer account (developer.amazon.com), using the same Amazon account as your Alexa app.
  • An AWS account for a small Lambda function. A home’s usage fits comfortably in the AWS free tier (one million requests a month). AWS asks for a card when you sign up.
  • Your Home Assistant address, for example https://ha.your-home.coiaca.app.

Step 1: turn on Alexa in Home Assistant

Open the file manager in your Coiaca panel, edit configuration.yaml and add at the end:

alexa:
  smart_home:
    locale: en-US

Use the language of your Alexa (en-US, en-GB, de-DE, es-ES…). Save and restart Home Assistant from Settings → System, with the restart button at the top right.

Step 2: create the skill in Amazon

  1. Open the Alexa Developer Console and click Create Skill.
  2. Give it a name (for example “My home”) and choose your Alexa’s language.
  3. Choose Smart Home and Provision your own, then click Create skill.
  4. Check that Payload version is v3 and copy the Skill ID. Keep this tab open.

Step 3: create the Lambda function in AWS

The Lambda function is the bridge: it receives what you say to Alexa and passes it on to your Home Assistant.

  1. In the AWS console, go to IAM → Roles → Create role, choose AWS Service → Lambda, add the AWSLambdaBasicExecutionRole policy and create the role.
  2. Go to Lambda and, at the top right, pick the region by your Alexa’s language, not by where you live: US East (N. Virginia) for English (US) and English (Canada); EU (Ireland) for English (UK), German, Spanish (Spain) and French; US West (Oregon) for Japanese and English (Australia). A wrong region makes account linking fail with no error.
  3. Create function → Author from scratch, with Runtime set to the latest Python 3 and, under Change default execution role, the role you created.
  4. Click + Add trigger, choose Alexa Smart Home and paste the Skill ID from step 2.
  5. Under Code source, clear the sample in lambda_function.py, paste the code linked from the official documentation (“Create an AWS Lambda function” section) and click Deploy. That code is maintained by the community, not by Home Assistant.
  6. Under Configuration → Environment variables, add BASE_URL with your Home Assistant address, without a trailing slash. Save.
  7. Copy the function’s ARN, shown at the top.

Step 4: connect the skill to the function and to your account

Go back to the Alexa Developer Console and open your skill.

  1. Under SMART HOME, paste the ARN into Default endpoint and save.
  2. Under ACCOUNT LINKING, fill in (with your own address):
    • Authorization URI: https://ha.your-home.coiaca.app/auth/authorize
    • Access Token URI: https://ha.your-home.coiaca.app/auth/token
    • Client ID: https://pitangui.amazon.com/ in the US and Brazil, https://layla.amazon.com/ in Europe. The trailing slash matters.
    • Client Secret: any text; Home Assistant does not check it.
    • Your Authentication Scheme: Credentials in request body.
    • Scope: add smart_home.
    Leave the option to link from your own app or website off, and the other fields empty. Save.

Step 5: enable it in the Alexa app

  1. In the Alexa app, go to More → Skills & Games → Your Skills → Dev.
  2. Open your skill and tap Enable to use. Your Home Assistant login page opens: sign in with your user.
  3. Alexa looks for devices. If it doesn’t, say “Alexa, discover devices”.

Try “Alexa, turn on the living room light”. The skill stays in development mode, which is normal for personal use: only your account sees it.

Choosing what Alexa sees

By default, Alexa sees every supported device. To choose, add a filter to configuration.yaml and restart:

alexa:
  smart_home:
    locale: en-US
    filter:
      include_domains:
        - light
        - switch
        - climate
      exclude_entities:
        - switch.pool_pump
    entity_config:
      light.living_room_ceiling:
        name: "Living room light"

If something doesn’t work

  • Linking fails with no explanation: it’s almost always the Lambda region or a Client ID that doesn’t match your Alexa’s language.
  • Alexa finds nothing: check that BASE_URL has no trailing slash and that you restarted Home Assistant after adding alexa:.
  • An alarm doesn’t show up: Alexa can’t arm it by voice with a code. To disarm, it asks for a 4-digit PIN.

What about an integration without all this?

Connecting Alexa from your Coiaca panel, with no Amazon consoles or AWS, is on our roadmap. Meanwhile, this method is free and, once set up, works like any other Alexa smart home. If you get stuck on a step, email us at support@coiaca.com.

Discover Coiaca Cloud HA

Sources

Coiaca is not affiliated with Amazon, the Open Home Foundation or Nabu Casa. Alexa is a trademark of Amazon; Home Assistant is a trademark of its owners.

Leave a Reply

Your email address will not be published. Required fields are marked *