mike-grant / haaska

Home Assistant Alexa Skill Adapter that supports v3 of the Alexa Smart Home Skill API
MIT License
540 stars 117 forks source link

Error with lambda #61

Closed jorgbad closed 6 years ago

jorgbad commented 6 years ago

When I test the lambda I get this error : Function Logs: START RequestId: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX Version: $LATEST 'header': KeyError Traceback (most recent call last): File "/var/task/haaska.py", line 660, in event_handler name = event['header']['name'] KeyError: 'header'

What can be happening ? Help please

anthonylavado commented 6 years ago

@sope123 - hey there! What does your config.json look like? Make sure to take out the real domain name and key, but tell me what you have filled in.

Also, what version of HA are you running?

dex9069 commented 6 years ago

Hi, i have the same problem, this is how my config.json looks like: { "url": "https://XXXXX.duckdns.org/api", "bearer_token": "my_token_from_HA", "debug": true, "ssl_verify": true, "ssl_client": [], "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 }

I'm running HA 0.81.5

anthonylavado commented 6 years ago

@dex9069 - Hi there! That’s what the config would look like in the older version of Haaska, which no longer works.

Until I can finish updating the instructions on the Wiki, I’ve linked a blog post on the front page, the reader, that has install steps.

Here it is: http://collingwood.me.uk/blog/index.php/hass-io-and-alexa/

It should help with an example of how things are configured.

To choose what can be controlled by Alexa, see the official HA page here: https://www.home-assistant.io/components/alexa/#smart-home

If you want everything to be controlled, just add Alexa / Smart Home piece, don’t add anything else.

Let me know if I can help with anything else :smile:

anthonylavado commented 6 years ago

@dex9069 - In other words, your config.json should look like this:

{
"url": "https://XXXXX.duckdns.org/api",
"bearer_token": "my_token_from_HA",
"debug": false,
"ssl_verify": true,
"ssl_client": []
}

It’s up to you if debug is true or false, I’ve always had it as false on my setup. No need to see the extra messages.

dex9069 commented 6 years ago

thanks for the reply, I've already used those instructions. I've updated the config.json like your example, rebuilt the zip file and re-uploaded but unfortunately I have the same error

anthonylavado commented 6 years ago

@dex9069 - Figured it out. You’re using the older version of Haaska from Auchter/Haaska. You need to use this latest version from here.

An easy way to tell is if you open Haaska.py, and it mentions Python 2.7 instead of Python 3.6.

You can download our copy directly from here: https://github.com/mike-grant/haaska/archive/master.zip

dex9069 commented 6 years ago

You're right,I'm feeling so dumb now.... Thank you very much for your patience!

jorgbad commented 6 years ago

I had made the same mistake, now the result is ok, but the skill still doesn't discover devices, i'll continue seeking the problem

jorgbad commented 6 years ago

I can now confirm this works, I had the wrong server for my country in lambda

anthonylavado commented 6 years ago

Thanks for the update!