I’m also getting a Python error.
In the Amazon dev console, the Service Simulator is the first indicator of a problem.
In “Enter utterance” to test, I put in:
activate typical night
The Service Request spits out:
{
"session": {
"sessionId": "SessionId.32e606f1-6dcd-4553-81c4-33c3a3bc1ba4",
"application": {
"applicationId": "amzn1.ask.skill.454352a3-9a05-4e54-8182-6287d5364b90"
},
"attributes": {},
"user": {
"userId": "amzn1.ask.account.AHKWH7632FVDHHSXT343NQ7XKPZJEK4KLX35YRJN2SO46ZJ5HMXB27OM7FFKGCSRCET2QTW5QTNJTN2G43N575Z3OYSGE32POXQQPSQFDGCKULDCVUX5O3FSU6R6HV55NLIELDKFKJZRBN64RP6ZXIFX7Z2HUSGJ5XUD4IAZLDYEIFN5QXYWYHG33JE65CJTHNLD4M626WJTW6A"
},
"new": true
},
"request": {
"type": "IntentRequest",
"requestId": "EdwRequestId.4b5b1aef-cb65-4619-8440-99104e5be205",
"locale": "en-US",
"timestamp": "2016-12-30T07:00:49Z",
"intent": {
"name": "ActivateSceneIntent",
"slots": {
"Scene": {
"name": "Scene",
"value": "typical sleep"
}
}
}
},
"version": "1.0"
}
The Service Response says:
The remote endpoint could not be called, or the response it returned was invalid.
So I poked at it with curl:
curl -k -X POST https://REDACTED.dyndns.org/api/alexa?api_password=REDACTED
Interestingly, this gets a 500 error.
Server got itself in trouble
When this happens, the logs report a python error:
INFO:homeassistant.components.http:Serving /api/alexa to 50.46.133.153 (auth: True)
ERROR:aiohttp.web:Error handling request
Traceback (most recent call last):
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/aiohttp/server.py", line 261, in start
yield from self.handle_request(message, payload)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/aiohttp/web.py", line 88, in handle_request
resp = yield from handler(request)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/http.py", line 508, in handle
result = yield from result
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/alexa.py", line 136, in post
data = yield from request.json()
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/aiohttp/web_reqrep.py", line 321, in json
return loads(body)
File "/usr/lib/python3.4/json/__init__.py", line 318, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.4/json/decoder.py", line 343, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.4/json/decoder.py", line 361, in raw_decode
raise ValueError(errmsg("Expecting value", s, err.value)) from None
ValueError: Expecting value: line 1 column 1 (char 0)
Now, the non-API URLS work. The web interface works just fine. https://REDACTED.dyndns.org, which I believe proves that my router port forwarding is set up correctly.
I’ll take a closer look at the source code later to see why it’s dying there.