I’m trying to set up a custom intent so that I can use assist to set the temperature of an area. The areas have generic thermostats in them.
I have a custom_sentences/en/climate.yaml:
language: "en"
intents:
SetTemperature:
data:
- sentences:
- "(set|change) {area} temperature to {temperature} [degrees]"
- "(set|change) [the] temperature to [the] {area} to {temperature} [degrees]"
lists:
area:
values:
- in: "Family Room"
out: "family_room"
- in: "Main Office"
out: "main_office"
Inside my configuration.yaml I have:
intent_script:
SetTemperature:
action:
- service: "climate.set_temperature"
data:
temperature: "{{temperature}}"
target:
area_id: "{{area}}"
speech:
text: "Temperature of the {{area}} has been set to {{temperature}} degrees."
It is my understanding that in the custom sentences config, if area equals “Family Room”, it will replace it with “family_room”, which is the ID of my family room area. The same goes for if area equals “Main Office”.
The variables are successfully being passed to the intent_script: in configuration.yaml. However, it’s not quite working as intended. First, it’s not setting the temperature of the thermostat in that area. Second, the response text is coming back wrong.
Say I were to put in: “Set the Family Room temperature to 70 degrees”
I get the response: “Temperature of the Family Room has been set to 70 degrees.”
This tells me that the data is successfully being handed off. Both variables are getting handed off, but it’s not converting “Family Room” to “family_room” before they do (I know it doesn’t make sense to have the unfriendly area_id in the response, and I realized that after doing this. But it did help me see what was going on here.) Since it’s not converting the value to what the intent_script: is looking for (family_room), that explains why it’s not working.
For testing, I hard coded “family_room” for the area_id under intent_script and tried again. This time it did successfully set the temperature of the generic thermostat in the Family Room area. Of course, with this setup it’s going to set the temperature of the Family Room and only the Family Room no matter what I say, but it helped me confirm that it does work. I just need to figure out why it’s not converting. What am I misunderstanding here?