The Haaska Super Thread

Seems to indicate HA is failing the request from Haaska due to not being authorized. Take a look at your config.json in Haaska. Above is a post from me that points to yet another post in this thread that gives an example of what the config.json should look like.

I came across this thread…

Hi all… today I received this email from AWS:
SBJ: [Action Required] AWS Lambda end of support for Python 3.6
ello,

We are contacting you as we have identified that your AWS Account currently has one or more Lambda functions using Python 3.6 runtime.

We are ending support for Python 3.6 in AWS Lambda. This follows Python 3.6 End-Of-Life (EOL) reached on December 23, 2021 [1].

As described in the Lambda runtime support policy [2], end of support for language runtimes in Lambda happens in two stages. Starting July 18, 2022, Lambda will no longer apply security patches and other updates to the Python 3.6 runtime used by Lambda functions, and functions using Python 3.6 will no longer be eligible for technical support. In addition, you will no longer be able to create new Lambda functions using the Python 3.6 runtime. Starting August 17, 2022, you will no longer be able to update existing functions using the Python 3.6 runtime.

We recommend that you upgrade your existing Python 3.6 functions to Python 3.9 before August 17, 2022.

End of support does not impact function execution. Your functions will continue to run. However, they will be running on an unsupported runtime which is no longer maintained or patched by the AWS Lambda team.

The following command shows how to use the AWS CLI [3] to list all functions in a specific region using Python 3.6. To find all such functions in your account, repeat this command for each region:

aws lambda list-functions --function-version ALL --region us-east-1 --output text --query “Functions[?Runtime==‘python3.6’].FunctionArn”

If you have any concerns or require further assistance, please contact AWS Support [4].

[1] PEP 494 – Python 3.6 Release Schedule | peps.python.org
[2] Runtime support policy - AWS Lambda
[3] AWS Command Line Interface
[4] https://aws.amazon.com/support

is it something I’d be concerned to?
TIA

I got the same email and am hesitant to upgrade for fear it breaks everything, and I honestly struggled to get it to work in the first place and fear losing this functionality that I use quite often. Hopefully a braver and smarter soul than me can bring some clarity to this situation.

I tried to upgrade Python version from 3.6 to 3.9 editing runtime settings in AWS, under Haaska layers.
Saved, tried to “test” but it fails. Funny that my Alexa commands still work, I don’t know if they will stop working now or then, so I will wait for someone able to clarify too :slight_smile:

as explained below, there was an old domain in haaska config.json on AWS.

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

11 Likes

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.

1 Like

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.

1 Like

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