haaska icon indicating copy to clipboard operation
haaska copied to clipboard

No Devices Found

Open psinide opened this issue 7 years ago • 21 comments

Hi, I followed your instructions and setup the Lambda function and linked it with the Alexa skill. I am not able to discover devices through the Alexa app. When I run the test I found here:

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

}

I get the following error:

Traceback (most recent call last):
  File "/var/task/haaska.py", line 668, in event_handler
    ha, payload)
  File "/var/task/haaska.py", line 294, in invoke
    obj = make_class(allowed)(namespace, name, ha, context)
AttributeError: type object 'allowed' has no attribute 'Control'

Any suggestions? ( I checked one of the closed issues which had a similar problem, and their issue resolved once they changed the lambda server to n.virginia, my Lambda function is already on n.virginia)

psinide avatar Aug 15 '17 12:08 psinide

That's for an old API version, I'm not sure how people keep finding it? Please use the discovery test example from the list in the AWS Lambda console, or if you have the tools installed, just run make test.

trisk avatar Aug 15 '17 13:08 trisk

Thanks for the quick response. I used the preset discovery test in the AWS console and its populating with all my devices on HASS, but the Alexa app still can't discover any...

psinide avatar Aug 15 '17 15:08 psinide

Is the Lambda function getting executed? Problem could be the skill settings.

trisk avatar Aug 15 '17 17:08 trisk

I am having the same problem. The discovery test works from lambda , it returns all my devices, but discover in alexa does not

faspina avatar Aug 25 '17 19:08 faspina

I got it to wrk, not sure what I did, maybe rebuilt the skill, now its working

faspina avatar Aug 25 '17 19:08 faspina

Had the same problem, and after a lot of trial and error I found what caused my Alexa not to discover anything... an empty "friendly name" item. I just marked it as haaska_hidden and after that it works great again.

ghost avatar Sep 19 '17 16:09 ghost

Also seeing this error. Best I can tell it's all setup correctly. The test works (n.b. the old one that doesn't work is listed off the video you provide for instructions :P ) but alexa doesn't seem to want to even call the end point.

All my devices have friendly names.

cooperaj avatar Sep 27 '17 20:09 cooperaj

For anyone else having this problem, make sure your skill is configured to use payload version 2. v3 is the new default, but Haaska doesn't understand v3 yet.

tradel avatar Sep 29 '17 02:09 tradel

Not gonna be able to try this until I get home - but should it work, thanks :)

Now if only alexa would have told me it was unable to talk to the function...

cooperaj avatar Sep 29 '17 12:09 cooperaj

If you check the Cloudwatch logs for your lambda function, you'll probably see error messages like this:

'header': KeyError
Traceback (most recent call last):
File "/var/task/haaska.py", line 661, in event_handler
name = event['header']['name']
KeyError: 'header'

That's the indication that you've accidentally set up your skill for v3 instead of v2.

tradel avatar Sep 29 '17 13:09 tradel

I had same problem. Lambda function was working properly, but it wasn't called by Alexa API. It came out, that your Amazon account (not AWS) region does matter. If your account was created for US you need to use US datacenter (eu-east-1 im my case) region for lambda function. if you registered in Europe pick one of EU datacenters.

NorbertWasilewski avatar Sep 29 '17 14:09 NorbertWasilewski

I have a similar problem! But I have set my AWS datacenter to eu-west-1 (Ireland) and made sure my endpoint in developer.amazon.com points to the eu-west-1 and it still not working. I wonder if its a problem in the account linking with the information from login.amazon.com.

absk1s3 avatar Oct 04 '17 21:10 absk1s3

Sorry I meant I am having the same problem as NorbertWasilewski, tried his solution but still not working. Im based in UK

absk1s3 avatar Oct 05 '17 06:10 absk1s3

Mine started working after I selected the v2 payload as suggested by Todd On Thu, 5 Oct 2017 at 07:58, Abul Koyes [email protected] wrote:

Sorry I meant I am having the same problem as NorbertWasilewski, tried his solution but still not working. Im based in UK

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/auchter/haaska/issues/86#issuecomment-334376179, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYbUlaPiCRCBUJGiuSyEhk01aONxG6Cks5spH4IgaJpZM4O3i3O .

cooperaj avatar Oct 05 '17 10:10 cooperaj

Hmmm. The problem seems to be very unique to me as I have selected payload v2 (legacy). I followed everything, making sure that the datacenter is eu.

What authorization url are you using mine is:

https://www.amazon.com/ap/oa

And for access token uri:

https://api.amazon.com/auth/o2/token

I'll probably restart the whole process again from scratch and see if that works.

On 5 Oct 2017 12:00 pm, "Adam Cooper" [email protected] wrote:

Mine started working after I selected the v2 payload as suggested by Todd On Thu, 5 Oct 2017 at 07:58, Abul Koyes [email protected] wrote:

Sorry I meant I am having the same problem as NorbertWasilewski, tried his solution but still not working. Im based in UK

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/auchter/haaska/issues/86#issuecomment-334376179, or mute the thread <https://github.com/notifications/unsubscribe-auth/ AAYbUlaPiCRCBUJGiuSyEhk01aONxG6Cks5spH4IgaJpZM4O3i3O> .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/auchter/haaska/issues/86#issuecomment-334431881, or mute the thread https://github.com/notifications/unsubscribe-auth/AGyYB50Pl1cgNl6bPqNp0oMpcMdn4uF2ks5spLawgaJpZM4O3i3O .

absk1s3 avatar Oct 05 '17 12:10 absk1s3

I started again from scratch and it finally worked! guess I made a mistake somewhere in my previous setup. Thanks of your help @cooperaj

absk1s3 avatar Oct 05 '17 19:10 absk1s3

I've just had this die on me after working for months. I hadn't changed anything.

I checked the logs and it's throwing the same error:

'header': KeyError
Traceback (most recent call last):
File "/var/task/haaska.py", line 661, in event_handler
name = event['header']['name']
KeyError: 'header'

I checked the payload version and it was using v2. I even switched to v3 and back to v2 just to try to kick it.

maddox avatar Oct 05 '17 21:10 maddox

That error means the skill is receiving v3 format. Are you sure you switched back to v2?

On Thu, Oct 5, 2017 at 5:25 PM, Jon Maddox [email protected] wrote:

I've just had this die on me after working for months. I hadn't changed anything.

I checked the logs and it's throwing the same error:

'header': KeyError Traceback (most recent call last): File "/var/task/haaska.py", line 661, in event_handler name = event['header']['name'] KeyError: 'header'

I checked the payload version and it was using v2. I even switched to v3 and back to v2 just to try to kick it.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/auchter/haaska/issues/86#issuecomment-334596757, or mute the thread https://github.com/notifications/unsubscribe-auth/ABsTv9yfMpdyjMH6m6dblSOSS9HEG0Kyks5spUlkgaJpZM4O3i3O .

tradel avatar Oct 05 '17 22:10 tradel

It was originally already set to v2. I woke up this morning and everything was working fine. So something must have messed up on Amazon's side?

maddox avatar Oct 06 '17 16:10 maddox

I suspect something got borked when they were rolling out all the new Alexa API's this week, in conjunction with all the product launches.

On Fri, Oct 6, 2017 at 12:33 PM, Jon Maddox [email protected] wrote:

It was originally already set to v2. I woke up this morning and everything was working fine. So something must have messed up on Amazon's side?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/auchter/haaska/issues/86#issuecomment-334805781, or mute the thread https://github.com/notifications/unsubscribe-auth/ABsTv6gP81fkRg7nwh-f_mMvqlnr6OObks5splZDgaJpZM4O3i3O .

tradel avatar Oct 06 '17 17:10 tradel

I suspect something got borked when they were rolling out all the new Alexa API's this week, in conjunction with all the product launches.

My thoughts exactly.

maddox avatar Oct 06 '17 17:10 maddox