HomeAssistant-Tapo-Control icon indicating copy to clipboard operation
HomeAssistant-Tapo-Control copied to clipboard

Bug: Attribute privacy_mode reported on even if privacy mode is off

Open monotonus opened this issue 3 years ago • 7 comments

Describe the bug I have a template sensor which tracks the camera attribute "privacy_mode" in order to use it in some automations. But the last days switching the camera off when coming home with the condition privacy_mode = off doesn't work because it's still reported as "on", but I can see the camera view.

The camera is rebooted automatically every night.

To Reproduce Open a camera with active stream and view the attribute if it's reported on or off. Should be off.

Expected behavior A clear and concise description of what you expected to happen.

Log no logs available

Camera (please complete the following information):

  • Device Model: C200
  • FW: 1.18 Build 210425 Rel.66776n(4555)

Using stream component yes

Camera works through onvif component OR different cameras work in general yes

Camera has all attributes filled out properly in developer tools access_token: ************************************* model_name: C200 brand: TP-Link motion_detection: on device_type: SMART.IPCAMERA device_model: C200 device_name: C200 1.0 device_info: C200 1.0 hw_version: 1.0 sw_version: 1.1.8 Build 210425 Rel.66776n(4555) device_alias: tapo_camera features: 3 barcode: mac: 60-32-B1-******************* dev_id: 80216E6167 oem_id: 890***********************************839C2 hw_desc: 4857000000001 user: administrator motion_detection_sensitivity: normal privacy_mode: on alarm: off alarm_mode: light led: on day_night_mode: auto auto_track: on presets: '1': kueche '2': wand '3': sofa '4': esszimmer

friendly_name: tapo_camera - HD icon: mdi:cctv entity_picture: /api/camera_proxy/camera.tapo_camera_hd?token=*********************** supported_features: 3

HASS Environment Version | core-2021.7.2 Installationstyp | Home Assistant Container

Additional context Add any other context about the problem here.

monotonus avatar Jul 30 '21 12:07 monotonus

Update: I've seen that the time was also out of sync. So I just reloaded the tapo integration in home assistant and all is working fine again.

So the problem is somewhere else.

monotonus avatar Jul 30 '21 12:07 monotonus

I can confirm the behavior. Same camera model. A reboot of the camera doesn't resolve the issue. A reload of the integration, as already described above, does resolve it.

In my opinion, this indicates an issue within the integration.

zimjjan avatar Sep 08 '21 07:09 zimjjan

Additionally, after a reload, the video stream is missing which effectively forces me to reboot the whole hass instance.

Logger: libav.rtsp
Source: components/stream/worker.py:321
First occurred: 9:16:56 (10 occurrences)
Last logged: 9:19:27

method SETUP failed: 406 Not Acceptable

Logger: homeassistant.components.stream.worker
Source: components/stream/worker.py:323
Integration: Stream (documentation, issues)
First occurred: 28. August 2021, 3:00:40 (70 occurrences)
Last logged: 9:19:27

Error opening stream rtsp://****:****@192.168.178.94:554/stream2
Error opening stream rtsp://****:****@192.168.178.94:554/stream1

zimjjan avatar Sep 08 '21 07:09 zimjjan

I am also seeing this issue for my C200 When it happens I can't set the privacy mode because it is always on and therefore home assistant is always trying to turn it off

timothygee avatar Nov 25 '21 03:11 timothygee

I have not been able to replicate this, but have been keeping an eye on it. Actually I have both automations and lovelace condition cards set up according to privacy mode and it's been flawless. I did not update my cameras for a long time now so that might be a factor.

I think it might be a combination of both some issue in camera and recovery of integration on failures. Integration recovery failure is indicated by reloading an integration solving it. Issue with camera is indicated by 406 on stream. What is happening there, is integration (in case of stream enabled) just providing rtsp link to Home Assistant, nothing else. Maybe rebooting the Home Assistant instance frees up camera resources. I think I saw 406 when I had too many streams opened at once, or camera just decided to bug out.

In a current state this is very hard for me to debug. I will leave this opened in case someone who can both experience the issue and debug (and fix?) comes by.

JurajNyiri avatar Dec 13 '21 23:12 JurajNyiri

I'm trying a few things with this as I had the issue with 1 camera. I suspect it is coming from the hass.async_add_executor_job(controller.getPrivacyMode).

nialfrancis avatar Jan 18 '22 07:01 nialfrancis

I hit this issue almost daily on a C200 also. I have had auto reboot on, rebooting at night, perhaps restarting messes with things?

ahaverty avatar Sep 23 '22 10:09 ahaverty

Same here for me, can activate privacy mode, toggle but cannot de-activate, only from the TAPO APP

markbooth73 avatar Oct 20 '22 12:10 markbooth73

Closing this issue. If anyone is still encountering non-functional switch for privacy mode reopen new issue. If testing for any issues, make sure to:

  1. Close Tapo app
  2. Close any other application using streams from camera
  3. Reboot Home Assistant
  4. Reboot camera
  5. Watch stream while switching privacy toggle. It is normal if it comes back to previous state as camera is not fast to report new changes and it might report old, but, eventually it should switch and update to correct state.

JurajNyiri avatar Oct 20 '22 22:10 JurajNyiri