# Connecting to Home Assistant

**URL:** <https://forum.remote.it/t/connecting-to-home-assistant/568>\
**Category:** Starlink, Cellular, CGNAT\
**Created:** [April 25, 2022, 8:32pm UTC](https://forum.remote.it/t/connecting-to-home-assistant/568 "2022-04-25T20:32:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SylvainG](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.remote.it/sylvaing/32/240_2.png) [@SylvainG](https://forum.remote.it/u/SylvainG)\
**Post date:** [April 25, 2022, 8:32pm UTC](https://forum.remote.it/t/connecting-to-home-assistant/568/1 "2022-04-25T20:32:55Z")

</div>

Hi, first time posting here and newbie regarding this software. Not sure if I chose the right Category.

Got my Starlink dish for the cottage and since I have a few devices there that I used to access through ‘port forwarding’ on my DSL router, I installed remote.it on my RaspberryPie running Raspbian. I configured ssh and [WeeWX](http://weewx.com/) locally as well as some web based cameras (with their own IP address, the Pie IP address) and all is working well. So I know everything is configured correctly so far.

On the Pie though, I’m also running [Home Assistant](https://www.home-assistant.io/) through its standard 8123 port. To secure it before the Starlink dish, I had on the Pie an Apache2 Proxy in front with a SSL certificate provided by letsecrypt and DNS name by duckdns. Since remote.it does its own encryption, I simply added as a service the default non-encrypted 8123 port.

When trying to connect to that service, it starts the connection, the page starts to load and then I get a pop up saying the connection has stopped.

This is the Apache Proxy configuration for that service. As you can see, it uses websockets. Are websockets supported with remote.it? Or is there something else that prevent Home Assistant from opening correctly?

■■■■ of a post for my first post, sorry 🙂

BTW, I know about Nabu Casa for Home Assistant since that’s what I’m using for my Home Assistant at home but the cottage one is small enough with no integration with Alexa and Google Home that it’s not required.

PS. I’ll need to put the config in its own posts since it interprets the links there as URL and I’m only allowed two as a new user.

Thanks.

---

<div class="post-metadata">

**Author:** ![SylvainG](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.remote.it/sylvaing/32/240_2.png) [@SylvainG](https://forum.remote.it/u/SylvainG)\
**Post date:** [April 25, 2022, 8:33pm UTC](https://forum.remote.it/t/connecting-to-home-assistant/568/2 "2022-04-25T20:33:48Z")

</div>

This is the proxy config file:

```auto
<VirtualHost *:80>
    ProxyPreserveHost On
    ServerName ha.${MYDOMAIN}
    CustomLog /var/log/apache2/${LOG} combined
    RewriteEngine on
    RewriteCond %{SERVER_NAME} =ha.${MYDOMAIN}
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

<IfModule mod_ssl.c>
    <VirtualHost *:443>
        ServerName ha.${MYDOMAIN}
  ProxyPreserveHost On
  ProxyRequests off
  ProxyPass /api/websocket ws://192.168.0.122:8123/api/websocket
  ProxyPassReverse /api/websocket ws://192.168.0.122:8123/api/websocket
        ProxyPass / http://192.168.0.122:8123/
        ProxyPassReverse / http://192.168.0.122:8123/
  RewriteEngine on
  RewriteCond %{HTTP:Upgrade} =websocket [NC]
  RewriteRule /(.*) ws://localhost:8123/$1 [P,L]
  RewriteCond %{HTTP:Upgrade} !=websocket [NC]
  RewriteRule /(.*) http://localhost:8123/$1 [P,L]
        CustomLog /var/log/apache2/${LOG} combined
        SSLCertificateFile /etc/letsencrypt/live/ha.${MYDOMAIN}/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/ha.${MYDOMAIN}/privkey.pem
        Include /etc/letsencrypt/options-ssl-apache.conf
    </VirtualHost>
</IfModule>

```

---

<div class="post-metadata">

**Author:** ![gary](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@gary](https://forum.remote.it/u/gary)\
**Post date:** [April 26, 2022, 10:08pm UTC](https://forum.remote.it/t/connecting-to-home-assistant/568/3 "2022-04-26T22:08:21Z")

</div>

Ha ha,

You’re correct that is one heck of a first post! The real answer is “I’m not sure unless I try to set it up myself”.

However, I can suggest a couple things.

One would be to configure the remoteit connection as an https Service, then use the “named connections” feature in desktop to enable a certificate on the client side as well.

> **[Two ways of using remote.it Connections](https://support.remote.it/hc/en-us/articles/4492289672973-Two-ways-of-using-remote-it-Connections)**
>
> There are two primary ways to use remote.it Connections when using the Desktop application.   Making connections to the same devices over and over is a good candidate for using On-Demand Connection...

If you continue to face any issue, please send an e-mail to support@remote.it to allow us to track this issue more closely.

---

<div class="post-metadata">

**Author:** ![SylvainG](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.remote.it/sylvaing/32/240_2.png) [@SylvainG](https://forum.remote.it/u/SylvainG)\
**Post date:** [April 28, 2022, 2:19am UTC](https://forum.remote.it/t/connecting-to-home-assistant/568/4 "2022-04-28T02:19:06Z")

</div>

Thanks, I’ll try again once I get back to the cottage
