yi-hack_ha_integration icon indicating copy to clipboard operation
yi-hack_ha_integration copied to clipboard

Privacy without error logs in Home Assistant

Open McGiverGim opened this issue 4 years ago • 10 comments

Hi! The new privacy switch is great, I use it a lot, but I've a "cosmetic" problem with it. When enabled, the Home Assistant log shows a lot of errors because is trying to connect with the camera RTSP or snapshot stream.

2021-09-30 09:14:48 ERROR (stream_worker) [libav.tcp] Connection to tcp://192.168.100.20:554?timeout=5000000 failed: Connection refused
2021-09-30 09:14:48 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream rtsp://****:****@192.168.100.20/ch0_0.h264

Is there a way to tell Home Assistant that the camera image is down, stopped or suspended? In this way it will not try to connect with it I suppose. Thanks!

McGiverGim avatar Sep 30 '21 07:09 McGiverGim

I will check it.

roleoroleo avatar Sep 30 '21 09:09 roleoroleo

The generic camera integration (https://www.home-assistant.io/integrations/camera/) has a service turn_off that I suppose internally will do it. But I don't know if it is implemented in some of the real camera implementations.

Thanks for looking at it!!

McGiverGim avatar Sep 30 '21 10:09 McGiverGim

I can't see errors in the logs. What is the event causing the error? When you use a lovelace card?

roleoroleo avatar Sep 30 '21 12:09 roleoroleo

Yes, I have one standard lovelace image card (hidden when privacy is on), but I don't need to go to the UI to produce the errors. They appear in the log each few seconds. Maybe it loads the camera in the background? I don't know. I have too a very basic face recognition added on top of the camera: https://www.home-assistant.io/integrations/dlib_face_detect/ I don't know if it can hurt...

McGiverGim avatar Sep 30 '21 14:09 McGiverGim

What's your debug configuration? Could you try to disable temporarily the face detection feature?

roleoroleo avatar Sep 30 '21 14:09 roleoroleo

I don't have any debug configuration, so I have it default.

I tried to disable the face detection and the error continues.

This is what I get just enabling the privacy switch:

2021-09-30 16:46:56 ERROR (stream_worker) [homeassistant.components.stream.worker] Error demuxing stream:
2021-09-30 16:47:06 ERROR (stream_worker) [libav.tcp] Connection to tcp://192.168.100.20:554?timeout=5000000 failed: Connection refused
2021-09-30 16:47:06 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream rtsp://****:****@192.168.100.20/ch0_0.h264

It's weird that you can't reproduce it :( maybe if others have the same problem can point to something more...

McGiverGim avatar Sep 30 '21 14:09 McGiverGim

I think you shouldn't see the error, if you are not "consuming" the stream. Because ha shouldn't open a connection. Is there another client application connected to ha?

roleoroleo avatar Oct 01 '21 06:10 roleoroleo

No that I'm aware off. It happened to me too when I was using the ONVIF integration and deactivate the camera using the web service.

Do you have enabled the Preload stream? Maybe if enabled the stream is accessed always...

image

McGiverGim avatar Oct 01 '21 08:10 McGiverGim

Enabling preload the error appears. But I don't know ho to fix it. turn_on, turn_off, is_on and is_off are already implemented. Do you know a cam that doesn't show errors, I could take it as an example.

roleoroleo avatar Oct 01 '21 09:10 roleoroleo

No, I don't know of other cameras... Maybe it's a bug on the Home Assistant side?

McGiverGim avatar Oct 01 '21 11:10 McGiverGim

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Apr 04 '24 02:04 github-actions[bot]