Using ResponseString in this skill for Intents #184
Replies: 2 comments 1 reply
-
Added to docs: https://github.com/keatontaylor/alexa-actions/wiki/Initial-Home-Assistant-Configuration |
Beta Was this translation helpful? Give feedback.
-
I love your idea to move "intents" into home assistant. I would be interested to learn more in how you create these "intent-template", please! I am trying to create a chatgpt dialog through Alexa and Home-Assistent, also enabling chatGPT to be provided with specific days out of home assistant on request ( tell me the pool temperature), or to be able to control HA im request, by sending back a JSON to be consumed by a node-red to trigger a service. My current state is outlined here. How to your intents work? |
Beta Was this translation helpful? Give feedback.
-
First, thanks for the great skill! I initially set this up so that Alexa could ask various questions about washer and dryer use to send finished notification to specific users and update the machines as "empty" when laundry is removed. Yeah, I have teenagers, so the laundry routine has become obnoxious...
Of course other uses came to mind, which led me adding intents so I could ask the skill to do something. I tested several ways to go about this and landed on simply using the ResponseString, which comes through even if an actionable notification has not triggered an exchange, to identify intents.
The first caveat was that an incoming command would use the last actionable notification event_id that was used. I created a toggle helper that turns on in the Activate Alexa Actionable Notification script. My response automations that are triggered by the event_id have the condition that this toggle is on in order to proceed. The last step in the response turns the toggle off.
Then I created an "Alexa Intents" automation that is triggered by the ResponseString type, with the condition that the toggle is off in order to proceed. From there I use choices that look for keywords in the response, so a
{{ 'keyword' in response }}
template. So "Alexa, ask home assistant to give me the weather," or any other variation with the keyword weather, triggers Alexa to rattle off the various temperatures around the house.The second caveat is that skill always sends "REMOTE" for the device, so I can't have it automatically respond to whichever Alexa the command came through. I can add a device to my initial voice command, though, such as "...on the kitchen dot." Before running through the intent keyword choices, the automation runs through a set of choices looking to see if a specific device was called out, defaulting on the living room Alexa if there was none.
What I love about this is that, on a whim, I can create whatever Intent I want by simply adding a new option with a unique key word to my Alexa Intent automation... I can avoid the hassle of adding an Intent to the Alexa skill, adding an intent respond to config.yaml, testing it, then publishing the skill the update.
Also... a suggestion: update the set up instruction to include the new
suppress confirmation:
code. I almost missed that little gem!Beta Was this translation helpful? Give feedback.
All reactions