To power cycle your modem, I recommend a smart-plug with AUTO-ON functionality. I have had very good success with this setup. It takes a little additional work to set the advanced setting (the auto-on function), but highly reliable as it doesn't depend on an external input. When you turn it off, it just turns back on after a pre-set delay.
Here's a detailed description with a sample plug that has this feature as an advanced setting (ZOOZ ZEN25 double plug).