Can I use TP-Link HS-105 (Kasa Smart plug) to reset my Modem?

Hi to all in the forum, I would like to known if I can create a routine with the home assistant that reset my modem when the home assistant detect that is no ping to google or other host. Like it ping 10 times and if received no answer turn off and on the modem to reset it, and if no ping answer, try again in one hour. All this with a Kasa Smart Plug (TP-Link HS-105). Thanks with any idea.

Yes, you can do this.