keatontaylor / alexa-actions

A README and associated code to get actionable notifications setup for Alexa devices.
GNU General Public License v3.0
391 stars 186 forks source link

UserResponse using FirstName slot + StringResponse using Intents slot to pass to HA Assist #228

Closed foxymichelle closed 5 months ago

foxymichelle commented 7 months ago

First, this is my first pull request. Not realizing exactly how this work, I created a fork and updated the commit notes and README with explanations for you.

Second, I did this a week ago and all is working well. Hopefully I was thorough and didn't miss anything going back to create all of this for sharing.

My goals were:

  1. Perfect sending a user's name back to HA as a response and hopefully get less "other" words. I discovered that AMAZON.Person is for full names of real/fictional people while AMAZON.FirstName is for common first names. Maybe it doesn't matter, but I'm getting better results using this. I also created a UserResponse category to capture those slots instead of getting it through StringResponse.
  2. I am now using StringResponse solely to initiate a request. I did originally have this set up as the previous {Strings} using the .Person slots would send whatever was said to HA, but it seems that Alexa has gotten stricter with intents matching slots, so I was getting errors. I created a custom "Intents" slot, then used that slot as the {Strings} utterances. Now the skill will pass the most common requests back to HA.
  3. Rather than creating an automation triggered by the StringResponse with "Choose" looking for specific words in the response, I thought it would be way more efficient to utilize the Year of Voice by passing the request on to Assist, then have Assist pass its response back, playing that as an announcement. So now I can say, "Alexa, ask actionable notifications where Son is", the request will be passed to Assist, then the Assist response will be announced using Alexa Media Player ("Son is as school."). Now all the built-in stuff just works; custom sentences and responses can be added to Assist instead of to the Alexa Intent automation (although I have not done that yet, so my sample first looks for "find" and "user" to trigger finding the user's phone or defaults to passing the message on to Assist).
  4. The only caveat with this is that I have to choose a single Alexa for all the responses, but we do have a central Alexa that works fine in most cases. I may add more to the automation so that I can add the device name to my request (... on kitchen dot), have it parse that out to use as the device_id and pass only the request to Assist so it understands.
  5. Finally, I wanted quick and easy troubleshooting, so I added 2 more text_input helpers - one that saves the incoming message from the skill and another that saves the Assist response. Now if an actionable notification doesn't do what was expected, I can go back and see what was "heard" without having to use the event listener and hope to repeat the error. The helpers history is also helpful for troubleshooting.
github-actions[bot] commented 5 months ago

Stale pull request message