Ambiances in HA

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

what a pain in the xxx
What’s wrong now …

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.

ok, thanks, but same result …

I don’t get it … putting whatever this is the result (notice there is no value)

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