Haaska help please?

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?

As I understand it, haaska runs on amazon computers and only needs to access HA through its api. (needs to be SSL) You can get anyone to make the zip files for you with your url / password and then you can upload it.

Is it possible to run the make file on my mac. I get this error when I try that:

xx-MacBook-Air:~ xx$ /Users/xx/Downloads/haaska-master/haaska/Makefile ; exit;
/Users/xx/Downloads/haaska-master/haaska/Makefile: line 2: SHELL: command not found
/Users/xx/Downloads/haaska-master/haaska/Makefile: line 9: haaska.zip:: command not found
/Users/xx/Downloads/haaska-master/haaska/Makefile: line 10: BUILD_DIR: command not found
usage: mkdir [-pv] [-m mode] directory …
/Users/xx/Downloads/haaska-master/haaska/Makefile: line 11: BUILD_DIR: command not found
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file … target_directory
/Users/xx/Downloads/haaska-master/haaska/Makefile: line 12: BUILD_DIR: command not found
/Users/xx/Downloads/haaska-master/haaska/Makefile: line 12: pip: command not found
/Users/xx/Downloads/haaska-master/haaska/Makefile: line 13: BUILD_DIR: command not found
zip warning: name not matched: Library/Application Support/Google/Chrome/RunningChromeVersion
zip warning: name not matched: Library/Application Support/Google/Chrome/SingletonCookie
zip warning: name not matched: Library/Application Support/Google/Chrome/SingletonLock
zip warning: name not matched: Library/Containers/com.apple.accessibility.heard/Data/Documents/iChats
.
.
.