Skip to content

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

beware that's prototyping ina very early stage ...

Alexa Custom Skill – Haushelfer

This Alexa Custom Skill connects Alexa to your Home Assistant instance, allowing you to control devices and request status updates in German.

Prerequisites

  • Amazon Developer Account for Alexa Skills Kit (ASK) development
  • AWS Lambda access
  • Home Assistant with the Conversation API enabled
  • Home Assistant Long-Lived Access Token for authentication

Installation

1. Create the Skill in the Alexa Developer Console

  1. Go to the Alexa Developer Console.
  2. Click "Create Skill".
  3. Enter a name (e.g., the homeassistant).
  4. Choose Custom as the skill type and AWS Lambda as the backend service (recommended).
  5. Upload the Interaction Model:
    • Navigate to Build → Interaction Model → JSON Editor.
    • Replace the content with the interaction_model.json file from this repository.
    • Click Save Model and then Build Model.

2. Set up the AWS Lambda Function

  1. Open the AWS Lambda Console.
  2. Create a new function (Python 3.9 or newer).
  3. When creating the Lambda function, assign it a Basic Execution Role so it can write logs to CloudWatch: AWSLambdaBasicExecutionRole
  4. Upload the contents of the lambda_function.py file.
  5. In Configuration → Environment Variables, set the variables listed below.
  6. Copy the ARN of your Lambda function.
  7. In the Alexa Developer Console → Endpoint: choose AWS Lambda ARN and paste the ARN.
  8. On the AWS Lambda console add enviroment variables as listed below

Environment Variables

Variable Description
HA_URL Base URL of your Home Assistant (e.g., https://my-ha-domain.com).
HA_TOKEN Long-Lived Access Token from Home Assistant (Profile → Long-Lived Access Tokens).
HA_LANG Language for the Home Assistant Conversation API (de for German, default: de).
HA_AGENT (Optional) Agent ID if multiple agents are configured in HA.
HA_HOME Greeting text when the skill is launched (default: Hausassistent).
HA_PROMPT (Optional) Additional prompt text for more precise responses from HA.

Usage

Once the skill is published or enabled in developer mode, you can interact with it using commands such as:

"Alexa, frage den Haushelfer"
"Status Klimaanlage"
"schalte die Kaffeemaschine aus"

Currently the interaction is done in German, but can be easily translated to en ...

Status

  • It's working against my HA installation, where it's using a chatgpt assistant client
  • I can ask to report the status of the exported sensors in differnet means and also actions are possible.

Drawbacks

  • interaction via Alexa developer console and alexa chat of the alexa app are working in ground functionality
  • interaction via speach need a good rythmus, which is mainly caused by the alexa frontend
  • one-shot actions are currently only working in the chats
  • to catch the requests the intent needs a starting word/clause since the simple alexa intent interaction only allows this

Debugging

  • Errors and debug output appear in the CloudWatch Logs of your Lambda function.
  • If Alexa reports that Home Assistant is not reachable:
    • Check HA_URL and HA_TOKEN.
    • Make sure your Home Assistant instance is accessible from AWS.

About

Custom alexa skill which connects to the HA conversation API

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages