Skip to content

StefanOltmann/smart-home-alexaskill

Repository files navigation

Stefans Smart Home Alexa Skill

CI Quality Gate Status Coverage License: GPL v3

Prerequisites

You need a running instance of my smart home server that is public available via HTTPS.

This would look like https://home.mydomain.com:50000/ for example.

Packaging the application

The application can be packaged using:

./gradlew build

This will create a file named smart-home-alexaskill-XY.jar in build\libs.

Deploying the skill

Alexa Smart Home skills always run as AWS Lambda and unfortunately take quite some steps to setup.

You can follow these instructions from the official Java sample for the skill and leave out step 7 as we need no database.

After you ran through these steps you should have an AWS Lambda function named SmartHomeFunction that can be managed here: https://eu-west-1.console.aws.amazon.com/lambda/home?region=eu-west-1#/functions/SmartHomeFunction .

Proceed with these steps to configure the skill:

  1. Click to the Code tab.
  2. Upload the smart-home-alexaskill-XY.jar in the Code source panel.
  3. Click Edit on the Runtime settings panel.
  4. Change the runtime to Java 11 (Corretto).
  5. Set the Handler in the Runtime settings to de.stefan_oltmann.smarthome.alexaskill.AlexaHandler::handleRequest.
  6. Click on Save.
  7. Click on the Configuration and select Environment variables on the left side.
  8. Add key API_URL and set it to https://home.mydomain.com:50000/. Replace home.mydomain.com with your actual domain name.
  9. Add key AUTH_CODE and set it to your security token. This is the content of auth_code.txt you got by setting up the server.
  10. Go to https://alexa.amazon.com and discover your devices again.

If Alexa lists all your devices as expected you can start using them.