We want to automate the process of turning on and off the light and also want to know the temperature at any time using google assistant and it will automatically send the SMS if the normal room temperature exceeds.
to get a custom replay from google assistance we have to modify it from ifttt.
go to ifttt.com and login with your google account.
then click on create.
click on + icon and add search service of google assistant then click on simple phrase.
then add what you want to say to google assistant to turn on the light and also write what google assistant will say in response in response block. then click on trigger then click on second + icon and search webhooks service and click on make a web request.
Then in URL add "https://cloud.boltiot.com/remote/API/digitalWrite?pin=PIN&state=HIGH&deviceName=BOLTDEVICEID" and select content type as application/json and click on create action.
This will only on the light, to turn off the light we have to create another trigger with URL "https://cloud.boltiot.com/remote/API/digitalWrite?pin=PIN&state=LOW&deviceName=BOLTDEVICEID" and all and all other steps are the same.
The Next thing we want to do is get a temperature of theroom when we ask google assistant so here we need to use the wayScript platform.
go to https://wayscript.com/home and sign in and create a new script then give the name to the file.
click on add trigger and search for google assistant. if you are using it for the first time you have to link your account to it, then click on add steps and search for python when we click on python it will generate a code file on the left side, hover over code and click on edit code and write the code which I attached to project and then click done editing finally add a final step below python and search for google assistant after adding google assistant to final step it will create a speech text box on the left side here we write the things which google assistant replay so we just add a variable which we used in python code.
below is the final image
Comments
Please log in or sign up to comment.