Some fun with Alexa on a Friday afternoon

Hope someone can help with this.

When i try to add in the custom replies for alexa i get this in my error log for the alexa_confirm.yaml file:

16-12-07 19:42:30 homeassistant.util.yaml: expected '<document start>', but found '{' in "/home/hass/.homeassistant/alexa_confirm.yaml", line 2, column 1

i literally copied the text from above or the same from the Docs.

Any help would be appreciated

You included the greater-than? And be sure to indent everything after it.

1 Like

@ih8gates Thanks so much… it was the indention. I am still getting used to positional dependent configuration files.

With YAML, whenever you’ve got something that seems like a child of something else, you generally indent. That particular thing you ran into is tricky because the > would typically follow “text:”, but with it in a separate file, you can lose the plot a bit.

@ih8gates Just rename your kids. Simple fix.

1 Like

@ih8gates yeah because it was in a different file i didnt think it actually mattered. Good to know, thanks for the tip.

Hi Andrew

I am trying to change Alexa to respond to a different command/phase rather than just “ok”. I have setup HA using Emulated Hue Bridge. Would the “alexa_confirm.yaml” work? Can you please help?

Thanks.

Hi -

No, they are two completely different systems. You can use them together but you only get to customize actions and responses when you use intents. The emulated hue component is all hardwired in Alexa.

Hi

Thanks for the reply.

So if I wanted to setup Alexa to respond with a different command than “ok” what system would I have to use and how can I set it up?

Thanks.

You need to use the intents system as described in my original post. The only downside is it is an Alexa skill so you need a keyword (of your choice) to activate it, e.g. “home assistant”. You control the keyword and all the words after that but you have to add them all individually. So you would say something like:

Alexa, tell home assistant to open the garage door

Rather than

Alexa turn the garage door on

As you would with emulated hue.

The main docs for the intents setup are here.

Hi @aimc

I have setup everything but whenever I ask Alexa to activate something it says it couldnt find the device in my account. I was able to switch on and off my kitchen strip lights before with the emulated hue but now I cant. Also the kitchen strip lights are setup using MQTT as a switch.

Do you know what could be the problem? I have used your scenes code and set it up exactly how you described.

Thanks.

SOunds like you aren;t using the keyword correctly. You have to say something like:

“Alexa tell home assistant to turn on the kitchen linght”

Where “home assistant” is the keyword you added in the Alexa setup on Amazon;'s website.

I am using the keyword home assistant which I set up on Amazon’s website but it tells me it cant find the device in my account.

My configuration.yaml is:

alexa:
intents:
ActivateSceneIntent:
action:
service: scene.turn_on
data_template:
entity_id: scene.{{ Scene | replace(" ", “_”) }}
speech:
type: plaintext
text: >
There you go.

Sounds like your Amazon setup is incomplete - go back and check the steps in the docs I linked above. There are some steps to actually activate the skill in your Alexa app once you have created it.

Just as an aside; “Home Assistant” may be hard for Alexa to understand or parse depending on your pronunciation, location of the device (near a wall, in a room with reverb, etc.). When I set mine up, I used a simple invocation keyword that was easy to say. Something to consider.

Right so the intent schema that you provided game me errors so I used this :

{
“intents”: [
{
“intent”: “ActivateSceneIntent”,
“slots”: [
{
“name”: “Scene”,
“type”: “Scenes”
}]
}

]
}

Custom Slot types is :
Kitchen Lights On

And Sample Utterances is :
ActivateSceneIntent activate {Scene}

Thanks for pointing that out !

No problem. It wasn’t something I thought of at first but it did make a difference.

BTW, when you are posting code, it’s a good idea to use the preformatted text option to preserve your formatting. It makes it a lot easier to read and for other to see if there is a formatting error at the root of your issue.

In the forum editor, select your code block and press the button indicated in the image below:

Sure

I am using the AWS Lambda Proxy Alexa Custom Skill as I cannot set up SSL with my HA for some reason. When I try to go to the URL to call for each applicaitonID (http://IPADDRESS:8123/api/alexa?api_password=XXXX) it says 405: Method Not Allowed. Could that be a problem?

I have activated the skill in my Alexa app and can see it under “your skills”

Also under Lambda when I test my function using “Hello World” it gives me the following error:

    {
  "errorMessage": "Unexpected token ILLEGAL",
  "errorType": "SyntaxError",
  "stackTrace": [
    "Object.Module._extensions..js (module.js:416:10)",
    "Module.load (module.js:343:32)",
    "Function.Module._load (module.js:300:12)",
    "Module.require (module.js:353:17)",
    "require (internal/module.js:12:17)"
  ]
}

I am getting this error now: “errorMessage”: "Exception: TypeError: Cannot read property ‘application’ of undefined”

Can you please help?