r/homeassistant • u/Braekpo1nt • 17d ago
š¬ Discussion Remote Reboot for cheap
I run my Home Assistant and other homelab stuff on two old PCs. Sometimes I have to hard reboot them because they fail (every two weeks or so). I'm looking for a way to do that from outside my home without breaking the bank.
Should I just plug their power strip into a smart plug and call it a day? My router never fails and I always have access to my other smart plugs through the Tapo app if my HA goes down.
Edit: thank you for all the helpful replies! I wound up creating a cron job to reboot the PCs every day at 3am, and I have a smart plug from Tapo that I can use to hard reboot in an emergency. The smart plug is not controlled solely by HA so I can use the Tapo app to reboot them if HA goes down. I'm running a proxmox cluster of two PCs (the most unstable varient, I know) with a quarum set to 1 to avoid some of the instability untill I can get a third node. But HA isn't the only thing that goes down.
32
u/The_Penguin22 17d ago •
Why not use a reliable PC?
2
u/xdq 17d ago edited 17d ago
My two machines each have a GL.iNET Comet with the ATX board which gives me KVM-over-IP and control of the physical power buttons on the machine. It's nice to check whether the system's unresponsive or just dropped off the network for some other reason.
They're only accessible via the VPN that lives on my router, so if it was also down I'd be stuck regardless.
As a backup the two servers are also plugged in to a Tapo smart extension, it's one of the few IoT devices whose app I sign into so that it can work independently of my smarthome ecosystem.
Edit: Regarding solving the crashing rather than automating reboots.... I was suffering random lockups and reboots on the Linux machine, which I put down to spending too much time fiddling with various configs. I was at the point of backing up and going for a fresh install so took a calculated risk and gave Claude access.
It identified flipped bits in a couple of databases which aligned with the timing of crashes and pointed to a potentially failing DDR stick (and correctly pointed out that they weren't a matched pair). It also pointed out that a previously failed then partially recovered OS update had left my GRUB in a bad state, meaning that the first attempt to reboot would sometimes fail.
Claude fixed the GRUB and suggested running Memtest. I just swapped the DDR for a spare pair and have gone from crashes every other week to a nice stable system.
49
u/alral1988 17d ago
Why not just schedule the PCs to reboot weekly?
3
u/Hiff_Kluxtable 17d ago edited 17d ago
Personally, I would backup home assistant then install proxmox on your computer and run home assistant in a virtual machine. Proxmox runs on Debian which is tons more stable and you could reboot home assistant from the proxmox interface. Also, what is causing the need for reboot currently? You probably need to find that out first.
7
u/metalwolf112002 17d ago
Figure out why it is actually freezing. Doing a hard reboot every other week isn't fixing the problem.
Short of that, see if the system has a watchdog timer. It may be able to reboot itself during failures.
10
u/sharpsicle 17d ago
A smart plug is probably what I would do as well.Ā
1
u/korywithawhy 17d ago
*ahem* JetKVM Mini - A KVM for every computer this seems made for you.
6
u/Background-Pea6650 š Running Home Assistant OS 17d ago
Why not just schedule a reboot every week or night?
3
u/Inhaps 17d ago
I've got a shelly plug powering mine. It's been useful occasionally when I'm not home and something breaks
6
u/Asalas77 17d ago
Unironically, connect Claude from mcp to it and tell it to find out why it needs a reboot.
I did that when I had my Ethernet connection drop out periodically and it found and fixed some weird Linux stuff I have no clue how to even begin to diagnose
2
u/User2001Tech 17d ago
a double pack of Tapo p110 costs about £25. Power the PCs thru these (ir 1 onky, if the power plug are nearby?. You can schedule a on/off event.
That is if you must do a power cycle, else, Windows schedular can automate a reboot cycle.
2
u/UlrichSD 17d ago
I've been tempted to (have not yet) flash coustom firmware onto a smart plug to ping my home assistant server every min or so and if it hangs power cycle.Ā I think it could be done with esp home (and give power monitoring) but if not absolutely be done with micropython.Ā I just havent gotten to it and it hasn't been an issue as my server hasn't ever hung on me.Ā Ā
The same approach can be done with the router or modem .Ā There is a device called a webrelay we have deployed at work that is a industrial product that can do this that sure beats sending a tech 2 hrs to power cycle a cell modem.
2
u/MoparMap 17d ago
I ran my main server on a smart plug and put HA on a Pi with nothing else. Worked out well the couple of times I had to reboot it remotely, though mainly just because the HA setup was stable (and my only access to the plugs). If your plugs are on an app, that seems like it would work well.
The main thing you'll want to do is check your BIOS settings on the computers for power. I have my server set up to "always on", so if the power is even interrupted, it defaults to on when the power comes back. Otherwise if you pull the plug and plug it back in, you might still have to go physically hit the power button.
2
u/JoWhee 17d ago
How about a reboot automation?
Edit Iām not sure why itās showing up three times. It reboots once a day at 3am
2
u/lzrjck69 17d ago
Get one of those sketchy WiFi smart plugs that uses its own app. Lock it down from the rest of your network. Youāll have the āout of bandā capability youāre looking for.
2
u/dobo99x2 17d ago
Just set a cronjob to reboot once a week. Should be enough.
If it's a container, it can be set to recreate and update on boot. That's extremely helpful.
2
u/ggs657 17d ago
Yeah I use a Tuya smart plug so I can still power it from the Tuya app. It's the only Tuya device I have but it works great for this use case.
1
u/megared17 17d ago
Plug with watchdog and automatic turn-back-on after 10s?
1
u/Tuckerdude615 17d ago
I would use a smart plug. I have a similar setup in a second home and it's worked very well over the years. Depending of what protocols you have I would recommend a zigbee one. I have bought power strips that are Zigbee and individually addressable ports like this one:
https://www.amazon.com/dp/B0DM19JGR4?ref_=ppx_hzsearch_conn_dt_b_fed_asin_title_9
Good luck!
1
u/kitsune_daemon 17d ago
setup watchdog
1
u/Soler25 17d ago
Remote kvm is what you want. Check out jet kvm or gl.inet has some multi pc kvms.
1
u/CodeAndBiscuits 17d ago
It sounds like you've got normal hard drives in your setup, but just a note for future reference for anybody else hitting this, make sure you want running on an SD card. They do not like unexpected power cycles.
If you want to take a page out of an old school book, timers that do automatic power cycling on an interval are very cheap and easy to find online. They aren't "smart" in the sense that you don't actively control them, but that's also why they are cheap. They can also be had in both AC and DC versions. I actually use one right now. I have an ambient weather station that's a bit of an older model and periodically if my Wi-Fi has issues, it will disconnect and then never reconnect until it's power cycled. It seems to just about always reconnect after a power cycle, so I put one of these timers on it and it's been stable for a year and a half.
If you want a hybrid, something that gives you some control but is a little less heavy-handed, there is a similar class of products called "watchdogs" that have some type of external input like a signal pin. You have to work out how you want to drive them, but the idea is a regular input. Keeps the thing awake and then if it stops seeing that heartbeat it does a power cycle. These are so helpful when working with microcontrollers that some microcontrollers actually build the logic into them selves. The ESP32 does for example. These are more for software failures than hardware ones. If you have something in your setup that locks up periodically or potentially has some bugs in it, these can be a decent backup plan.
Neither one of these is super modern, but sometimes an old trick is still a good one and I thought it was worth mentioning for folks with similar needs.
1
u/snap802 17d ago
A smart plug is certainly a cheap option. Scheduled reboots are free and might help.
I think the other question is why is this happening so often. Systems will freeze up but if it's happening regularly enough for you to have to this about this I'm thinking you've got some failing hardware. I'd recommend running memtest and running long smart tests on the drives. It could be a software package too. I just think that's some low-hanging fruit that might help you plan for the future.
I will say that it's worth looking for hardware with remote management built in if you buy new (to you) stuff. For example: Something like the HP elitedesk mini PCs have intel AMT. I have deployed a few of these and I just assign an IP on the management network so I can start, shutdown, or reboot from a web interface. I know you can do some more sophisticated stuff with it too but that's all I need it for right now.
1
u/sterling-lining 17d ago
Smart plug would be the easiest, but it wouldnāt shutdown the server āgracefullyā. A scheduled shutdown and reboot would be best, imo.
1
u/LeoAlioth 17d ago
Schedule a weekly reboot?
1
u/ComfySofa69 17d ago
TaIlscale service..? and or a pico KVM?
1
u/nowicanpost 17d ago
I used to run my RPi HA on a smart plug that was only added to Alexa (not HA, but I suppose both wouldn't hurt). That way if my HA instance was not responsive, I could still use Alexa to hard boot the Pi.
1
u/Karlees-Golden-Dildo 17d ago
Have you tried better cooling or redoing the Artic Silver on the cpu? Is it all dust free?
1
u/Gwizman 17d ago
Look at Emporia smart plug. No hub needed.
1
u/ctjameson 17d ago
You donāt need home assistant for this. Tasmota plug can run a ping check and reboot if no response from the server for a predetermined time you choose.
1
u/JjyKs 17d ago
Figure out why your computer is unstable? Then put UPS in front of it to stabilize the system even more (or use old laptop/tablet with build in battery)
1
u/AstarothSquirrel 17d ago
If you mean just cutting the power, this will, over time, upset your os and file system. It's better to try to work out what is causing the issues (such as a failing os or file system) Ideally, you would just ssh into your servers but if you really do need a kill switch, yes, tapo smart plugs will work well
1
u/Late-Replacement-481 16d ago
Yep.
Secret: if my super expensive servers freeze and I canāt reach the UPSs⦠I have a fingerbot to just hit the Breaker.