I’ve recently set up a home automation system based on HA, using a HassOS on a Raspberry PI 4. Many Zigbee devices added so far.
After that success, now I’m trying to completely replace my home alarm system, and I need to solve some issues (because thieves could cut power supply and Internet access by cutting the fiber outdoors):
1 - Battery backup.
Solved using an UPS for the RPI, and using battery-powered Zigbee devices. The integration using zigbee2mqtt is really good.
2 - Internet backup.
The isolation from wifi network is achieved using zigbee devices instead, but I need a system able to use an cellular (3g/4g) Internet connection when router is offline. My ISP does not offer option to use a router with 3g backup.
I even have a Huawei E3531 3G USB stick compatible (I hope) with RPI.
I’ve read some posts about the matter:
But I’m not sure I could apply the solution proposed in second post.
I don’t know exactly how to configure network settings in HassOS in order to deal with a connection lost in my router, activating automatically the 3g connection and eventually restoring the original situation upon fiber recovery.
The solution in the post is applied over a fresh Linux installation, not HassOS natively installed on a RPI.
Interested to know if this is an option as would be nice moving forward to be able to have a 3/4G usb stick as a backup plugged in to HA NUC in case main network goes down
Yes. It’s exactly what I want. I think checking for network connectivity should be enough, but the question is how to do it and change the connection not “in normal Linux” but in HassOS. Any suggestion?
I don’t know exactly how to configure network settings in HassOS in order to deal with a connection lost in my router, activating automatically the 3g connection and eventually restoring the original situation upon fiber recovery.
The solution in the post is applied over a fresh Linux installation, not HassOS natively installed on a RPI.
And also I should mention that I use the Companion App using DuckDNS. So, in the event of Internet failure and activation of 3G/4G backup, the solution must deal with the new public IP got by the USB 3G/4G dongle.
There is an API endpoint for the supervisor that would let you change the interface. /network/interface/<interface>/update. I’d venture you could write a script to change the interface but I can barely write an automation, so I’m no help there.
Edit: there should also be an endpoint to allow you to call an update to the duckdns addon. I don’t know how fast it populates dns servers with the new address, though. My experience not with duckdns but in general it’s no where near instantaneous.
No clue on how to do that in HassOS, so I’m afraid you’ll be on your own trying to transpose available tutorials for a standard distro to the quite locked down HassOS.