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

9.3k views Asked by At

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?

1

There are 1 answers

1
Isaac Ray On

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.