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

JSON config error #55

Open
Lothar1994 opened this issue Jun 4, 2017 · 4 comments
Open

JSON config error #55

Lothar1994 opened this issue Jun 4, 2017 · 4 comments

Comments

@Lothar1994
Copy link

Lothar1994 commented Jun 4, 2017

I'm currently getting an error when running the "Alexa Smart Home - Discovery" test using the amazon lamda function. My function is shown in my skills on the App and i have it enabled.

The log out put shows:
START RequestId: 5658d350-48bd-11e7-968a-cf0f4d9ff058 Version: $LATEST
[ERROR] 2017-06-04T00:32:49.897Z 5658d350-48bd-11e7-968a-cf0f4d9ff058 DiscoverAppliancesRequest failed
Traceback (most recent call last):
File "/var/task/haaska.py", line 113, in handle_discover_appliances
r['payload'] = {'discoveredAppliances': discover_appliances(ha)}
File "/var/task/haaska.py", line 164, in discover_appliances
states = ha.get('states')
File "/var/task/haaska.py", line 55, in get
return r.json()
File "/var/task/requests/models.py", line 886, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib64/python2.7/json/init.py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python2.7/json/decoder.py", line 382, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decodedEND RequestId: 5658d350-48bd-11e7-968a-cf0f4d9ff058
REPORT RequestId: 5658d350-48bd-11e7-968a-cf0f4d9ff058 Duration: 580.27 ms Billed Duration: 600 ms Memory Size: 128 MB Max Memory Used: 32 MB

Would anyone know whats causing this? I am using it in Australia could this be a possibility why it's not working? The only thing I've edited in the config file is the HA url (which I've set to my public ip address and port 8123) and the HA password - i know this is valid as I can access it via mobile and when changed the output log shows it cannot connect to the url.

Any help would be greatly appreciated!

@trisk
Copy link
Contributor

trisk commented Jun 4, 2017

The response is evidently malformed. Did you forget /api in the URL? Also try adding logging for r.text before the return to see what the response looks like.

@Lothar1994
Copy link
Author

yes you're right this was left out. But now I am getting i time out error:
{
"errorMessage": "2017-06-04T05:49:56.938Z a18e0b77-48e9-11e7-a01d-8d8b7c8884de Task timed out after 3.00 seconds"
}
Am I missing something in Home assistant?

@trisk
Copy link
Contributor

trisk commented Jun 4, 2017

You need to increase your Lambda function's execution time limit. Your server is not responding quickly enough.

@Lothar1994
Copy link
Author

A reboot of my server running home assistant seemed to do the trick.
Thank you!

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

2 participants