I have camera integrated using [platform: mpeg]. But honestly I do not use it often, actually it is an old android phone. Once it is disconnected the log file is flooded with connectivity error messages. The only way to get rid of them is to comment out the integration in configuration.yaml and then uncomment-comment and so on.
Would be cool I could press a button to suspend its integration somehow : turn it on/off to get rid of the connection errors. Is it feasible?
I have a couple of android phones I have used as IP camera’s but I use them very rarely. If I don’t use them then I just comment out the entry in my camera config until the next time I need them.
I got an idea to use logger.set_level service instead. Two scripts to change logging to FATAL/INFO for camera components (names are taken from log entries) solves the issue. The scripts then are triggered from automation once the camera changes its status. Also, the scripts can be embedded into a switch with binary_sensor to force logging level change and display its current status on lovelace.
- service: logger.set_level
data:
pydroid_ipcam: fatal # set to 'info' to enable proper logging
homeassistant.components.mjpeg.camera: fatal
All works as a Swiss watch but sometimes the log filled with pyton errors due to connection problem with camera. Other then that I am fine.