That should work fine. I just updated my version. What was the error you got when you ran the test?
I managed to update my lambda to python 3.9 on AWS and it’s working for me
to update to python 3.9
head to aws.amazon.com
login
type lambda in searchbox
find your function i.e. haaska
click on the function
go to code tab
scroll down to runtime settings and press edit (right hand side)
select python3.9 save
done
If I run test, I get this error:
Task timed out after 3.01 seconds
This is the test code I’m running
{
"directive": {
"header": {
"namespace": "Alexa.Discovery",
"name": "Discover",
"payloadVersion": "3",
"messageId": "1bd5d003-31b9-476f-ad03-71d471922820"
},
"payload": {
"scope": {
"type": "BearerToken",
"token": "access-token-from-skill"
}
}
}
}
nevermind, my haaska setup on AWS was 2 years old and there was my old domain inside config.json, that’s why it failed… my fault!
test passed after swapped domain and generated a new token (just in case…)
I’ve recently upgraded to 3.9 and everything’s working as expected. It would be probably a good idea to update the step-by-step instructions on the Wiki to recommend 3.9 instead of the legacy 3.6.
Also for some reason after I’ve activated the new runtime I had to re-add the Alexa Smart Home trigger in AWS Lambda to make it working again.
I think this has happened because originally I had the version number included with the “Default endpoint” ARN which became invalid after the upgrade.
So if your skill stops working, check the AWS Lambda page whether your function still has the “Alexa Smart Home” trigger set up and also check the Developer Console whether your default endpoint is version-agnostic.
This worked for me, test came back with all devices after selecting Python 3.9 and Save
I did likewise…thanks!
However I noticed that in my case, I have a file named haaska.py
and the first line is:
#!/usr/bin/env python3.6
I don’t know if this line overrides the “Runtime setting” or not, so I simply
- changed this line to python3.9,
- file->save
- deploy (click on the button)
retested and it appears to still work.
Does haaska still work, these days? I followed the instructions and no luck. I will try to tweak it. but can someone tell me if new users can still successfully set this up?
@keneo yes it does work, through the interface on AWS has changed slightly since the instructions were written.
I just did it just about a week ago, the reason I went with Haaska is because port 443 is not available and thus cannot use the other method
So I managed to get Haaska up and running for the most part. It successfully links the account.
It found my HA automations as “scenes” in the alexa app.
It appears that all i have to do to invoke the automation is to set the “Power” of that “scene” to “on”
But when I try to “turn on” that scene, Alexa says “OK”, but the automation doesn’t execute and nothing happens.
This worked great for me. Had to update #!/usr/bin/env python3.6 to python3.9, but otherwise smooth update. Thank you.
Thanks for the tip. Although I am still hesitant to update it since everything still work fine. Just curious how long it will continue to work if leave it as is on 3.6?
According to AWS, at the time of writing there is no plan to dismiss 3.6 runtime for lambda. However, the AWS Lambda team will stop actively supporting it, thus it will not receive updates/security patches, etc.
I tried to exclude devices under cloud: and alexa: in my config but they still show up. I deleted all the devices in Alxea and did a new discovery search. Anyone got this working?
I try to install Haaska but the lambda test is not working
getting the error .
START RequestId: 71d56c6e-d305-408b-b40d-db2e2eac3bc9 Version: $LATEST
[DEBUG] 2022-06-14T16:30:30.444Z 71d56c6e-d305-408b-b40d-db2e2eac3bc9 calling alexa/smart_home with {'directive': {'header': {'namespace': 'Alexa.Discovery', 'name': 'Discover', 'payloadVersion': '3', 'messageId': '2501302-31b9-476f-ad03-71d471922820'}, 'payload': {'scope': {'type': 'BearerToken', 'token': 'token here'}}}}
[DEBUG] 2022-06-14T16:30:30.445Z 71d56c6e-d305-408b-b40d-db2e2eac3bc9 Starting new HTTPS connection (1): xxxxx.duckdns.org:8123
[ERROR] ConnectionError: HTTPSConnectionPool(host='xxxxx.duckdns.org', port=8123): Max retries exceeded with url: /api/alexa/smart_home (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f9393ac1970>: Failed to establish a new connection: [Errno 111] Connection refused'))
Traceback (most recent call last):
File "/var/task/haaska.py", line 111, in event_handler
return ha.post('alexa/smart_home', event, wait=True)
File "/var/task/haaska.py", line 63, in post
r = self.session.post(self.build_url(endpoint),
File "/var/task/requests/sessions.py", line 581, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/var/task/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/var/task/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/var/task/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)END RequestId: 71d56c6e-d305-408b-b40d-db2e2eac3bc9
REPORT RequestId: 71d56c6e-d305-408b-b40d-db2e2eac3bc9 Duration: 180.43 ms Billed Duration: 181 ms Memory Size: 128 MB Max Memory Used: 49 MB
Please help if you have any idea. TKS
Do a search “in this topic” for “Failed to establish a new connection” to see if there is anything that can help.
Tks
i could resolve it after setup right portforwarding in my router.
( i have a Technicolor 589vn-v3-router which not easy to understand how to setup portfordwarding)
Im super close to getting this setup I think… But running into a snag when I do the Lambada test.
My Home Assistant instance is running on a Pi4 on a network with a few docker containers hosted behind SWAG and using my own domain behind cloudflare. I have nothing blocking the subdomain except for logon creds and MFA for all users.
I was able to see the skill in the Alexa app but not able to login to it just yet because this Lambada test is failing I think. It wouldn’t let me post more than one pic in a post being a newb…
thoughts? Ideas? and THANK YOU!!
Hello I have the same error. HA is running as VM and hosted behind NPM and with my own domain behind cloudflare. I have this error since the last release.
When I call the domain with mydomain.com/api/ I get the following error (401: Unauthorized)
Thanks for the help
I ended up going with the trial for nabu casa and getting remote home assistant. Not sure I want to deal with a hacky solution when I want to get the wife and everyone else in the house on board to use HA. Best of luck!