NGROK and Hass.io

How do I get ngrok to work with hass.io?
I tried to run ngrok but I only get -ash: ngrok: not found.

You can download it via ssh terminal on Haasio using the following command:

cd /tmp
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm.zip
unzip ngro*

and You can run by:
1- connecting your authentication command then run the server by:
2- ./ngrok http 8123

However, everything goes well but after login to my Home Assistant the system locks on Loading data…

Yeah, I’m stuck on loading data too…

UPDATE:

got it to work with:

ngrok tcp 192.168.X.X:8123

the websocket is bugged. tcp is working

1 Like

Is there anyway to get this working with Hassio All-in-one installer version on Pi3? Been trying for months to get remote access but unable to. I have AT&T Home internet. I assume it’s the Carrier grade NAT that is the issue.

The instructions should be the same. Just type those commands in ssh and you should be good to go. QQ

1 Like

You can also check out my article on using webhook relay for a similar experience https://itnext.io/reverse-tunnels-for-your-home-assistant-on-a-raspberry-pi-cf5c63b7638e.

Works as a container since you already have Docker on your hassio instance. I am currently also working on a add-on, although quite slowly as I am pre-occupied with other things :slight_smile:

i’m looking forward to the hass.io addon

2 Likes

Nice article!
I’m tempted to try it but still a little unsure on how to do it all manually, I’ll probably wait for an addon :grinning:.

Thanks

I went ahead and tried it and I have the webhook relay installed and I can see it running in Portainer. I login to the provided link and I get “relay agent not connected or misconfigured”. Checking webhook logs I see nothing. When creating the tunnel I used the ip and port of my HA installation. I updated the destination to localhost:8123 and from looking at the logs below, it changed here on my end.

whr-relayd logs…

{“level”:“info”,“ts”:stringofnumbersremoved,“msg”:“client starting”,“version”:“1.0.0”},
{“level”:“info”,“ts”:stringofnumbersremoved,“msg”:“adding HTTP tunnel mydomain.webrelay —> 192.168.86.182:8123”},
{“level”:“info”,“ts”:stringofnumbersremoved,“msg”:“adding WS tunnel mydomain.webrelay. —> 192.168.86.182:8123”},
{“level”:“info”,“ts”:stringofnumbersremoved,“msg”:“tunnel proxy configuration updated”},
{“level”:“info”,“ts”:stringofnumbersremoved,“msg”:“adding HTTP tunnel mydomain.webrelay —> localhost:8123”},
{“level”:“info”,“ts”:stringofnumbersremoved,“msg”:“adding WS tunnel mydomain.webrelay —> localhost:8123”},
{“level”:“info”,“ts”:stringofnumbersremoved,“msg”:“tunnel proxy configuration updated”},
{“level”:“info”,“ts”:stringofnumbersremoved,“msg”:“client starting”,“version”:“1.0.0”},
{“level”:“info”,“ts”:stringofnumbersremoved,“msg”:“adding HTTP tunnel mydomain.webrelay —> localhost:8123”},
{“level”:“info”,“ts”:stringofnumbersremoved,“msg”:“adding WS tunnel mydomain.webrelay —> localhost:8123”},
{“level”:“info”,“ts”:stringofnumbersremoved,“msg”:“tunnel proxy configuration updated”},

that message is displayed when your agent is not connected, quite weird that you see in the logs that it’s connected or you are trying to access wrong subdomain (more likely). Can you check https://my.webhookrelay.com/tunnels whether your public URL is actually the one that you are trying to use?

I have also enabled HTTPS for your account.

Regarding add-on, got initial version working but thought I will go all-in and make it automatically configure tunnels and webhook endpoints as well, so from the web UI users will only need to get access token.

I was trying to access the subdomain that was auto generated for me. I didn’t have the option to create my own. I’m just clicking on the link provided.

When I login to my account on webhookrelay.com, go to tunnels, there is a link under “Host” the only tunnel I have. Is that the link i should be going to? Or do I use what is in the “Name” field with .webrelay.io?

If I go to the link under Host, I’m prompted for username/password. I input both and after a couple of seconds I am prompted again for username/password.
If I go to the whats listed under “name” with werelay.io I get “relay agent not connected or misconfigured”

“host” should be the one, set tunnel authentication to “none” as your HA already has authentication.

That worked. Thank You

A bit of old topic but I was hoping someone here can help me.
I’ve finally managed to setup https outside but it’s not complete:

  1. I got ngrok pro to enable tls tunnel and reserved name with ngrok
  2. ssh’ed into hassio instance via ssh addon
  3. downloaded ngrok, authenticated with a key and run to proxy 8123 on the local ip address to my reserved domain
    ./ngrok tls 192.168.x.x:443 -subdomain=xxxx.xxx -region=au
  4. all works using ngrok certificates

Now what I’m trying to change is to use my own cert generated by letsencrypt. I feel to do that I may need to use 443 port specifically? I’ve tried setting server_port to 443 in the config and got ‘This client does not support TLS SNI. See https://ngrok.com/docs#compatibility
My understanding SNI is not supported by hassio?

I’m all new to this. Anyone had success setting this up?
Also on a similar note, any way to keep ngrok install persistent?
(hassio is just running off RPi)

Thanks!

This is Just to make you know that I developed a custom-component (I’m still testing it) to embed ngrok in HA/Hassio. If you can help me to test it here it would be appreciated.

Regards,
Vincenzo

1 Like

Hello Vincenzo, I’m having trouble in setting up the ngrok add-on you’ve provided.
I’m behind a carrier grade nat, and couldn’t make the duckdns acess work, so keep searching and found the Ngrok option.

I’ve followed the steps on your git page: created a new folder on config (custom_components/ngrok) and saved the .py file on it, made the changes on config file, set the !secret info on the secret file, but the process does not seem to run. Does not show as a State.
Thanks

I’ll try it today!Let you know

Ok some simple questions for a beginner like me.

I have only the ssh shell access to my hassio, i have managed to create the directory /config/custom_components/ngrok how do i copy the .pi file?

Sorry if the question is so odd.

Thanks

wget https://raw.githubusercontent.com/vincenzosuraci/hassio_ngrok/master/__init__.py