Dealing with an uplugged Camera


I have a camera in my house that is plugged into a smart plug. That plug is off when we are in, and on when the alarm is set. This works fine from a practical standpoint but throws constant errors in the log such as:

Stream connection failed: rtsp://
Connection to tcp:// failed: Host is unreachable

Usually I’d be content to just ignore the error, but Im having memory issues with my setup and the memory spikes occur at the same time as those messages appear. Does anyone know a good / sensible way of dealing with a missing stream source?