I have a project that I want to start on that involves Google Home and a custom light system. I currently control some lights in my apartment VIA a website but I want to be able to control the lights using the google home.
My current thought is to have website set up with a request so that I can do mydomain.com/lights?color=red&brightness=255 and it would execute it. I currently am using twilio for something else and I use a ngrok server to create a static public facing link. Whenever anyone texts the twilio number it gets forwarded to the ngrok IP and then goes to my server where it handles the request and returns a message.
What I want to do, is basically just have google submit it and not wait for a response. Example flow below
1) User says "Hey Google, turn the lights red"
2) Google sends request to my ngrok domain which is the JSON file request
3) My ngrok request listern then will process the given json file and translate the request to a GET url
4) NGROK handler sends localdomain/lights?color=red
5) I handle this myself with my existing light project
6) Google says "Ok" (I dont want to have to recieve a response with whether or not it worked.)
Some example commands I want to have
- Turn the lights on lights?status=on
- Turn the lights off lights?status=off
- Set brightness to X lights?brightness=255
- Change the color to COLOR lights?color=red
- Play the rainbow cycle lights?pattern=rainbow
Basically I want to know how to approach this. I currently set up a Google Action (under Smart Home) and set the URL to my ngrok server, but whenever I try to test it I get the invocation error. I haven't figured out how to test it even on my google home (because when I try to load it on google home I click the action but nothing happens).
Any advice would be helpful! I want to know how to approach this and make it very simple like twilio, where all the values and parameters are just passed too my server.