[Custom Component] Tapo: Cameras Control

I only has this 1 “warning” and it’s on the cam Edit: (where i had forgotten to put in the sd-card :grinning_face_with_smiling_eyes:, and “motion detection on” and also indicating "Update of sensor.tpc1_recordings_synchronization is taking over 10 seconds
( and only during startup )

Thou still i only have about 30seconds for the integration to start, where you are up in +6 min only for the update: camera/switch
Thou i wonder why you have 6 camera + 6 switches , but only 5 Cams, you say

EDIT: How did you setup/configured your cams ? did you enabled “webhooks” and running your HA over https ?

So, this morning’s issue is one camera that stubbornly does not want to Initialise.

I have 6 cameras all wifi connected including 1 x TC70 and 5 x TC60. One of my TC60s just does not want to play today despite multiple attempts at reloading. All the others are fine. They have all been working until a HA restart this morning to update some HACS integrations. Now I have 1 camera not initialising. The other 5 are working fine. Logs show:

2023-08-10 07:10:02.261 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.seans_room_camera_sd_stream] Error from stream worker: Error opening stream (HTTP_OTHER_4XX, Server returned 4XX Client Error, but not one of 40{0,1,3,4}) rtsp://****:****@192.168.0.107:554/stream2
2023-08-10 07:11:42.640 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.seans_room_camera_sd_stream] Error from stream worker: Error opening stream (HTTP_OTHER_4XX, Server returned 4XX Client Error, but not one of 40{0,1,3,4}) rtsp://****:****@192.168.0.107:554/stream2
2023-08-10 07:13:33.048 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.seans_room_camera_sd_stream] Error from stream worker: Error opening stream (HTTP_OTHER_4XX, Server returned 4XX Client Error, but not one of 40{0,1,3,4}) rtsp://****:****@192.168.0.107:554/stream2
2023-08-10 07:13:59.186 WARNING (SyncWorker_58) [homeassistant.components.waze_travel_time.sensor] Error on retrieving data: empty response
2023-08-10 07:15:33.383 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.seans_room_camera_sd_stream] Error from stream worker: Error opening stream (HTTP_OTHER_4XX, Server returned 4XX Client Error, but not one of 40{0,1,3,4}) rtsp://****:****@192.168.0.107:554/stream2
2023-08-10 07:17:43.748 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.seans_room_camera_sd_stream] Error from stream worker: Error opening stream (HTTP_OTHER_4XX, Server returned 4XX Client Error, but not one of 40{0,1,3,4}) rtsp://****:****@192.168.0.107:554/stream2
2023-08-10 07:18:59.209 WARNING (SyncWorker_63) [homeassistant.components.waze_travel_time.sensor] Error on retrieving data: empty response
2023-08-10 07:20:04.139 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.seans_room_camera_sd_stream] Error from stream worker: Error opening stream (HTTP_OTHER_4XX, Server returned 4XX Client Error, but not one of 40{0,1,3,4}) rtsp://****:****@192.168.0.107:554/stream2
2023-08-10 07:22:34.458 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.seans_room_camera_sd_stream] Error from stream worker: Error opening stream (HTTP_OTHER_4XX, Server returned 4XX Client Error, but not one of 40{0,1,3,4}) rtsp://****:****@192.168.0.107:554/stream2
2023-08-10 07:23:42.821 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry 192.168.0.103 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 196, in async_setup_entry
tapoController = await hass.async_add_executor_job(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError: aiohttp connection lost
2023-08-10 07:24:42.860 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry 192.168.0.103 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 196, in async_setup_entry
tapoController = await hass.async_add_executor_job(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError: aiohttp connection lost
2023-08-10 07:25:14.808 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.seans_room_camera_sd_stream] Error from stream worker: Error opening stream (HTTP_OTHER_4XX, Server returned 4XX Client Error, but not one of 40{0,1,3,4}) rtsp://****:****@192.168.0.107:554/stream2

Hi, since I got my new C510w this week I have trouble building an automation that skips through my presets every x seconds.

The preset selection works fine when I select it manually in the dropdwon of the tapo cam entity.

When trying to implement the preset circulation in an automation the cam is moved to a specific preset (which is the first preset of the dropdown in ha, and the last preset in the tapo app) and then remains in that preset although the automation is triggered again.

I also tried with service input_select and select, both with next option leading to the same result.

This is my not working automation code

alias: Kamera Einfahrt
description: ""
trigger:
  - platform: time_pattern
    seconds: /20
condition: []
action:
  - device_id: da13f68b865a51202027f54388e51a67
    domain: select
    entity_id: 60f9332ee818790d6210bf9f03153df8
    type: select_next
    cycle: true
mode: single

you are triggering ones every hour (20 seconds past whole) Sorry im wrong here :wink:

Beside maybe you get more “answers” if you create a “Topic” in regards to “Automations” , there are bunch of more people using automations, than there are people having Tapo-Cams

1 Like

Thx for the reply, but since the automation is actually really simple I assume the missbehaviour is more tapo integration related than a general automation problem. Since the angle of the area to surveill is very assymetric I want the cam to stray from one preset to the next, because the normal patrol mode doesn’t really do the job.

ok, i was about to suggest “patrol” , but as i havent tried it i don’t know whether it swipes or move (in sections), also i don’t know whether 20 seconds is too short interval, and have you “manually” tried firing “select next” every 20 seconds,
in your ha-card ? ( do you have an entity called select_next_preset.your_tp_cam ? ) other vice you have to call each “Attribute” ( options: Marked position 1, Marked position 2, Marked position 3 )

Edit: maybe this will help (select.select_next)

1 Like

I can fired it manually way faster than a 20 seconds interval and it works fine. As mentioned in my first post I already tried select and input select - same result.

As for now I just manually programmed ever preset into the automation with delays in between, which works fine. Either there is an issue with the implementation of the tapo controller or there is a setting or condition/state which I don’t see.

Working automation:

alias: Kamera Einfahrt
description: ""
trigger:
  - platform: time_pattern
    minutes: /2
condition: []
action:
  - device_id: da13f68b865a51202027f54388e51a67
    domain: select
    entity_id: 60f9332ee818790d6210bf9f03153df8
    type: select_option
    option: Hoftor
  - delay:
      hours: 0
      minutes: 0
      seconds: 20
      milliseconds: 0
  - device_id: da13f68b865a51202027f54388e51a67
    domain: select
    entity_id: 60f9332ee818790d6210bf9f03153df8
    type: select_option
    option: Eingang
  - delay:
      hours: 0
      minutes: 0
      seconds: 20
      milliseconds: 0
  - device_id: da13f68b865a51202027f54388e51a67
    domain: select
    entity_id: 60f9332ee818790d6210bf9f03153df8
    type: select_option
    option: Tritt
  - delay:
      hours: 0
      minutes: 0
      seconds: 20
      milliseconds: 0
  - device_id: da13f68b865a51202027f54388e51a67
    domain: select
    entity_id: 60f9332ee818790d6210bf9f03153df8
    type: select_option
    option: Haustür
  - delay:
      hours: 0
      minutes: 0
      seconds: 20
      milliseconds: 0
mode: single

1 Like

And you did ofcause read the whole post/topic i linked to, and “followed” up upon those “threads” there right ? … ohh ok i see you still have 3 hours read time since you signed up, i fact since you “jumped in here”. so maybe you should “hold back” on your “assumptions” until you’ve read more about automations, service-calls etc.

And as i said, open a Topic, or feature request

1 Like

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