Haaska and Alexa Error


I have been pulling my hair out for a couple of days using several sources to install and configure haaska. I am up to the testing part in lambda and receive the error below.

START RequestId: f4699d74-d2d1-11e8-8a95-63dc489c0c83 Version: $LATEST
401 Client Error: Unauthorized for url: https://morayfield.duckdns.org/api/alexa/smart_home: HTTPError
Traceback (most recent call last):
  File "/var/task/haaska.py", line 109, in event_handler
    return ha.post('alexa/smart_home', event, wait=True).json()

my configuration.yaml is below

        - light.kitchen_light
        - switch
        - light

Any ideas??

Assuming that Haaska is attempting to connect to your HA and its authorization has failed…

May depend on the version of Haaska you’re using. A recent change was made
to use Long Lived Token instead of the legacy api_password, but the documentation
has not yet been changed to reflect this.

I noticed that. where do I get the long lived token from?

Ok. I found out how to setup a long lived token https://XXXX.duckdns.org:8123/profile

now the test script in lambda is working but when I try to add the skill to my alexa app i receive the error below.

The authorization server returned an error parameter. Please refer to https://tools.ietf.org/html/rfc6749#section- for more details

Ok i have it working!! I went back and reread some more instructions and seen this part.

To use the current version of Login with Amazon, you must go to the [Developer Console](https://developer.amazon.com/)

* Under "Apps & Services", select "Login with Amazon" (not "Security Profiles")
* Click "Create a New Security Profile"
* You can enter anything for the name (which is shown on the login page) and the privacy URL

I was using the security profile instructions from finity…

Well when i say working I mean that the test function works and I can add the skill to the Alexa app. When I ask it to turn on kitchen light it responds with sorry I didnt find a device called kitchen light.

is the below all I need for con config file?

        - light.kitchen_light
        - switch
        - light

Only thing I can see in my logs is

2018-10-19 14:00:36 INFO (MainThread) [homeassistant.components.http.view] Serving /auth/token to (auth: False)

2018-10-19 14:00:36 INFO (MainThread) [homeassistant.components.http.view] Serving /api/ to (auth: True)

I am also seeing the below in my logbook


Amazon Alexa send command Alexa.Discovery/Discover


Amazon Alexa send command Alexa.Discovery/Discover

I’m getting those as well. I’d like to get rid of the Logbook entries for Alexa realted commands and status updates. Anyone know how to do that?

can you discover devices though?

Yes, Mine is working fine. I’m just seeing entries in logbook for the discovery as well as every alexa command. Sorry to hijack the thread, was really just looking for how to exclude the alexa entries from logbook.

all good mate, are you using the new https://github.com/mike-grant/haaska versions?

I switch to the cloud and it works… Must be something simple,. Is there a way to watch what is happening in logs?

FINALLY I have it working!! I was going through some github issues and I found this post below. It matters which region you are from. (full post link https://github.com/mike-grant/haaska/issues/35)

### **[anthonylavado](https://github.com/anthonylavado)**  commented [on 2 Aug](https://github.com/mike-grant/haaska/issues/35#issuecomment-409708054) • 


[@rchl](https://github.com/rchl) - So I've figured it out. It's not documented  *anywhere*  by Amazon, but the breakdown is this:

**EU (Ireland)**

* English (UK)
* English (IN)
* German
* French (FR)

**US West (Oregon)**

* Japanese
* English (AU)

**N. Virginia**

* English (US)
* English (CA)
* Rest of World / International Version

i work on hasska app last month all ok, yesterday i can’y associate the skill with my alexa’s account… lok for the test dont work… ok i try to do all from begin…
but the test dont give ok… it say :

“errorMessage”: “404 Client Error: Not Found for url: https://XXXXXXXXXX:8123/api/alexa/smart_home”,
“errorType”: “HTTPError”,
“stackTrace”: [
“return ha.post(‘alexa/smart_home’, event, wait=True)”
“raise HTTPError(http_error_msg, response=self)”
please give me some way to chek…

I have the same issue, Did you manage to find a fix? if so could you share it?