Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

No Devices Found #86

Open
psinide opened this issue Aug 15, 2017 · 21 comments
Open

No Devices Found #86

psinide opened this issue Aug 15, 2017 · 21 comments

Comments

@psinide
Copy link

psinide commented Aug 15, 2017

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)

@trisk
Copy link
Contributor

trisk commented Aug 15, 2017

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.

@psinide
Copy link
Author

psinide commented Aug 15, 2017

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...

@trisk
Copy link
Contributor

trisk commented Aug 15, 2017

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

@faspina
Copy link

faspina commented Aug 25, 2017

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

@faspina
Copy link

faspina commented Aug 25, 2017

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

@ghost
Copy link

ghost commented Sep 19, 2017

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.

@cooperaj
Copy link

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.

@tradel
Copy link

tradel commented Sep 29, 2017

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.

@cooperaj
Copy link

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...

@tradel
Copy link

tradel commented Sep 29, 2017

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.

@NorbertWasilewski
Copy link

NorbertWasilewski commented Sep 29, 2017

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.

@absk1s3
Copy link

absk1s3 commented Oct 4, 2017

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
Copy link

absk1s3 commented Oct 5, 2017

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

@cooperaj
Copy link

cooperaj commented Oct 5, 2017 via email

@absk1s3
Copy link

absk1s3 commented Oct 5, 2017 via email

@absk1s3
Copy link

absk1s3 commented Oct 5, 2017

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

@maddox
Copy link

maddox commented Oct 5, 2017

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.

@tradel
Copy link

tradel commented Oct 5, 2017 via email

@maddox
Copy link

maddox commented Oct 6, 2017

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?

@tradel
Copy link

tradel commented Oct 6, 2017 via email

@maddox
Copy link

maddox commented Oct 6, 2017

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants