At the moment there is no any way to turn on / off cameras correctly. For example, in case the cameras are used as security system when there is nobody in the house but they should be turned off when somebody at home, the only way is to turn them on and off by power switch. In this case there are two issues:
- HA continuously generates error in log when camera power is off:
2021-04-19 19:08:29 ERROR (stream_worker) [libav.tcp] Connection to tcp://192.168.0.100:5000?timeout=5000000 failed: Host is unreachable
- It takes a lot of time for HA to see the camera again when its power is on. Moreover, lovelace often should be refreshed in web browser for it. Or the next error continuously appears in HA log even if lovelace shows the camera view correctly (!!):
2021-04-19 19:08:29 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream rtsp://admin:[email protected]:5000/h264Preview
Thus, it would be great to add native mechanism how to turn on and turn off cameras via HA.