[Custom Component] Tapo: Cameras Control

I am using C510W
tapo_control.set_privacy_mode not found.

It no longer exists for years now. Check readme.

1 Like

I solved the problem right away.
thank you

Hi guys,

I went through the thread and the github ready and FAQs but didnt get an answer yet.

My cameras (310 and 210) were working fine, just following the integration. But a couple of days ago I have an integration error and I am not able to reconnect the cameras again.

It is all fully accessible via the tapo app but in home assistant it’s not possible to get the cams back.

I set a static IP, reinstalled the cams and the integrations a couple of times, changed login details for camera and tapo cloud but without success.

Is there any idea?

Thank you in advance!
Jonas

Post logs.

1 Like

I hope this is the correct log you asked for:

`2023-08-20 12:36:09.457 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry 192.168.1.150 for tapo_control
Traceback (most recent call last):
File “/usr/local/lib/python3.11/site-packages/yarl/_url.py”, line 191, in new
port = val.port
^^^^^^^^
File “/usr/local/lib/python3.11/urllib/parse.py”, line 182, in port
raise ValueError(f"Port could not be cast to integer value as {port!r}")
ValueError: Port could not be cast to integer value as ‘local’

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 388, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/config/custom_components/tapo_control/init.py”, line 186, in async_setup_entry
if isUsingHTTPS(hass):
^^^^^^^^^^^^^^^^^^
File “/config/custom_components/tapo_control/utils.py”, line 46, in isUsingHTTPS
base_url = get_url(hass, prefer_external=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/network.py”, line 145, in get_url
return _get_internal_url(
^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/network.py”, line 221, in _get_internal_url
internal_url = yarl.URL(hass.config.internal_url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/yarl/_url.py”, line 193, in new
raise ValueError(`

Report this to Home Assistant github issues. This is not this integration issue, HA helper function is failing to retrieve URL for your HA instance.

1 Like

Version 5.3.0

↱↲ Media Sync

Integration is capable of synchronizing recordings for fast playback.

Synchronization is turned off by default, you can browse media stored on camera and request it to be played. However, downloading is rather slow, so it is a good idea to enable media synchronization in background. That way, you will be able to play any synchronized media from camera instantly.

You can enable this setting by navigating to Home Assistant Settings → Devices and clicking on Configure button next to the Tapo device you wish to turn media synchronization on for.

You need to also define the number of hours to synchronize. Unless it is specified, synchronization does not run.

Finally, you are able to set the storage path where the synchronized recordings will be stored (defaults to /config/.storage/tapo_control).

New Features

  • Ability to synchronize media recordings
  • Add #383: Ability to configure order of days in media browser
  • Add #298: Turn on or off the Tapo camera control notifications
  • Add #377: Support Floodlight Control on Tapo C320WS HW2.0
  • Add #274: Ability to set digital sensitivity value for motion detection

Fixes

  • Fix: Edge case where integration crashed and required reboot after configuration update
  • Fix: Edge case where pytapo was not able to retrieve user id for recordings
  • Fix #356: Recordings stop working after some time

Breaking Changes

  • Entities which are not controllable with privacy mode turned on will now become unavailable when privacy mode is turned on
1 Like

Just as a feedback, I got this response from the HA dev team:

This is an issue in a custom component thus I am going to close this.
Apparently the port passed into this transformation function is “local” which isn’t a port, thus it raises an error.
The problem lies in ValueError: Port could not be cast to integer value as ‘local’ .

That is not correct, I answered in the issue.

Sorry, I need help!
I bought a Tapo 210 camera and have been using it in Home Assistant through motionEye without any problems.
Today I found this integration that I found very interesting, but when installing the camera it forces me to have a cloud Tapo account, which I don’t have, and I’m not interested, because I want everything to work locally.
Is there any way to solve the problem, or is it better to give up on the integration.
Thanks a lot for the help

Hi, you have cloud account. It is the email and password you are signing in with to the official app. Camera required password from it as explained in the config flow.

1 Like

Thank you very much, I did not understand this nuance, now everything works perfectly.
I was convinced I needed a paid account to work.
With your excellent help I managed to get everything working and I’m very happy.
Thanks

1 Like

Hi, thanks for the awesome integration once again. I’m liking the media sync feature except that I seem to be encountering some issues. I want the recordings to be synced to an external hardrive that I have mounted to home assistant, I can view it in the “Media” tab, I have created a folder where I would like the integration to save the recordings, however it seems like the integration is failing, what could I be doing wrong? I have enoutered this in the logs:

This error originated from a custom integration.

'Logger: custom_components.tapo_control
Source: custom_components/tapo_control/init.py:676
Integration: Tapo: Cameras Control (documentation, issues)
First occurred: 8:10:43 AM (16 occurrences)
Last logged: 8:29:43 AM

Recording is currently in progress.
Failed to get file from cold storage: /usr/share/hassio/media/externaldrive/CameraRecordings//videos/1693030116-1693030329.mp4’

Your assistance is greatly appreciated.

Have you tried stop Recording ?, or do you assume that you can record direct to both card and external storage ?

have motion-based recording so when there is not motion I assume it would stop. Also, I thought the features works as follows, the camera records and saves to the SD card, then this integration downloads the recordings to the specified location? It seems to work if I don’t specify a location and it syncs the recordings to the default location in the “config” folder but I wouldn’t want it there as it will then fill up my main drive.

I don’t know your settings, as i also don’t know your settings/preferences for your external storage

******* UPDATE *******

I power cycled one of the cameras and the motion detection came back :roll_eyes:

Never underestimate the power of “switch it off and switch it back on again” :joy:

**** END UPDATE ******

Is anyone having issues with motion sensors on their cameras?

Three of my six cameras are reporting that their motion sensor entities are no longer being provided by the integration. I’ve not changed any of the camera settings, I just happened to notice that theses entities were "unavailable" yesterday. I’ve tried reloading the affected cameras but no change.



Log entries show:

Logger: homeassistant.config_entries
Source: helpers/entity_component.py:187
First occurred: 06:52:57 (17 occurrences)
Last logged: 07:23:58

Error setting up entry 192.168.0.94 for select
Error setting up entry 192.168.0.94 for siren
Error setting up entry 192.168.0.94 for update
Error setting up entry 192.168.0.94 for binary_sensor
Error setting up entry 192.168.0.94 for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 388, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 132, in async_setup_entry
    return await component.async_setup_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 187, in async_setup_entry
    raise ValueError("Config entry has already been setup!")
ValueError: Config entry has already been setup!

and:

This error originated from a custom integration.

Logger: custom_components.tapo_control
Source: custom_components/tapo_control/utils.py:1129
Integration: Tapo: Cameras Control (documentation, issues)
First occurred: 06:56:10 (1 occurrences)
Last logged: 06:56:10

Trying to create motion sensor but motion listener not set up!

and:

This error originated from a custom integration.

Logger: homeassistant.config_entries
Source: custom_components/tapo_control/__init__.py:594
Integration: Tapo: Cameras Control (documentation, issues)
First occurred: 06:55:29 (1 occurrences)
Last logged: 06:55:29

Error setting up entry 192.168.0.94 for tapo_control
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 388, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tapo_control/__init__.py", line 594, in async_setup_entry
    timeCorrection = await hass.async_add_executor_job(
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError: aiohttp connection lost

I´ve understood the entity will not be there after a restart and only will appear when triggered at least once. So what I used to do is reboot and then trigger it to have it appear.

1 Like

Hi all,

I am struggling to record videos triggered by the motion detection of a C310.

My research didn’t show up a proper solution. The scenario is probably the common one to record the video after motion detection with a lookback.

What I experience is that the record itself works great but it starts right after the motion has finished. So no lookback and actually no capture of the motion sequence.

Here are my current settings:


service: camera.record
data:
  duration: 50
  lookback: 20
  filename: /media/Balkon_rechts_{{ now().strftime("%Y%m%d-%H%M%S") }}.mp4
target:
  entity_id: camera.balkon_rechts_hd_stream

Are there any tweaks I missed?