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

1

6

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?

Galbreath answered 12/9, 2017 at 18:0 Comment(4)
are you trying to achieve this from the python SDK or have created an Android compatible SDK using grpc bindings?Yoshieyoshiko
@Yoshieyoshiko I have no idea what are you talking about, I am a beginner and have no idea how to use actions sdk.Galbreath
Are you using built in google assistant on your phone or you are writing a custom app using the google assistant sdk developers.google.com/assistant/sdkYoshieyoshiko
@Yoshieyoshiko Yeah I was trying to make it using only the actions on assistant, using the tools api.ai or IFTTT, but now I think it is not possible with them, I will have to make an app, and I am not an expert in making android apps. And I will use it on phone, not on any other device.Galbreath
T
3

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.

Turkic answered 22/3, 2018 at 17:31 Comment(1)
Thanks, yeah I know port forwarding is possible, but my bloody ISP gives me connection from behind a NAT, so port forwarding will require me to talk to their Admin!! Thanks for the ngrok.com btw it is useful, will use it in the future. But I think Google has not yet started the support for embedding Google assistant in your apk.Galbreath

© 2022 - 2024 — McMap. All rights reserved.