# Redirect app to Home Assistant on raspberry on same local network

**URL:** https://forum.yunohost.org/t/redirect-app-to-home-assistant-on-raspberry-on-same-local-network/29166
**Category:** Support apps
**Tags:** homeassistant, redirect, english
**Created:** [April 2, 2024, 6:10pm UTC](https://forum.yunohost.org/t/redirect-app-to-home-assistant-on-raspberry-on-same-local-network/29166 "2024-04-02T18:10:03Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![\_Niko](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/_/b3f665/32.png) [@\_Niko](https://forum.yunohost.org/u/_Niko)
#### Post date: [April 2, 2024, 6:10pm UTC](https://forum.yunohost.org/t/redirect-app-to-home-assistant-on-raspberry-on-same-local-network/29166/1 "2024-04-02T18:10:04Z")

</div>

Hey  
I’m getting desperate. I have home assistant running on rpi. I installed Yunohost on a mini pc running proxmox.  
I tried to use nginx proxy manager to use both from my domain name. Problem is it’s too difficult for me…the dns get mixed up and i guess the problem is my yunohost server doesnt know it is used throw nginx proxy manager…  
So now i’m trying to use this app i just discovered : Redirect as proxy.  
Problem is i dont manage to set it up !  
When i use [https://homeassistant.localIP:8123](https://homeassistant.localIP:8123), it fails : 400:bad request.  
if i add : [https://homeassistant.localIP:8123/dashboard-mydashboardsname/](https://homeassistant.localIP:8123/dashboard-mydashboardsname/)  
I get only the home assistant logo in middle of page lol…  
In my config yaml, i wrote :  
http:  
ssl\_certificate: /ssl/fullchain.pem  
ssl\_key: /ssl/privkey.pem  
ip\_ban\_enabled: true  
login\_attempts\_threshold: 5  
use\_x\_forwarded\_for: true  
trusted\_proxies:  
- 192.168.myYUNOHOSTip

Thanks for your help !  
Any idea welcomed, i just want to be able to reach my home assistant and yunohost on my domain name while they both are on same local network using same internet provider !

---

<div class="post-metadata">

### Author: ![Mamie](https://forum.yunohost.org/user_avatar/forum.yunohost.org/mamie/32/1245_2.png) [@Mamie](https://forum.yunohost.org/u/Mamie)
#### Post date: [April 3, 2024, 8:50am UTC](https://forum.yunohost.org/t/redirect-app-to-home-assistant-on-raspberry-on-same-local-network/29166/2 "2024-04-03T08:50:41Z")

</div>

According to your other post, you seems to have some problems on the cohabitation of your 2 servers.

So, tell me if I’m wrong :  
You have 2 domain names :

- [MYDOMAIN.nohost.me](http://MYDOMAIN.nohost.me)
- [MYHOMEASSISTANTDOMAIN.duckdns.org](http://MYHOMEASSISTANTDOMAIN.duckdns.org)  
Both have the same IP configured (the one of your Internet access).  
And now, things can become complicated.

On your box, which machine is configured as the destination ? (your box does not understand domain names, only ports (well, it could, but usually, it does not)).

The thing you should do is (I think) :  
**Internet Box** : tell it that your YunoHost server is the destination for ports 80 and 443 (and many others, depending on what you want to do.  
Have a look here : [Configure port-forwarding | Yunohost Documentation](https://yunohost.org/en/isp_box_config)  
And here : [DNS zone configuration | Yunohost Documentation](https://yunohost.org/en/dns_config)

**Home Assistant** : I have no idea about it, but to simplify things, it should only act in HTTP and not HTTPS, the **S** will be done by YunoHost.  
There may be some problem with it’s url but that is not 100% certain, it depends of how this software is developed AND configured.  
Note : do you need access to it from the Internet ?  
What is this 8123 port, something you configured or is it by default ?

**YunoHost** : both domains should be configured on YunoHost, both with let’s encrypt certificates.  
And to access Home Assistant, use (on YunoHost) the app [Redirect](https://github.com/YunoHost-Apps/redirect_ynh), and use it as a reverse proxy

I know this is not really simple, it is in my head, but that is not really easy to explain.

---

<div class="post-metadata">

### Author: ![xabi](https://forum.yunohost.org/user_avatar/forum.yunohost.org/xabi/32/6528_2.png) [@xabi](https://forum.yunohost.org/u/xabi)
#### Post date: [April 3, 2024, 4:10pm UTC](https://forum.yunohost.org/t/redirect-app-to-home-assistant-on-raspberry-on-same-local-network/29166/3 "2024-04-03T16:10:33Z")

</div>

In my case, it’s YunoHost the one managing the SSL, not the HomeAssistant, and I believe that’s why my config.yaml is different.

Install the _Let’sEncrypt_ certificate for the HomeAssistant [sub]domain on YunoHost.

If you suffer from hairpinning, you’ll have to edit your _hosts_ file or router settings or include this on your DNS server (such as _PiHole_):

- maindomain.ltd → 172.16.1.1
- homeassistantdomain.ltd → 172.16.1.1

They both point to your YunoHost server because that’s the server managing the connection to your HomeAssistant server — it goes through your Proxmox/YunoHost).

Install _redirect_. **reverse-proxy** is what you want. Define the address of the _Raspberry_ running _HomeAssistant_. Eg: [http://172.16.2.1:8123](http://172.16.2.1:8123)

**RaspberryPi**  
Edit **configuration.yaml** :

```auto
http:
  server_port: 8123
  use_x_forwarded_for: true
  trusted_proxies:
    - 172.16.1.1 # this is the address of your YunoHost server
  ip_ban_enabled: true
  login_attempts_threshold: 5 # or whatever you want

```

I’m sure there is a way to do this using the interface but I don’t know where it is. I’ll edit this if I find it.

And that’s it. I can connect to my HomeAssistant via HTTPS from my phone.

---

<div class="post-metadata">

### Author: ![\_Niko](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/_/b3f665/32.png) [@\_Niko](https://forum.yunohost.org/u/_Niko)
#### Post date: [April 3, 2024, 8:42pm UTC](https://forum.yunohost.org/t/redirect-app-to-home-assistant-on-raspberry-on-same-local-network/29166/4 "2024-04-03T20:42:04Z")

</div>

> [@xabi](#):
>
> ```auto
> http:
> server_port: 8123
> use_x_forwarded_for: true
> trusted_proxies:
> - 172.16.1.1 # this is the address of your YunoHost server
> ip_ban_enabled: true
> login_attempts_threshold: 5
> 
> ```

Thanks for you help mamie ! You understand internet much more than my grandmas used to !  
I’ve been discovering so many things in last days : proxmox, self hosting, proxy, reverse proxy, ipv4, ipv6, DHCP, firewall… My brain is exploding and confused and my posts were confusing !  
I was about to leave it for a while but your answer and the other helped me a lot, and i was not that far from managing it !  
Thanks !

---

<div class="post-metadata">

### Author: ![\_Niko](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/_/b3f665/32.png) [@\_Niko](https://forum.yunohost.org/u/_Niko)
#### Post date: [April 3, 2024, 8:50pm UTC](https://forum.yunohost.org/t/redirect-app-to-home-assistant-on-raspberry-on-same-local-network/29166/5 "2024-04-03T20:50:12Z")

</div>

Thanks xabi ! you’re my hero ! 😉  
I just started all over and it works !  
Only one problem left lol !  
I had to remove the ip ban cause it fails to log so many times. When i check log, it’s linked to the api/calendar…

Enregistreur: homeassistant.components.http.ban  
Source: components/http/ban.py:128  
intégration: HTTP (documentation, problèmes)  
S’est produit pour la première fois: 22:40:00 (44 occurrences)  
Dernier enregistrement: 22:43:51

Login attempt or request with invalid authentication from my IPadress. Requested URL: ‘/api/calendars/calendar.numeros\_de\_semaine?start=2024-03-31T22:00:00.000Z&end=2024-05-12T22:00:00.000Z’. (Mozilla/5.0 (X11; CrOS x86\_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36)

I’m going to look for that but if you have another great idea…  
Thanks again cause i’ve got the feeling i’m almost there !!

---

<div class="post-metadata">

### Author: ![\_Niko](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/_/b3f665/32.png) [@\_Niko](https://forum.yunohost.org/u/_Niko)
#### Post date: [April 6, 2024, 2:34pm UTC](https://forum.yunohost.org/t/redirect-app-to-home-assistant-on-raspberry-on-same-local-network/29166/6 "2024-04-06T14:34:10Z")

</div>

Hey  
I can’t find any solution about this Google calendar integration login error…  
Login attempt or request with invalid authentication from myip.  
Any idea please ?

---

<div class="post-metadata">

### Author: ![xabi](https://forum.yunohost.org/user_avatar/forum.yunohost.org/xabi/32/6528_2.png) [@xabi](https://forum.yunohost.org/u/xabi)
#### Post date: [April 7, 2024, 1:11pm UTC](https://forum.yunohost.org/t/redirect-app-to-home-assistant-on-raspberry-on-same-local-network/29166/7 "2024-04-07T13:11:03Z")

</div>

I’m afraid I don’t have any experience with that.

---

<div class="post-metadata">

### Author: ![system](https://forum.yunohost.org/uploads/default/original/2X/f/f59fe8e3ee6b100b4f574d30d6e30479c68b89f0.png) [@system](https://forum.yunohost.org/u/system)
#### Post date: [April 22, 2024, 1:11pm UTC](https://forum.yunohost.org/t/redirect-app-to-home-assistant-on-raspberry-on-same-local-network/29166/8 "2024-04-22T13:11:41Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
