Problem with Alexa Intent

This worked for me using the Test feature on Amazon, but it does not work when I speak to my Echo Dot. It says there was a problem with the skill’s response and an error prints out from HomeAssistant stating that downtemp is undefined.

Any thoughts?

He, thanks a lot for input.

Got mine to work with:

  VolumeDenon:
    action:
      service: input_slider.select_value
      data_template:
        entity_id: input_slider.volume_setpoint      
        value: >
         {%-  set n = volume | int -%}
         {{ n }}

@nbroyer maybe you should remove the - in >- because i think you don’t like to set your temperature to minus degrees.

No problem, glad it worked for the both of you.

Nbroyer, what are you sending as a response? For something like this I would just have her response be “OK”, see my example:

SetDownstairsTemp:
  action:
    service: climate.set_temperature
    data_template:
      entity_id: climate.downstairs
      temperature: >-
        {% set n = downtemp|float %}
        {{ n }}
    speech:
      type: plaintext
      text: OK

Anything under the text attribute is what alexa says. I’m not sure if its needed but I always have her say ‘ok’.

I did try to simplify the response to just OK but still had the same problem. I also noticed I would get a similar problem using the Test feature occasionally. It seemed like there was a timeout issue. I just upgraded to 38.3 and it is working fine with my Echo Dot now, using the response “Okay, set downstairs temperature to {{downtemp}}”.

Thanks again for all your help!

Hi There, Would be really helpful if you are able to advise on your final script in the home assistant .yaml and what you ended up putting into the Amazon console in the intents/slots/utterance fields or a copy and paste of the json file I found in the beta interaction model tab in the amazon console, I’m really struggling to get this working. I can get echo to talk to HA and works in test but it wont actually report the temp back or change the temp. Many Thanks

It looks like some updates to HA have broken this for me. I’ve tried switching my intents: to intent_script: and my speech type from plaintext to plain, but I still get a Received Unknown Intent error. This is what I currently have, though, if it helps at all:

alexa:
  intent_script:
    BoilerTempIntent:
      speech:
        type: plain
        text: The wood boiler temperature is {{ states.sensor.wood_boiler_temp.state }} degrees
    MasterTempIntent:
      speech:
        type: plain
        text: The master temperature is {{ states.climate.master.attributes.current_temperature}} degrees
    DownTempIntent:
      speech:
        type: plain
        text: The downstairs temperature is {{ states.climate.downstairs.attributes.current_temperature}} degrees
    UpTempIntent:
      speech:
        type: plain
        text: The upstairs temperature is {{ states.climate.upstairs.attributes.current_temperature}} degrees
    SetDownstairsTemp:
      action:
        service: climate.set_temperature
        data_template:
          entity_id: climate.downstairs
          temperature: >
            {%- set n = downtemp|float -%}
            {{ n }}
      speech:
        type: plain
        text: Okay, set downstairs temperature to {{downtemp}}
    SetUpstairsTemp:
      action:
        service: climate.set_temperature
        data_template:
          entity_id: climate.upstairs
          temperature: >
            {%- set n = uptemp|float -%}
            {{ n }}
      speech:
        type: plain
        text: Okay, set upstairs temperature to {{uptemp}}
    SetMasterTemp:
      action:
        service: climate.set_temperature
        data_template:
          entity_id: climate.master
          temperature: >
            {%- set n = mastertemp|float -%}
            {{ n }}
      speech:
        type: plain
        text: Okay, set master temperature to {{mastertemp}}

Intents -
{
“intents”: [
{
“slots”: [],
“intent”: “BoilerTempIntent”
},
{
“slots”: [],
“intent”: “MasterTempIntent”
},
{
“slots”: [],
“intent”: “DownTempIntent”
},
{
“slots”: [],
“intent”: “UpTempIntent”
},
{
“slots”: [
{
“name”: “downtemp”,
“type”: “AMAZON.NUMBER”
}
],
“intent”: “SetDownstairsTemp”
},
{
“slots”: [
{
“name”: “uptemp”,
“type”: “AMAZON.NUMBER”
}
],
“intent”: “SetUpstairsTemp”
},
{
“slots”: [
{
“name”: “mastertemp”,
“type”: “AMAZON.NUMBER”
}
],
“intent”: “SetMasterTemp”
}
]
}

Utterances -

BoilerTempIntent What’s the boiler temp
BoilerTempIntent For the boiler temp

MasterTempIntent For the master temp

DownTempIntent For the downstairs temp

UpTempIntent For the upstairs temp

SetDownstairsTemp to set the downstairs temp to {downtemp}
SetUpstairsTemp to set the upstairs temp to {uptemp}
SetMasterTemp to set the master temp to {mastertemp}

That’s great thanks, gives me some more to try out, thanks for that.

No problem. Let me know if you get it working so I can try to fix mine, too. Thanks!

Hi, All working… that took a few hours and some!

This also helped;

I ended up using this script below in HA in !intent_script.yaml, I have different names for the intent (SetTemperature) and slot (temp), I also did use AMAZON.NUMBER in the slot type originally for my ‘temp’ (which worked) but changed it as I actually only want to select 15 to 25 degrees so created a custom slot type ‘temps’ and values 15 to 25 on each line. Its setting my zwave horstmann thermostat a treat. Also used a card but not worked that out yet.

 SetThermostat:
action:
  service: climate.set_temperature
  data_template:
    entity_id: climate.main_house
    temperature: '{{ temp | replace(" ", "_") }}'
speech:
  type: plain
  text: >
    Setting temperature to '{{ temp | replace(" ", "_") }}' degrees
card:
  type: simple
  title: Setting temperature to '{{ temp | replace(" ", "_") }}' degrees
  content: You have altered the house temperature of the entrance hall

And the Intent Schema in the Amazon Console was;

{
“intents”: [
{
“intent”: “AMAZON.CancelIntent”
},
{
“intent”: “AMAZON.HelpIntent”
},
{
“intent”: “AMAZON.StopIntent”
},
{
“slots”: [
{
“name”: “temp”,
“type”: “temps”
}
],
“intent”: “SetThermostat”
}
]
}

With utterances of;

SetThermostat set the main house temperature to {temp}
SetThermostat set the temperature to {temp}
SetThermostat set the house temperature to {temp}

Also have the temp being reported back under another skill at the moment but the intent HouseTemperature script for my sensor entity_id: sensor.main_thermostat_temperature was;

 HouseTemperature:
speech:
  type: plain
  text: >
    The main house temperature is {{ states.sensor.main_thermostat_temperature.state|round }} degrees

Intent Schema:

{
“intents”: [
{
“intent”: “HouseTemperature”
}
]
}

No Slots and Utterances as below;

HouseTemperature house temperature
HouseTemperature main house temperature

You will be well aware of all this info but I’ve listed it out for the benefit of anyone else who spends hours trying to work out how to get Alexa to change their climate entity setting from Alexa or have Alexa to report the status of a sensor! Ill be trying this to set other climate sensor states or entities set with values (media and so on at some point). I’m off to Bed!

Cheers

Glad you got it working! I finally got mine fixed, as well. My problem was that I had the intent_script line indented under alexa when it shouldn’t be.

I have a couple of intents that are not using slots that are working fine. However, I have one intent with one slot and Alexa gives me the message ‘This intent is not yet configured withing …’

The Amazon skill compiles and when I test it, it returns 'open' or 'close'.  

{
                    "name": "garage",
                    "slots": [
                        {
                            "name": "OpenClose",
                            "type": "AMAZON.SearchQuery"
                        }
                    ],
                    "samples": [
                        "to {OpenClose} the garage door",
                        "to {OpenClose} the garage",
                        "to {OpenClose} garage",
                        "to {OpenClose} sesame"
                    ]
                }

This is my intent:

 garage:
    speech:
      type: plaintext
      text:  >
        You asked me to {{OpenClose}} the garage

Any help would be appreciated.
Thanks!