[Custom Component] Tapo: Cameras Control

Hi guys, has anyone try to have an automation when motion is detected?
Ever since the new webhook implementation I can not make it work, I don’t even have a sensor entity the onlyone is select.tapo2_motion_detection in case I want to stop motion detection or adjust sensitivity

Using tapo C200 camera, wewest version of HA and Integration and my camera does detect it (via the tapo app)
Here are my entities for that camera:
button.tapo2_calibrate
switch.tapo2_flip
button.tapo2_format_sd_card
camera.tapo2_hd_stream
switch.tapo2_indicator_led
switch.tapo2_lens_distortion_correction
select.tapo2_light_frequency
button.tapo2_manual_alarm_start
button.tapo2_manual_alarm_stop
select.tapo2_motion_detection
button.tapo2_move_down
button.tapo2_move_left
button.tapo2_move_right
select.tapo2_move_to_preset
button.tapo2_move_up
number.tapo2_movement_angle
select.tapo2_night_vision
select.tapo2_patrol_mode
switch.tapo2_privacy
button.tapo2_reboot
camera.tapo2_sd_stream
siren.tapo2_siren
button.tapo2_sync_time
update.tapo2_update

Sorry (in advance) if my question seems dumb or obvious
Thank you

Read faq in readme. You can also disable webhooks.

Hi all, I have two C210 cameras attached to smart power plugs, which are disabled when I’m at home.
When cameras are powered off, I see continuous log messages like the following ones on home-assistant.log:

2023-05-29 17:21:56.475 ERROR (MainThread) [custom_components.tapo_control] HTTPSConnectionPool(host='192.168.0.109', port=443): Max retries exceeded with url: /stok=e3c9f56c8f0096f14e4db62d29a3afd0/ds (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x5d2ab628>: Failed to establish a new connection: [Errno 113] Host is unreachable'))

I would like to disable those messages, to avoid continuous writing to my external disk which cannot spin off anymore.
Is there any way to do it?

Are you writing only the log to that drive?

If anybody has missed this article and running a Tapo C200 with a firmware version prior 1.1.16. There was a CVE and you should update your firmware.

Hi,
I have the same problem with you. My Tapo C210 camera stopped working on Home Assistant. How you fix this problem. thanks a lot!

Hi!

I just read some posts about this great integration and I have simple question before I install and try to work with it :slight_smile:
Is it going to work if some of my cameras are working in a different WiFi network than my Home Assistant? I see all cameras in Tapo app.
Thanks for help!

Hi, as long as you can meet the criteria in prerequisites in readme yes. You will need to enter ip / hostname of camera and have it accessible on ports described.

This integration is fully local, cloud is not supported and never will be.

A couple of things that I probably should know but have no idea. Webhooks seems to be something that is already packaged with HA but do I need to config something? Install something?
When you reffer to homeassistant.onvif are you talking about the onvif integration? Do I need the onvif integration alongside this one to get the motion sensor working?
About http and https. Does this webhooks method still works if internal_url is in http and external_url is in https?
I know some of this may be dumb questions but I’m a bit lost with that readme and the motion sensor is not showing anywhere

Webhooks seems to be something that is already packaged with HA but do I need to config something?

No you do not need to configure anything except if experiencing issues - base URL or disabling webhooks depending on camera firmware and your setup.

When you reffer to homeassistant.onvif are you talking about the onvif integration?

Yes

Do I need the onvif integration alongside this one to get the motion sensor working?

No

About http and https. Does this webhooks method still works if internal_url is in http and external_url is in https?

Yes webhooks is supported if correct internal URL is set. You can enable debug logs for this integration and Onvif to see what URL is used for webhooks in case of issues.

the motion sensor is not showing anywhere

Make sure to read FAQ in readme. It should help you with this.

Hi, I’ve just installed the custom integration and tried to connect to one of my cameras, a TC70.

I’ve created a Device Account in the Tapo App, with a different username and password to the ones I used when I registered the app.

I got as far as entering the cloud password but got stuck there when it returned an “unknown error”.
The password I’m entering here is the one I used when I registered the Tapo app.

I’m wondering if it’s due to the ports described not being open to the camera/home assistant (not sure which).

Network
Following target TCP (v)LAN ports must be open in firewall for the camera to access your Tapo Camera from Home Assistant:
443 - HTTPS for control of the camera (services)
554 - RTSP to fetch video stream from the camera
2020 - ONVIF to track detected movement via a binary sensor
These are not WAN ports, DO NOT OPEN WAN PORTS VIA PORT FORWARDING. You might need to open (v)lan ports only if you know what all of this means.

Unfortunately for me, I don’t

know what all of this means

My network knowledge has not yet developed to the stage where I fully understand checking which ports are open so I’m wondering if you could point me in the right direction to check please.

UPDATE

so, I think I’ve opened those ports in my firewall, not sure Home Assistant can see them though as a simple Telnet command couldnt connect. Anyway, after doing that, I’m now getting this, which is different

Tapo

I’m using the password I use to sign into the Tapo app :man_shrugging:

Sorry for being such a network dufus.

Hi,

please close the WAN ports, you do not need to do it and it is a security risk.
Once you get unknown error, check logs.
If you get the error about invalid cloud password, the password you are entering is invalid. Try changing it and make sure camera is connected to the internet so it grabs the new one. Try verifying the password by signing out and in in the password.

1 Like

Done.

How can it be invalid when it allows me to login to the app?

Did this and still got the same error. I can view the camera through the app so I’m presuming that is through the Internet?

I keep getting a screen asking me to “sign up to a free trial of Tapo Care and get unlimited cloud storage”. Doss this mean I’m not actually connected to the internet until I sign up to this?

The unknown error didn’t come up this time. It went straight to the “invalid cloud password” error, despite me changing and verifying the password by logging out and logging in to the app again…and having access to the camera via the app.

How did you fix the connection failed problem?

First you created a Tapo account and logged into the Tapo app, then you added your camera to the Tapo app. That’s great.

Tapo has a paid service called Tapo Care, it would sync your camera through their servers and store all your recordings there, plus some additional services. If you want to pay for it and store your recording in the cloud, but the cameras have a limited amount of streams, so you use SD card, Tapo Care and/or HA. You cannot use all of them together.

So as a next step, you created an account for the camera, that is great as well. So you should have now, one Tapo account (email and password), and a local camera account (username and password).

You need to use the username and password, and the Tapo account password, called Cloud Password. The integration will not use the internet, it will access the camera locally, but it needs that password for accessing some functions.

The camera needs to sync with Tapo cloud the Cloud password to have your latest Cloud password defined in the camera. That’s what invalid means.

Yes, that was step 1.

The plan is to use HA. I don’t like paying for things I don’t need :grin:

Exactly right. I use my email address and password to log into the app and I created a separate account for the camera…a “Device Account” as it’s called in the app with a different username and password.

I’ve done that…twice… and got the invalid password message…twice…

How can I check if the camera has synced with Tapo Cloud?

There is clearly something not right on my end, but I can’t figure out what it is.

Do you use any special characters, but letters and numbers in your username or password(s)?

This is the last thing what I can think of. Also, maybe just try to restart the camera.

You’ve nailed it, thank you.

I did a bit more digging yesterday and found this on the Tapo website:

So, I changed both passwords to exclude any special characters and tried again. Initially, it still didn’t work, but after leaving it overnight I tried again today and it worked.

It’s a shame really, because I like really strong passwords and having to dumb them down seems counterintuitive to me.

Anyway, it works now so I’ll know in future.

Thanks to everyone who helped :+1:

1 Like

Look at passphrases to change your concept on strong passwords.

Passphrase vs Password: Cybersecurity Tips | Impact Networking.

2 Likes

Spectacular work.
my sincere congratulations for the hard work

I can connect my Tapo c210 and Tapo C225 cameras perfectly.

I only encountered two problems, but maybe I’m doing something wrong.

  • the first is that if I press on the image in the dashboard, the stream opens but the audio is not heard.

  • second thing, since there are no command keys, I had to create a manual card with the following code:

type: picture-glance
title: c225_2
camera_image: camera.c225_2_hd_stream
entities:
  - entity: camera.c225_2_hd_stream
    icon: mdi:arrow-left-drop-circle-outline
    tap_action:
      action: call-service
      service: tapo_control.ptz
      service_data:
        entity_id: camera.c225_2_hd_stream
        pan: LEFT
  - entity: camera.c225_2_hd_stream
    icon: mdi:arrow-up-drop-circle-outline
    tap_action:
      action: call-service
      service: tapo_control.ptz
      service_data:
        entity_id: camera.c225_2_hd_stream
        tilt: UP
  - entity: camera.c225_2_hd_stream
    icon: mdi:arrow-down-drop-circle-outline
    tap_action:
      action: call-service
      service: tapo_control.ptz
      service_data:
        entity_id: camera.c225_2_hd_stream
        tilt: DOWN
  - entity: camera.c225_2_hd_stream
    icon: mdi:arrow-right-drop-circle-outline
    tap_action:
      action: call-service
      service: tapo_control.ptz
      service_data:
        entity_id: camera.c225_2_hd_stream
        pan: RIGHT
  - entity: camera.c225_2_hd_stream
    icon: mdi:eye-outline
    tap_action:
      action: call-service
      service: tapo_control.set_privacy_mode
      service_data:
        entity_id: camera.c225_2_hd_stream
        privacy_mode: 'off'
  - entity: camera.c225_2_hd_stream
    icon: mdi:eye-off-outline
    tap_action:
      action: call-service
      service: tapo_control.set_privacy_mode
      service_data:
        entity_id: camera.c225_2_hd_stream
        privacy_mode: 'on'
  - entity: camera.c225_2_hd_stream
    icon: mdi:power
    tap_action:
      action: call-service
      service: tapo_control.reboot
      service_data:
        entity_id: camera.c225_2_hd_stream

The keys appear correctly:
image

but if I press them the following error comes out:
image

Where am I doing wrong?