I made an app that accepts a request from Google home. It then waits let’s say 5 seconds before triggering a list of IFTTT commands to switch off lights etc.
When you make the IFTTT applet (which links your Google home request to your glitch app) it gives you the choice to either use a simple phrase OR use a phrase with an added number OR a phrase with a text ingredient OR a phrase with both. Is it possible to use a phrase with a number and then access that number from the glitch app?
For example I would say to Google home “turn off the lights in 10 minutes”, and then I can access the “10” from the glitch app? This would be cool as you could specify how long the timer should be rather than having to make lots of separate glitch apps (an app for 10 minute timer, an app for 5 minute timer, an app for 15 minute timer etc).
Anyone know how this could be done? I’d expect it would be quite easy to do. Many thanks.
Yes, so your ‘this’ is Google Assistant’ and your ‘that’ is a webhook to your glitch project? In the config of the webhook you can select the ingredient to be sent, which you can see in the JSON body of the webhook request in your Glitch app. You’ll need to use the body-parser middleware (assuming you’re using Express) to be able to access that content easily.
An example setup outputting the json.body is below, so you’d need to take parts of that and add to your app:
Thank you very much for your help, I’ve managed to make the script just as I wanted now. So I can say “hey Google, turn on (say name of smart device) in (however many) minutes” and it works