Alexa ask Sensor Data

I would like to ask Alexa what the tempeture from a sensor is. In the furter more sensors.
But the intent part on alexa, i can get it how it works. Have try a lot.

On this forum in found this:
alexa:
intents:
TemperatureIntent: “The temperature is {{ sensor.temperature.state }} degrees”

I would like to ask something like this: Alexa, what is the room temperture?

The sensor is: sensor.toontemp
What is the correct intent config for developer.amazon.com?

Thanks for the help! If i have it working, i post here my whole sensor config, to help others.

Thanks Remco

After a couple ours, i have this as intent:

Intent Schema
{
“intents”: [
{
“intent”: “TemperatureIntent”,
“slots”: []
}
]
}

Sample Utterances
TemperatureIntent What is the temperature
TemperatureIntent the temperature
TemperatureIntent what is the room

Home assistant config:
alexa:
intents:
TemperatureIntent:
speech:
type: plaintext
text: >
The temperature is {{ states.sensor.toon.state.split("\n")[0] }} degrees

As i test this skill on developer.amazon.com it works! :smiley: he give me the right answer and sensor date.
But now, why home assistant give me not the good answer if i ask?
He give me the inbuild weather information if i ask, what is the temperture.
Also if i ask: Alexa, ask home assistant what is the temperature?

someone have a idea?

This is what I use as the intent for “Alexa, ask Home Assistant for the temperature of .”

speech:
  type: plaintext
  text: >
    The {{ Room }} temperature is
    {{ states("sensor." + Room.replace(" ", "_") + "_temperature") }}
    degrees.

Or, for a more detailed sensor example that doesn’t have a variable input, here’s what I use for “Alexa, ask Home Assistant about the weather.”:

speech:
  type: plaintext
  text: >
    {%- set temp = states('sensor.dark_sky_temperature') | round -%}
    {%- set t_hi = states('sensor.dark_sky_daily_high_temperature') | round -%}
    {%- set t_low = states('sensor.dark_sky_daily_low_temperature') | round -%}
    {%- set feel = states('sensor.dark_sky_apparent_temperature') | round -%}
    {%- set humid = states('sensor.dark_sky_humidity') | round -%}
    {%- set now = states('sensor.dark_sky_summary') -%}
    {%- set hourly = states('sensor.dark_sky_hourly_summary') -%}
    {%- set daily = states('sensor.dark_sky_daily_summary') -%}
    Right now, it is {{ temp }} degrees out
    {%- if temp != feel -%}
    but it feels like {{ feel }} degrees
    {%- endif -%}.
    The current humidity is {{ humid }}%.
    Right now, conditions are {{ now }}.
    For today, {{ hourly }}.
    Today's high is {{ t_hi }} and the low is {{ t_low }}.
    The forecast calls for {{ daily }}.
2 Likes

Wauw thanks @smkelly, I will try it in the evening! Thanks you very much! I will let it now if i get it working

@smkelly Can you add also your config on Amazon as example for me? Thanks!

Yes, it it working now! For others how want to know it; Amazon Intent:

Invocation Name
the Room

Intent Schema

{
“intents”: [
{
“intent”: “RoomTemperature”,
“slots”: [
{
“name”: “Temperature”,
“type”: “state”
}
]
}
]
}

Custom slot Types
State
Tempeture

Sample Utterances
RoomTemperature What is the room {Temperature}
RoomTemperature what the {Temperature} is

Questions to Alexa
Alexa, Ask the room what the tempeture is.

Hello I am new to HA and Alexa. Just wondering how to set up all the configurations, I already have Alexa setup with HA, I have multiple sensors DTH22 and DS18B20, and would like to ask about different room temperatures and humidity. Thank you

Can you share your Amazon config also?