2

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.

  • Have you used the dialog flow API? – Rohan Aug 5 '19 at 13:36
  • @Rohan I thought the dialog flow was built for conversations between human and Google Home Products? I am mainly looking just for a one-way street to send data to my receiving backend and not have an back and forth conversation. Would this still be viable if I just omit the response parts of the dialog flow? – 97WaterPolo Aug 5 '19 at 15:58
  • Yes what I did was set the intent on dialog flow as end of conversation and gave the fulfilment url as the IP of my server. That address will then get a post request with information about the intent. This should help achieve what you want with relative ease. – Rohan Aug 6 '19 at 16:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.