-
-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UserResponse using FirstName slot + StringResponse using Intents slot to pass to HA Assist #228
Conversation
Added code to create a User Response (RESPONSE_USER, UserIntentHandler, and added to list of processes).
Added RESPONSE_USER
Deleted slot: AMAZON.Person (full name of real and fictional people) Added slot: AMAZON.FirstName (Thousands of popular first names commonly used by speakers in the United States. This slot type recognizes both formal names and nicknames. The name sent to your service matches the value spoken by the user...) NOTE: There are (as of 1/2024) 3 other first name slots - one for German names (AMAZON.DE_FIRST_NAME), UK names (AMAZON.GB_FIRST_NAME), and a second US option (AMAZON.US_FIRST_NAME). Added Slot: Intents (custom slot). This slot has all of the intents Assist understands built-in (as of 1/2024). Added intent: Users with sample utternance {Users}, which is listening for the AMAZON.FirstName slot. Edited Intent: String with sample utternance {Strings), which was edited to listen for the new Invokes slot.
Created 2 additional input_text helpers: alexa_actionalble_response - used in an automation that saves the incoming message from the skill. While you can use the Events tab in Developer Tools to listen to events and troubleshoot, I've found it more efficient to simply refer to the this to see the history. assist_to_alexa_response - again, a great placeholder to troubleshooting the response assist returns Created a new input_boolean alexa_action_in_progress - a toggle that can be helpful when you want to identify if there's an active action. Edited the notification script: Added turn on input_boolean.alexa_action_in_progress.
Created 3 additional automations: 1. Turns off input_boolean.alexa_action_in_progress if it's been on for a minute. 2. Saves the incoming message from the skill to the new input_text.alexa_actionable_response 3. Incoming request with intent trigger with custom responses and default response that passes the request to Assist and announces the response from Assist.
Update Details
Deleted slot: AMAZON.Person (full name of real and fictional people) Added slot: AMAZON.FirstName (Thousands of popular first names commonly used by speakers in the United States. This slot type recognizes both formal names and nicknames. The name sent to your service matches the value spoken by the user...) NOTE: There are (as of 1/2024) 3 other first name slots - one for German names (AMAZON.DE_FIRST_NAME), UK names (AMAZON.GB_FIRST_NAME), and a second US option (AMAZON.US_FIRST_NAME). Added Slot: Intents (custom slot). This slot has all of the intents Assist understands built-in (as of 1/2024). Added intent: Users with sample utternance {Users}, which is listening for the AMAZON.FirstName slot. Edited Intent: String with sample utternances {Strings) and {Strings}{Users}, which was edited to listen for the new Invokes slot.
## This fork was updated with the following (see commit notes for more details): | ||
- EN-US.json | ||
- AMAZON.Person slot was deleted and replaced with AMAZON.FirstName with "User1Name" and "User2Name" (with nickname) as samples. **NOTE: Update with your user names/nicknames. | ||
- New "Intents" slot was created with common intent triggers, including current (1/2024) Assist intents. **NOTE: Update to add your own intents. | ||
- New "UserIntent" created that listens for {Users} listed in the AMAZON.FirstName slot. | ||
- "StringIntent" edited to listen for {Strings} based on the new Intent slot. | ||
|
||
- const.py and lambda_function.py | ||
- Edited to include "UserResponse" event type. | ||
|
||
- configuration.yaml | ||
- Added input_text helpers to save the skill's incoming data and data that is returned by Assist. | ||
- Added input_boolean helper to determine if there is an Alexa Actionable Notification event in progress or not. | ||
- Edited the script to include turning on the input_boolean. **NOTE: You need to add turning it off at the end of your response automations. | ||
|
||
- new_automations.yaml (NEW) | ||
- Added automation that turns off the input_boolean after one minute. This is a catch-all, just in case your response automation fails or you forget to include turning it off. | ||
- Added automation that saves the incoming event data to the new input_text helper. | ||
- Added automation that listens for user-initiated incoming requests. There is a sample that uses Choose to create a custom response. The default action is to pass the message to Assist and announce the Assist response (plus save response in the new input_text helper). | ||
|
||
About the custom response: | ||
My sample triggers finding a users phone by looking for "find", then "userName", then turning on a find_userName_phone toggle. [Check this out](https://github.com/foxymichelle/Home-Assistant-Find-Phone/tree/main) for my Find Phone automations, including triggering an Alexa Actionable Notification if the user is not home, asking if you'd like to proceed, then completing the action based on your response. | ||
|
||
## ----- Original Content ----- | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't belong here. Either do documentation to include the changes but changelog is not the purpose of README.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a newbie to pull requests, so lessons will be learned! I'll get this sorted as as I tack each of your notes this week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use an appropriate name for the automation instead of new_automation.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure you include in docs how this works and how to use it.
variables: | ||
response_type: "{{ trigger.event.data.event_response_type }}" | ||
response: "{{ trigger.event.data.event_response }}" | ||
device: media_player.your_alexa_device |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this value dynamic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is dynamic, but the media_player needs to be updated. I'll separate the automations into different files with relevent names and include how it works/how to use in docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong formatting. Make sure you use double quotes. Use black and ruff for formatting and linting
Stale pull request message |
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: