Haaska help please?

Hi,

I am trying to set up haaska after the unfortunate news that I’m unable to use Home Assistant Cloud at the moment (wrong location), and (unless my circumstances change) unable to afford to subscribe from March next year.

I have followed some updated instructions (https://pastebin.com/aucq7sDY) and now have a reasonably good idea about how all the components of the set up connect together.

I have set up my Skill, my lambda instance, and my security profile/”log in with Amazon” settings and I have had quite a bit of success. My lambda returns a successful looking message when I run it - "Execution result: succeeded” and the code beneath it shows all my devices. Further, once my skill is published, I can go into the Alexa app and connect my account.

Therefore, I think I have set up the lambda correctly and the Login with Amazon correctly. Unfortunately, I do not discover any devices when I “Discover devices” on my Alexa app. So, it seems to me that it’s a problem between the Skill and the Lambda instance.

My Alexa skill is correctly listed in the Lambda configuration, and it’s enabled with the slider/switch.

Within the skill, it’s set to Interaction Model - "Smart Home Skill API” and under the configuration I have the lambda referenced as Default endpoint, and also the Europe option. ( arn:aws:lambda:eu-west-1:660030XXXXXX:function:haaska ). The Skill language is set to English (U.K.).

Unfortunately, it doesn’t work. The only thing I can think of is that this might be because the payload for the skill is set to v3. Various threads indicate this should be set to v2. V2 is no longer selectable as it’s been deprecated. Can anyone help with fixing this issue?

Happy to provide logs if you can tell me what I need to provide!

Cheers,

James

Reading a bit about payloads in the Alexa skill, it appears there were indeed some quite big changes going from v2 to v3, so unless Haaska has been updated we may no longer be able to set this up. Does anyone know?

@bruhautomation @auchter ? :slight_smile:

Cheers,

James

Managed to force this to be saved as a v2 skill by following advice from the Haaska github page.
https://github.com/auchter/haaska/issues/102

1 Like

Got to say, that’s a ingenious workaround :joy:

I have tried it but still not discovering any devices.

Does your lambda work OK?
Naviagate to your lambda, and in the top right corner there should be a drop down of test events. If you don’t have any events, add this one:

{
  "header": {
    "payloadVersion": "3",
    "namespace": "Alexa.ConnectedHome.Discovery",
    "name": "DiscoverAppliancesRequest"
  },
  "payload": {
    "accessToken": "1"
  }
}

Create this test event and see if it is succesful when you run it from your lambda page.

thanks. but the result is failed. it says “Task timed out after 7.01 seconds”

I just setup haaska with a new zip file because I wanted to add medial.player. I remember previously that the order of the components in the config.json affect how it was discovered. It might be the issue if you changed or re-ordered this. Yesterday, I only changed the url and password at first.

{
  "url": "http://localhost:8123/api",
  "password": "",
  "ssl_verify": false,
  "expose_by_default": true,
  "exposed_domains": [
    "alert",
    "automation",
    "climate",
    "cover",
    "fan",
    "group",
    "input_boolean",
    "input_slider",
    "light",
    "lock",
    "media_player",
    "scene",
    "script",
    "switch"
  ],
  "entity_suffixes": {
    "alert": "",
    "automation": "",
    "climate": "",
    "cover": "",
    "fan": "",
    "group": "Group",
    "input_boolean": "",
    "input_slider": "",
    "light": "",
    "lock": "",
    "media_player": "",
    "scene": "Scene",
    "script": "",
    "switch": ""
  },
  "debug": false
}

OK, then I would suggest that’s the first thing that’s wrong.

How confident are you that you made the haaska.zip OK?

You edited config.json.sample and renamed it to config.json and then edited it to include your duckdns address (and port 8123) and your API password?

You should have a file called “config.json” in your config folder that looks like this:


Except URL and password should be filled out with your specific details. Can you connect to your HA instance via your external (duckdns) URL and port through a web browser??

So they have to be in alphabetical order? :slight_smile: I didn’t change mine, but what can you do with media.player? Just turn them on or off?

My URL is fine. I’m using Let’s Encrypt SSL and port forward 443 to 8123. I can access my the frontend using https://[mydomain]/states when I am outside.

Great. And you have put that (along with pasword) in to the config.json file before you created the zip using “make”? In which case, a few settings you should check within the lambda:

  • The lambda is called “haaska”.
  • You have Alexa smart home as a trigger, and amazon cloudwatch logs as a resource.
  • Run time is python 3.6 and Handler is haaska.event_handler
  • You’ve uploaded your haaska.zip for the code and you can see it as haaska.py in the lambda page.
  • execution role is “Choose an existing role”! and then “lambda_basic_execution”.

Everything else shouldn’t really be touched.

Actually, I could only get on and off to work so I put this one in yesterday. Just need them to make a remote component for it.

btw, I used python 3.6 up from 2.7 previously in the lambda function.

I ran “make test” from the same directory as “make” right after I uploaded the zip files and got this

{
  "payload": {
    "isHealthy": true
  },
  "header": {
    "namespace": "Alexa.ConnectedHome.System",
    "messageId": "a63changed1b1d2",
    "name": "HealthCheckResponse",
    "payloadVersion": "2"
  }

}

Guess what, no more errors after I change the timeout value to 20 seconds under “Basic Settings”. I can see my devices in json under details. However, they are still not discover in the Alexa app.

These are what I have in my developer console…

Security Profile

Haaska Smart Home Skill

haaska Lambda function

1 Like

Have got been able to sign into the Haaska Skill on your phones Alexa app? If so, that means the security settings are ok…

In the mean time I’ll review the settings for connecting to the lambda.

If you click the smart home skill under the lambda, is it enabled and/or set up correctly?

yes it is enabled and using the application ID from the skill ID.

Good news! I recreated the skill and it was a success! I can see all the devices I wanted to expose. However, I notice that all the device type is still specified as “Light”.

Is it possible to use this with Hassio? Where should I look for ca-certificates.crt and how can I make the zip as I cannot sudo with Hassio?