Take a look at this product on Amazon. It can reboot your router on a schedule or whenever internet connectivity goes down. I've used it for a while at my house, and now several of my neighbors use it too.
EZOutlet is what you want then. I use a few for that sort of thing. I have one my router that if it can't ping specific IPs, it will toggle the power outlet and reboot the router.
https://www.amazon.com/dp/B01GOOE8OY/ref=dp_cerb_1 sometimes its called this but mine says EZoutlet.
you can also use a pihole or raspberry pi to do this.
Nice. Expensive though!
I just saw this too. https://smile.amazon.com/3Gstore-Remote-Power-IP-Switch/dp/B01GOOE8OY/
I hate putting in amazon links, but I did find two options... Not sure if these will work with HA out of the box but it looks like they have a web interface!
​
https://www.amazon.com/3Gstore-Remote-Power-IP-Switch/dp/B01GOOE8OY/
https://www.amazon.com/3Gstore-Remote-Power-IP-Switch/dp/B00LLVQ9OI
Not the solution you're looking for, but this is what I use - resets my cable modem automatically when connectivity is lost:
https://www.amazon.com/3Gstore-Remote-Power-IP-Switch/dp/B01GOOE8OY/
There is also this:
https://www.amazon.com/3Gstore-Remote-Power-IP-Switch/dp/B00LLVQ9OI/
Here are a couple of choices that are slightly less dear:
I have one of these to control my cable modem. When my provider, Cox Cable, upgraded the firmware on the SB6190, they removed the capacity to reboot/restart the modem from the web interface :-(
My modem is in a media closet, making it onerous to power-cycle, if/when the need arises. I've had the remote IP switch for a year, and its been worth the ~$70 I spent on it.
IP power switch: $69
Network it to your OctoPi via an ethernet cable (set static addresses on the same network on both ends). This is assuming you are using wireless to otherwise connect to your OctoPi.
Create a simple bash script to turn on the switch via an HTTP request.
Create a second script to turn off the switch.
Edit /home/pi/.octoprint/config.yaml to add the buttons:
- action: powerup command: power_up.sh name: PowerUp - action: poweroff command: power_off.sh name: PowerOff
I haven't tested it but you could probably forgo the bash scripts and put the HTTP request right in the config.