By the end of this tutorial you'll be able to do something like this:
If you use the attached profile XML file, please make sure to go into the AutoVoice Natural Language event condition in the profile and enable your own natural language command. This project was created for my command which will obviously not exist in your case
STEP 1 - CREATE NATURAL LANGUAGE COMMAND
This has created a command which will contain two variables: %contact (which will contain the contact's name) and %text (which will contain the message text). We're going to use this command in a profile in Tasker now
- In AutoVoice -> Natural Language -> Commands create a command with a command text as something like Send a text message to tom with hello and any variations of this you may want
- Create a response with something like ok sending message to tom with hello
- Select the tom text and use the Create Variable option to create a variable called contact
- Select the hello text and use the Create Variable option to create a variable called text
- Accept the command and go back to AutoVoice
STEP 2 - CREATE PROFILE TO REACT TO COMMAND
Note how the 2 mentioned variables are shown in the variable list
- Create a profile in Tasker with the AutoVoice Natural Language event condition
- Select your previously created command and accept the condition
- In the task use a Flash action to show the text: sending text to %contact: %text
STEP 3 - GET CONTACT'S NUMBER AND SEND SMS
At the time of writing, this action is only available in the AutoContacts beta. Get it here if needed.
- Use the AutoContacts Query 2.0 action
- In the Filters section set Names to %contact
- Select the Default Phone Number option
- Under Fields to Get select the Phone Number
- In the task use a Flash action to show the text Found number: %acnumber
- Add a Send SMS Tasker action and set the Number field to %acnumber and the Message field to %text
- Back out of Tasker to save
STEP 4 - TEST
Make sure that the Use For Google Assistant/Alexa option is enabled in AutoVoice -> Natural Language -> Commands for this to work. Otherwise you should try to test this with the AutoVoice Natural Language home screen shortcut/widget.
If you now say the command you'll see all the flashes show up confirming that the correct info was found and the SMS should now be sent to your contact.
IMPORTANT: If the phone number for a contact is not found (you'll know because %acnumber in step 3 won't have a phone number in it), please check if Google Home or Alexa wrote the name in a way that is different then the name of your contact.
For example, you may have a contact called Maddie and Google Home might understand it as Maddy in which case the contact will not be found.
In this case, add Maddy as the contact's nickname in your Contacts app and that should make it correctly find the contact.