I've an external Webcam on wifi that occasionally loses its connection. I also have some basic home automation for lighting and a weather station, based on a Raspberry Pi running Node-RED.
The cam is pinged every 5 mins and if it doesn't respond, Node-RED power cycles a mains switch connected to it - and sends me an email! If the camera doesn't come back, the power is cycled up to a total of 5 times before I get a final email that says I need to take a look.