I created HA Skill - a HomeAssisstant addon for allowing Alexa to talk to HA. It draws inspiration from the official setup guide. The main differences are
The HomeAssistant endpoint doesn’t need to be publicly accessible.
The addon sets up the Lambda function automatically
You don’t need to sign in to your HomeAssistant account to link the Alexa Skill
The basic setup steps and requirements are the same.
In your AWS account, go to the IAM console, go to IAM User and create a new user. When you create the user it will should you the access key and secret key. Use those in the addon.
I set everything up and in the alexa app it said skill configured succesfully, however in home assistant I have the following error:
Login attempt or request with invalid authentication from ec2-34-248-5-89.eu-west-1.compute.amazonaws.com(54.77.190.238). See the log for details.
Logger: homeassistant.components.http.ban
Source: components/http/ban.py:82
Integration: HTTP (documentation, issues)
First occurred: 16:32:33 (92 occurrences)
Last logged: 16:43:57
I am also a little confused, because in the link it eays eu-west-1 although in aws the region is us-east-1. Do I have to paste the value of AlexaEndpoint anywhere?
Did you use the Lambda that is created by this addon? The addon is setup in a way that the Lambda doesn’t talk directly to HomeAssistant so seeing auth failures for ec2-… makes me think you are using an old Lambda or otherwise didn’t use the auth endpoints created by the addon.
Yes i didn’t use the lambda that was created. I deleted everything and wanted to start over again. I created my user with the policy, the iam role and my skill. When i start the addon i get the following error:
023-07-04 20:34:11 INFO Starting up!
2023-07-04 20:34:12 INFO Creating CloudFormation stack neuerSkill
2023-07-04 20:34:12 INFO Waiting for stack neuerSkill to be created
Traceback (most recent call last):
File “/run.py”, line 136, in
handle_cloudformation_stack(session, options[‘CloudFormation Stack Name’], stack_params=stack_params)
File “/run.py”, line 45, in handle_cloudformation_stack
create_waiter.wait(StackName=stack_name)
File “/usr/lib/python3.11/site-packages/botocore/waiter.py”, line 55, in wait
Waiter.wait(self, **kwargs)
File “/usr/lib/python3.11/site-packages/botocore/waiter.py”, line 375, in wait
raise WaiterError(
botocore.exceptions.WaiterError: Waiter StackCreateComplete failed: Waiter encountered a terminal failure state: For expression “Stacks[].StackStatus” we matched expected path: “ROLLBACK_COMPLETE” at least once
I deleted the stacks and now I have everything set up. The skill was added successfully but I don’t have any devices in the Alexa app. I dont get any errors. I even tried giving one of my entities a custom name:
I also published a new version of the HA Skill addon (v1.0.4) that includes a debug option in the addon configuration. You can try enabling that to see if the addon logs show anything useful.
Somehow it now works. When i enter the code it returns my devices. However I still dont have them in my alexa app. Is it possible that it may take a while? I tried deactivating and reconfiguring my skill.
The empty response is expected. The addon is constantly polling for any requests. If there are no requests after 20 seconds, it’ll return an empty list.
Did you setup the Alexa skill in the same Amazon account that you use for your Alexa devices? That’s the only reason I can think of for the Lambda finding devices but them not showing up in Alexa.
I deleted everything and set up the addon and skill and everything in lambda. Same issue. The tests return the devices but alexa doesnt find any. Can I provide you with any more information for trouble shooting?
Unfortunately I’m not sure where else to look to debug this. If the Lambda is finding devices the addon logic is working. Best I can tell is there is something wrong with how you registered / setup the Alexa skill - either picking the wrong account, wrong region, or wrong Lambda function. Double check that the Lambda being used by the skill is the one the addon setup (arn is in the addon logs). And make sure you selected the correct region for the addon (if you are in the US then us-east-1).
When you ask Alexa to discover devices, does the Lambda get invoked (do you see logs)?
Sorry to burst your bubble and all of your hard work. Anything dealing with AWS is hard work.
The easiest way to use Alexa on Home Assistant is with the Home Assistant Cloud. All of the AWS stuff is taken care of for you.
If a cloud subscription is an issue (what do you think AWS is?), then just install the Node-RED add-on, and in Node-RED install “node-red-contrib-alexa-cakebaked” to the pallette. Done. I use a free (contributions appreciated) service provided by Ben Hardill to create most of my Alexa devices.
After installing a device in ESPHome, I can have Alexa controlling it in five minutes.