On the Amazon side. A 405 suggests that your HASS is being reached, but in the wrong way.
In you Amazon config, did you enter your HASS url like this:
https://xxx.duckdns.org/api/alexa?api_password=YOUR-ACTUAL-PASSWORD
On the Amazon side. A 405 suggests that your HASS is being reached, but in the wrong way.
In you Amazon config, did you enter your HASS url like this:
https://xxx.duckdns.org/api/alexa?api_password=YOUR-ACTUAL-PASSWORD
I can tell from that request that youâve got things wrong in the Amazon setup. And the fact that you had the wrong URL suggests that you didnât read through this carefully.
activate {purple_living}
would be a scene name if you did it correctly.
the rest is fine
intent is same
{
"intents": [
{
"intent": "ActivateSceneIntent",
"slots":
[
{
"name" : "Scene",
"type" : "Scenes"
}
]
}]
}
alexa code in configuration is same âŚ
alexa:
intents:
ActivateSceneIntent:
speech:
type: plaintext
text: OK
action:
service: scene.turn_on
data_template:
entity_id: scene.{{ Scene | replace(" ", "_") }}
scene
scene:
- name: Purple living
entities:
group.living_lights:
state: on
brightness: 254
rgb_color: [255,106,253]
If you had things set up correctly, the slots value in your service request would look like
"slots": {
"Scene": {
"name": "Scene",
"value": "test"
}
}
where âtestâ was what I got for using âactivate testâ in the utterance phrase in Amazonâs tester.
I think youâve got something wrong on the Amazon side, not in HASS.
mmhhh yes, now I put only PURPLE LIVING in the test, and is ok (it works purple_living, it does not work purple living).
Now the problem is Alexa is not activating:
âthe requested skill took too long to respondâ
An utterance is what youâd say to Alexa. Do you use underscores when you talk? Try:
activate purple living
Like I said, you need the utterance to be what youâd say. You donât just walk up and say âpurple livingâ. You say âactivate purple livingâ
The utterance test gives you a way to test from the browser without all the talking.
And youâve fixed your URL in the configuration?
And youâve tested that you can reach HASS from outside your home network? Youâve successfully triggered something from outside, like via a service call or IFTTT?
in configuration I have
http:
# Uncomment this to add a password (recommended!)
api_password: passw
ssl_certificate: /etc/letsencrypt/live/lastname.duckdns.org/fullchain.pem
ssl_key: /etc/letsencrypt/live/lastname.duckdns.org/privkey.pem
base_url: lastname.duckdns.org:8123
This actually makes me think youâve got something wrong in your HASS config. This looks like itâs reaching you since youâve got a service response.
You do have an alexa: block in your YAML, right? With no errors in the log?
Try replacing your âActivateSceneIntentâ with this:
ActivateSceneIntent:
speech:
type: plaintext
text: This is a test
And then utter âactivate sceneâ.
If that works, try:
ActivateSceneIntent:
speech:
type: plaintext
text: You asked me to activate {{Scene}}
#ALEXA
# Alexa Integration
#
alexa:
intents:
ActivateSceneIntent:
speech:
type: plaintext
text: This is a test
But if you utter âactivate kjsahdfkjasdhkajsâ you get a service response?
if I utter âactivate kjsahdfkjasdhkajsâ I have same result (the remote endpoint could not be called
If I utter âkjsahdfkjasdhkajsâ I get this
{
"session": {
"sessionId": "SessionId.2d229165-6e2b-48d5-88f3-52217fd04cfe",
"application": {
"applicationId": "amzn1.ask.skill.4f934f14-5033-4939-9020-985e9a86038f"
},
"attributes": {},
"user": {
"userId": "amzn1.ask.account.AExx`Preformatted text`Q"
},
"new": true
},
"request": {
"type": "IntentRequest",
"requestId": "EdwRequestId.846d1386-1d2d-4bd8-944c-9e5fb1f6bfff",
"locale": "en-US",
"timestamp": "2016-12-23T16:27:02Z",
"intent": {
"name": "ActivateSceneIntent",
"slots": {
"Scene": {
"name": "Scene"
}
}
}
},
"version": "1.0"
}
end response this (no action from Alexa device)
{
"version": "1.0",
"response": {
"outputSpeech": {
"type": "PlainText",
"text": "This is a test"
},
"shouldEndSession": true
},
"sessionAttributes": {}
}
in error log
16-12-23 17:24:32 homeassistant.components.http: Serving /api/alexa to 192.168.1.253 (auth: True)
16-12-23 17:24:32 aiohttp.server: Error handling request
Traceback (most recent call last):
File "/home/hass/.homeassistant/deps/aiohttp/web_server.py", line 61, in handle_request
resp = yield from self._handler(request)
File "/home/hass/.homeassistant/deps/aiohttp/web.py", line 249, in _handle
resp = yield from handler(request)
File "/usr/lib/python3.4/asyncio/coroutines.py", line 143, in coro
res = yield from res
File "/usr/lib/python3.4/asyncio/coroutines.py", line 143, in coro
res = yield from res
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/http/__init__.py", line 427, in handle
result = yield from result
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/alexa.py", line 136, in post
data = yield from request.json()
File "/home/hass/.homeassistant/deps/aiohttp/web_reqrep.py", line 384, 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)
in log I have also this
16-12-23 17:30:26 homeassistant.components.http: Serving /api/alexa to 72.21.217.169 (auth: True)
that IP is not mine âŚ
EDIT: itâs amazonws
Thatâs really weird.
So if you use âactivateâ in your utterance, you get an error.
Is that error log response from the one where you didnât use âactivateâ? Thatâd make sense - you can see that the request is sending the key âSceneâ without a value for it.
I still think youâve got an issue in your YAML, but Iâm at a loss.
I get an error if I use two words in âEnter Utteranceâ whatever the words
If I use one word in âEnter Utteranceâ it works (any words it doesnât matter) but no value is sent