I got Home Assistant as an gift from my father and he have set up most of it for me. I’m really slowly learning more about it, but i still need a lot of help.
My internet connection have been unstable lately and i’ve noticed that every time i’ve lost internet my home assistant become non responsive. I’m not able to connect to it in any way, and it loses connection with google home and all my lights. The only way to restart it is by unplugging the power, and plugging it back in again. I really hate doing that since it can’t possibly be good for the software…
I want to make an automation that pings one website, and if it does not get any response i’d like it to ping a different website again. If no response is given then i want it to reboot. I’d like it to do this every 10 minutes.
Hi , It does make scene that most cloud dependent integration do not work when your WAN is down . However it does not make scene that you have to unplug the pi from power if you can still access it on your LAN .
If the problem is with your router/modem then you do not need to reboot the pi . And if you still want to reboot the pi then you can do so from the Home assistant terminal
Please clarify more if I missed your point
You may check the speed net integration as it has ping and other features that could be easily automated
Agreed while you will loose connection to cloud services during ab Internet outage, you should not be losing connection to HA if you’re setup properly.
Troubleshoot that before you setup an automation yo work around something that shouldn’t be happening in the first place.
Some basics so people can help…
How does HA connect to the Internet for you (wired/wireless? Through what kind of router?)
Do you use Nabu Casa? (i suspect your dad set that up) configuration > home assistant cloud
Do you have BOTH an internal and external url setup in HA? Configuration > settings (scroll down) its the section under your geo settings
How are you trying to get to HA when your internet is out. Are you using a browser or a HA companion app? and from wagt device?
While you’re experiencing the issue? Does that work?
Here’s how mine is setup and why:
External URL: FULL Nabu casa URL - no trailing backslash (device will connect to HA when I’m out of my home)
Internal URL: IP address of HA box on your LAN. (NOT HE DNS NAME)
Basically, with this config the companion app will try to connect to your internal HA box by IP address unless you’re off your LAN and when outside the perimeter network, it will use Nabu Casa - there are other things to set to optimize that but - that’s the basics.
WHY by IP for internal? http://homeassistant.local is a mDNS address. mDNS also goes by Bonjour, and other tech names, but think lightweight phone book, its GREAT for fast name resolution in small networks without having to setup a lot of overhead. mDNS is also implemented a billion ways and sometimes doesn’t exactly do what you want it to do. The problem here is you will ALWAYS need base connectivity to your HA machine - possibly even in the event of an mDNS failure/unavailability.
If you have an mDNS issue and you are referring to your HA machine by homeassistant.local, then that means - your PC/phone, etc. can’t find the end point - no connection. BUT if you use the direct IP address (and also do whatever magic your router needs to ensure your IP address for the HA box stays fixed.) THen even if mDNS barfs - you still can connect assuming you’re on the same network and the HA box is actually up.
I’ve set the external ip to the very long https link provided in the Home assistant cloud control called “remote control”. And i’ve set my internal URL to http://192.168.1.200:8123 that is my home assistant static adress in my router. I’ll post whatever happens here after next internet outage.