Skip to content

Latest commit

 

History

History
131 lines (78 loc) · 7.91 KB

README.md

File metadata and controls

131 lines (78 loc) · 7.91 KB

Alexa Actionable notifications with Tailscale

release downloads build CodeQL Formatting & Linting

PayPal.Me MelleDennis

Buy Me A Coffee

Introduction

This integration was forked from the alexa-actions. Big thanks to this create project. I hope the open pull request will be merged at some point and the projects get married. In the meantime, I maintain the fork and some documentation in the README

I give no guarantee for the functionality and no promise of lifelong maintenance, as I do the whole thing in my free time. Of course, I am happy about every contribution and PullRequest ❤️

Please ⭐️ or sponsor this repo when you like it ❤️.

Also thanks to the amazing Tailscaleintegrations!

Installation

Getting started

See for some basic information the available [wiki] (https://github.com/keatontaylor/alexa-actions/wiki)

Step 1 Setup repository with AWS

Here are some steps you need to take. Since this guide is fairly new, please create a ticket or PR to resolve any confusion. The premise is that Tailscale Integration is installed in HA and the HA instance is available as a node.

  1. The Git repo must be forked so that the Docker image for the AWS Lambda can be pushed to your private repository in the Amazon Elastic Container Registry.
  2. Create a private repository on AWS Amazon Elastic Container Registry. The name must be ha-custom-lambda-tailscale for the repo

ecr-private

See for more information [AWS Introduction ECR] (https://aws.amazon.com/de/ecr/getting-started/)

  1. Create a keypair on AWS Identity Management (IM) to allow github action to push the Docker image to ECR. Create AWS_ACCESS_KEY_ID_ and AWS_SECRET_ACCESS_KEY

Zugriff Schlüssel

See for more information [AWS Introduction credentials] (https://docs.aws.amazon.com/de_de/keyspaces/latest/devguide/access.credentials.html#SigV4_credentials)

Remember both carefully because the secret is only displayed once and is required in the next step.

  1. Go to your forked repo under settings. Go to secrets and variables. Create two new secrets with AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY from the previous step

github secret

  1. Then build and push the Docker image under Github Actions. To do this, run .github/workflows/docker-build-push.yml

githubaction

Congratulations! This is the first step and the result should look like this. 🎊

Step 2 Create AWS Lamdba

  1. Create a new function. Select Container Image at the top

Add Lambda

See for more information [AWS Lambda] (https://docs.aws.amazon.com/de_de/lambda/latest/dg/getting-started.html)

  1. Name the function alexa-actionable-notifications-function and select the Docker image from the ECR and click create function

Select Container Lambda

Create Lambda

Overview Lambda

  1. Click "Add Trigger" and copy your skill id from the previous step from the Skill

Lambda Alexa Skill

Trigger

  1. Now we have to log in to our Tailscale account and create an ephemeral key. Go to settings --> key

Key

Key1

Please remember the key. You currently have to do this step every 3 months because the key can no longer be created.
  1. An HA long-living token (10 years) must then be created that Lambda can access to your HA-Instance, which is only available into your VPN. Please remember the key.

  2. Now the following ENV variables must be inserted into the function.

Key1

ENV Type Default Description
DEBUG boolean false Type of the card.
HA_TOKEN string The long living HA token
HA_URL string Important the TAILSCALE ip from HA e.g http://{tailscale-ha-ip}:8123. Should be start with 100.xxx.xxx.xxx TAILSCALE_AUTHKEY the ephemeral key. Should be start with tskey-auth-xxxxx
  1. Save function to deploy the function new

Now the Alexa skill can be tested and integrated into HA. These are the same steps like in the wiki

The only thing that changes in the Alexa Skill chapter in the editor is that you don't have to create a PY for the template. Actually always click Customize

Troubleshooting: I rarely get timeouts from tailscale. Ticket is open. That's why I increased the timeout to 10 seconds.

Troubleshooting

Danger ‼️

The ECR and the AWS Lambda can cost money. For this reason the image was kept small. But you need to have a lot of traffic and updates. With testing and everything, my most expensive month was 4 cents ❤️

Known limitations

  1. Cannot create a ephemeral key automatically
  2. I rarely get timeouts from tailscale. Ticket is open. That's why I increased the timeout to 10 seconds.