How to pass a text variable from Tasker to HE via Maker API and then to TTS?

So with Covid still around we've got a lot of zoom meetings arranged from home. We'll get an email from Zoom to say XYZ is in the waiting room so the goal is to get our TTS to speak the name of the person currently waiting.

With stringify no longer available it seems the best option is to use tasker as the front end. I have an unused phone which receives the zoom notification and then use the K9 email client and Tasker to filter the text of the mail to get the person's name. So far, check.

So how can I get the name into HE? I'm able to use a local endpoint to simply trigger an RM notification from Tasker when the email is received but can't figure out how to pass the name data over.

Also if I wanted the name spoken in RM do I store the name in %global-variable-name%? Managed to work this one out :grin:.

1 Like

I managed to get this done via node-red, avoiding the need for yet another device. The only downside is no push notifications so I need to poll the email server every so often.

However I'd still like to know if it's possible to pass variables from Tasker to HE as I haven't been able to get any info on this.

I haven't done this but you should be able to pass the name in an HTTP Request from Tasker to the device that is doing the speaking if you enable that device in Maker API.

The format of the HTTP Request in Tasker would be something like:
http://192.168.68.124/apps/api/2569/devices/[Device ID]/playText/%PersonsName%?access_token=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx where the %PersonsName% is the remnant of the email in Tasker that you would able to parse down to just person's name.

Again, I haven't done this but this should get you going in right direction.

1 Like

Thanks, that was not shown in any of the Maker API endpoint example URLs. I'll definitely check it out.

The trick is how the HTTP Request will handle the space in between 1st & last name. I know that about 3-5 updates ago, Maker API was changed to be able to handle it because I even commented on a thread about it but I cannot find it. The trick is getting the HTTP Request in the right format.

EDIT: You might have to send FirstName%20LastName

1 Like

I recall that from the issues in node-red/Maker API! :thinking:

1 Like

Ok this just worked passing a phrase with spaces to store as a variable in a virtual Omni sensor:
http://192.168.68.124/apps/api/2569/devices/3110/setVariable/This is a test?access_token=xxxxxxxxxxxxxxx
I am not home to try sending it to a TTS device but yes, there are actually spaces between "This", "is", "a", and "test" within the HTTP request.

So, if that's the case, you should be able to construct a HTTP Request in Tasker like this:
http://192.168.68.124/apps/api/2569/devices/3110/playText/%FirstNameLastName%?access_token=xxxxxxxxxxxxx

if you set the variable FirstNameLastName to the person's name in Tasker first. I wish I was home to test this though.

EDIT: @rocketwiz I keep forgetting to mention, the harder part to me would have been cutting down the incoming email from ZOOM to pull out the person's name. It's a shame ZOOM doesn't put it in the notification and that would have saved a step. Nice work and great idea!

1 Like

Variable splitting in Tasker is actually quite straightforward. However I needed to use k9 as the email client because the normal gmail app won't put the content of the email into the screen notification so you can't pull the data out with the autonotification plug in.

In node-red it's pretty straightfoward using the email node and either a function node or splitter nodes. And it's easy to get the data into an omni sensor with the HE command node. Other than the minor downside I mentioned. I set up a new gmail account which I forward all the zoom notifications to, as a security precaution.

If you need some help with the tasker splitting let me know!

1 Like