My boring Blog

Mauro Frigerio blog

Secondary home management with Home Assistant

22-08-2021 3 min read Article

When you get caught up in smart homes you can’t stop and want to automate everything. I started with the second home in the mountains and then got caught up. In this post I want to collect my experiences in managing the second home, specifically with Home Assistant.

The big problem is that the LTE router doesn’t have a public IP address and I have to leverage a VPN to access the second home’s network from the outside.

solution 1 - VPN and separate logic

My first attempt was with a VPN connection between the two houses creating a single local area network. The control and automation logic were in my primary home.

The solution worked for a while, then the Chinese LTE router started to stop working properly and the VPN would jump regularly.

Solution 2 - Dedicated VPN Router

I no longer trusted the Chinese router, so I looked for a more reliable solution. I found a project (RaspAP) that turns a Raspberry Pi into a VPN router with a convenient web interface.

Even this solution after a while started to have problems, the situation was strange because now the problem was the wireless. I think the problem was due to some nodes in the network and not from RaspAP.

solution 3 - Second instance of Home Assistant

The third (and hopefully last) iteration of the design involves a new Home Assistant instance in the second home. These are the main reasons:

  • second ZHA integration for Zigbee sensors (you can only have one per HA installation)
  • minimal management even without internet connections
  • resilience and alternative control in absence of VPN connection

I’m still not super happy with the Zigbee sensors, because they occasionally disconnect and I don’t know why. I do use door sensors in the two houses though, which s’รจ work are very convenient.

The big change I made was to take a FritzBox router (the FRITZ!box 6820v3 LTE model) and make it do only the router and access point for wireless. To the only LAN socket I connected the Raspberry with HA. I changed the VPN from OpenVPN to Wireguard using directly the Home Assistant add-ons. So from the primary home I can reach the HA instance and all the components in the network. The only disadvantage is that only HA can access the primary network.

Then thanks to the remote Home Assistant integration present in Hacs it is possible to connect two HA instances. It has to be installed in the primary HA instance and you connect to the second one. After that you can view all entities, devices, automations, etc etc. You can also limit the visible entities, or add a prefix to all added entities, so as to avoid conflicts with already existing ones.

The possibility to have automations running locally in the second house allows me to increase resilience, having additional possibilities even when the VPN is not working. So I created automations that regularly check .json files on a site. There are commands in the files that allow me to perform basic functionality that is absolutely essential. If I can’t get to Home Assistant through the VPN, I change the values in the command file and if the second home has internet access it will run it at the first opportunity.

I hope now that I have found the ultimate solution to my problem.