Discovering Devices with Alexa and Haaska

Ok, this is a long one:

I recently attempted to setup Haaska with Home Assistant. I’ve been able to enable the skill I created in Alexa. I’ve been able to test the lambda script and receive all my devices in the response. To do that, I used the test button after uploading the python script to lambda. The code I used to execute the test is:

{
    "header": {
        "payloadVersion": "1",
        "namespace": "Control",
        "name": "DiscoverAppliancesRequest"
    },
    "payload": {
        "accessToken": "whatever"
    }
}

I get an immediate response that contains all my devices from Home Assistant in the test response. My problem stems from the ‘Discover devices’ button in Alexa. With everything linked together (not sure if the link is correct), I should be receiving devices after pressing the button. Here is a quick look at my settings in Amazon Developer and Amazon Client:

Developer Console:

Endpoint                     | <ARN>
Authorization URL            | https://www.amazon.com/ap/oa
Client ID                    | <Client ID>
Domain                       | <empty>
Scope                        | profile
Redirect URLs                | <url1> 
                             | <url2> (not sure why i got 2)
Authorization Grant Type     | Auth Code Grant
Access Token URI             | https://api.amazon.com/auth/o2/token
Client Secret                | <Secret>
Client Authentication Scheme | Credentials in request body
Privacy Policy URL           | <PrivacyURL>

Amazon Seller Info:

Name                       | Haaska
Description                | Haaska
Privacy Notice URL         | I put my HA url here?
Logo Image                 | <HA logo>
Client ID                  | <Client ID>
Client Secret              | <Secret>
Allowed JavaScript Origins | <Empty>
Allowed Return URLs        | <url1>
                           | <url2>

So to me, this all looks correct. I’m not sure why it isn’t working.

I have a few questions regarding the ARN number. At the end of the ARN number is the word function and the name of the function. Should that be included for Endpoint?

I’m at a loss. Does anyone know what the problem could be?

So, I am an idiot. Don’t be like me. The solution to my problem is simple. On the aws.amazon.com, In lambda->functions on the trigger tab, I needed to enable the trigger. I guess by default the triggers are disabled after you create them. It only took me ~3 hours to notice…

I am in the same situation, have been trying for several hours.

From the make test command I get:

$ make test
{
  "header": {
    "payloadVersion": "2",
    "namespace": "Alexa.ConnectedHome.System",
    "name": "HealthCheckResponse",
    "messageId": "ec4a86ec-b4fc-46ce-ba49-481ee9064081"
  },
  "payload": {
    "isHealthy": true
  }
}
true

And running the test in Lambda I can see all my devices being discovered.

Trying this with EU west 1. Not sure how else I can debug this.

On what country/region is your Amazon Developer account set (https://developer.amazon.com/settings/profile/detail.html) and on what region (North America/Europe) is your Lambda function set? If your developer country is any other then UK or Germany, your Lambda function needs to be setup on North America (US East Ohio).

1 Like

Ah, okay, this may be the problem. My profile on the Developer account is set to Spain where I am based. My echo is setup with UK locale though.

I will change my developer account settings and try again. Thanks for the suggestion!

Still no luck.

It is very frustrating as from the lambda console test function I can see all my HA devices and and from the make test I get success.

The lambda function is setup on eu-west-1 and my developer settings are now UK.

The only thing I can think is that the function is not being triggered by the skill.

Completely at a loss and will have to revert back to emulated hue.

Just to be sure, you should try to setup a copy of the Lambda function on us-east

I recently upgraded and found this to work.

Hi skptic, had same trouble but got it sorted with this