I created a generic Alexa intent “TurnOnIntent” which takes a device name slot. The device name slot, in the Amazon configuration, has a few valid values that have IDs associated with them. For example:
Living Room Lights ID: LIVINGROOMLIGHTS Synonym: Lights in the living room.
I expected that if I say “Turn on Living Room Lights” or “Turn on lights in the living room” i was expecting the slot value passed to HASS to be LIVINGROOMLIGHTS, instead I am getting the value that was said (which means my configuration in HASS needs to check for all the synonyms).
Am I doing something wrong or is this jus the way it is?
…you can also create synonyms for slot type values, which can be used in place of the base value in utterances. Synonyms will be replaced with their associated slot value in the intent request sent to the Alexa API endpoint, but only if there are not multiple synonym matches.
So ID is not the same as slot value - your intent config in HA needs to check for the slot value.
Yea, but what I am actually seeing is that when I reference {{ slotName }} in my intent configuration it is the words uttered not the slot value OR ID. I even see this from Amazon’s testing tool.
When I test for “turn on lights in living room” (lights in living room is a synonym for living room lights with ID LIVINGROOMLIGHTS) - the JSON sent in the Amazon test tool is:
Made me test on my device, and on my device it seems to map to the value properly. How can I reference the ID in my config? {{ devicename }} seems to map to the value.
Interesting regarding the testing… According to the HA docs you need to use the slot value in your config, not the ID. The ID is optional anyway and so the HA support for synonyms was designed to work only with the slot value.
HA config supports just the value, however when testing with Amazon’s mock testing tool (at least for me) the value = uttered words but on the device value=value.