Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make local area network HTTP request from Google Assistant?

I want to make HTTP requests to a server (such as Node-red or Arduino) on my LAN directly from my Google Assistant.

I would like to reproduce the behavior of this widget which, however, does not work from google assistant.

Using the IFTTT with webhooks makes the IFTTT website to ping on the internet from their server, not from my mobile in my private LAN. I think same will happen if I use google actions with api.ai with webhook. For example, this app, Wake On Lan can LAN requests, but it won't take links like 192.168.0.2:1880/test, it only takes IP addresses, but it works with the Google Hot word, OK Google.

So how can I make HTTP POST requests directly from my Google Assistant?

like image 977
Rajduino Avatar asked Sep 12 '17 18:09

Rajduino


People also ask

Does Google Assistant have an API?

The Google Assistant Service exposes a low level API that lets you directly manipulate the audio bytes of an Assistant request and response. Bindings for this API can be generated for languages like Node.

Is Google Assistant and Google Home the same?

Google Home and Google Assistant are two separate entities and they both have their own names. Google Home is the Google's line of smart home speakers and voice-based digital assistant, whereas Google Assistant is the voice behind Google Home but is not limited to Google Home.


1 Answers

I'm not 100% sure what you are looking to do here, but I THINK ngrok might be able to help you.

If your goal is to be able to access a server that is only accessible within your local network, then what you really need is a way to make that server accessible from outside the network, but only to you. You have two ways of doing this. One is to open up a port on your router, which is inherently unsafe. The other is to use ngrok. ngrok is an application that you run on your local server which opens a secure tunnel into your local network. You access it using a url externally that looks like this:

https://02355cab0.ngrok.io/

The hash is unique and only you know it. That URL is accessible from anywhere on the internet, but points to a server on your local LAN, ie:

https://02355cab0.ngrok.io/ -> http://192.168.0.2:1880

Check it out here: https://ngrok.com/

Using this ngrok url then, you can give that to the Google Assistant or whatever app (IFTTT if you want), to make calls from the web directly to your local network.

like image 62
Isaac Ray Avatar answered Oct 06 '22 16:10

Isaac Ray