[Custom Component] Tapo: Cameras Control

Hi, thank you!

  1. See FAQ in readme regarding sound, the reason is explained there and also the solution to get sound
  2. You are using old methods, see examples here HomeAssistant-Tapo-Control/examples/EXAMPLES_LOVELACE.md at c69dd858f275a732fa7155afa982be25e3647db0 · JurajNyiri/HomeAssistant-Tapo-Control · GitHub
1 Like

Thank you for the link,

I see examples for privacy mode,
but I see no example for pan and tilt.

sorry I’m not very practical.

Here.

but this works if i install webrtc.

I thought it could be used natively without webrtc

The only part from that example using webrtc is

type: custom:webrtc-camera
entity: camera.bedroom_sd

you will need to replace that and adapt it to your use case.

now appear this:
image

That is the part you need to change as I said above… Use a different card, you do not have custom:webrtc-camera card. You can use for example picture-entity card.

hello,

i tried to use the webrtc card with the from the integration provided entity, but i always get a error

the integration works fine and when i click under devices the stream starts.

 - type: custom:webrtc-camera
          entity: camera.haustur_tapo310_hd_stream

it’s incredible.

I didn’t see your reply yesterday.

I only read this morning.

I was going to change the card when I find that it magically works!

how is it possible that last night webrtc gave an error while this morning it works fine?
I haven’t changed anything.

Hi Jiraj,
after webrtc’s magical self-recovery,
I integrated several items successfully.

this is my final corrected code:

type: custom:stack-in-card
cards:
  - type: custom:webrtc-camera
    entity: camera.c225_1_sd_stream
  - type: horizontal-stack
    cards:
      - type: button
        icon: mdi:arrow-left-drop-circle-outline
        tap_action:
          action: call-service
          service: button.press
          service_data:
            entity_id: button.c225_1_move_left
        entity_id: camera.c225_1_sd_stream
      - type: button
        icon: mdi:arrow-up-drop-circle-outline
        tap_action:
          action: call-service
          service: button.press
          service_data:
            entity_id: button.c225_1_move_up
        entity_id: camera.c225_1_sd_stream
      - type: button
        icon: mdi:arrow-down-drop-circle-outline
        tap_action:
          action: call-service
          service: button.press
          service_data:
            entity_id: button.c225_1_move_down
        entity_id: camera.c225_1_sd_stream
      - type: button
        icon: mdi:arrow-right-drop-circle-outline
        tap_action:
          action: call-service
          service: button.press
          service_data:
            entity_id: button.c225_1_move_right
        entity_id: camera.c225_1_sd_stream
  - type: vertical-stack
    cards:
      - type: entities
        entities:
          - select.c225_1_move_to_preset
      - type: entities
        entities:
          - select.c225_1_night_vision
      - type: entities
        entities: 
          - button.c225_1_reboot
      - type: entities
        entities:
          - switch.c225_1_privacy

If my solution helps anyone else I just wanted to explain that the management of the “positions” and of the “day/night mode”, being them “selections”, need more space to be placed in the widget.
it was possible to wrap the command with the “vertical-stack” command
as, remaining under the “horizontals” there was not enough space for selection (see photo below):

image

I hope my solution can help someone else in the future. Enjoy

Hi, yes there is, just put another card below in the list of custom:stack-in-card card

I’d like to ask one last question even if I think it’s off-topic

Re-getting the transparent background as in the previous version is it possible?

old_version transparent:
image

new_version black:
image

you can basically do whatever you want, depending upon which card you choose, could you please “transfer/move” your Card questions to respective Card-Topic, people “tracking” this “Integration Page” to stay tuned with the Integrations options and cons. and you have now cluttered it for 4 days basically with your card questions, Please !, create another topic, or search in/for specific card, card_mod, nested cards(in stack) etc. … and post in this “Integration Page” if you have ideas or problems … With the Integration !

2 Likes

Already any option for the IA person detection sensor?

Not yet, there is a possible method now in pytapo called tapo.getEvents() which returns latest events, but it has not been implemented / tested properly yet.
More info: Feature Request: Add multiple events detections · Issue #304 · JurajNyiri/HomeAssistant-Tapo-Control · GitHub

1 Like

Hi Juraj,
first of all I would say thank you for this great integration! Although I’m a newbe to HA I could get it running in a few minutes - btw. I’m using a C310.
One question I have, probably related to my few knowledge of HA: I would like to have displayed the ‘last_changed’ info of the binary motion detection sensor but didn’t find a way of doing that. I’ve a picture glance card similar to your top third example where one of your entities is
entity: binary_sensor.bedroom_motion
I was trying several variations of
{{ states.binary_sensor.bedroom_motion.last_updated }}
but didn’t succeed. Do you have any idea what I’m doing wrong?
Thanks in advance and best regards
Martin

Hi and thanks for this integration, installed in on my HA today.

I’m running a C310 (Firmware: 1.3.2 Build 220901 Rel.74359n(4555) Hardware: 1.0) and a C320WS (Firmware: 1.0.5 Build 230316 Rel.55457n Hardware: 2.0).

On the C310 Manual Alarm Start/Stop work fine but it does not work on the C320WS.

I get the following trace in the log:

Start manual alarm

2023-06-29 16:30:11.746 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547618573392] Error: Parameter to get/do does not exist, Response: {"error_code": -40106}
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 205, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1910, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1950, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 226, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 811, in entity_service_call
    future.result()  # pop exception if have
    ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1034, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 851, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/button/__init__.py", line 116, in _async_press_action
    await self.async_press()
  File "/config/custom_components/tapo_control/button.py", line 120, in async_press
    await self._hass.async_add_executor_job(self._controller.startManualAlarm)
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pytapo/__init__.py", line 953, in startManualAlarm
    return self.performRequest(
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pytapo/__init__.py", line 183, in performRequest
    raise Exception(
Exception: Error: Parameter to get/do does not exist, Response: {"error_code": -40106}

Stop manual alarm

2023-06-29 16:30:26.855 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547618573392] Error: Parameter to get/do does not exist, Response: {"error_code": -40106}
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 205, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1910, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1950, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 226, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 811, in entity_service_call
    future.result()  # pop exception if have
    ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1034, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 851, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/button/__init__.py", line 116, in _async_press_action
    await self.async_press()
  File "/config/custom_components/tapo_control/button.py", line 130, in async_press
    await self._hass.async_add_executor_job(self._controller.stopManualAlarm)
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pytapo/__init__.py", line 959, in stopManualAlarm
    return self.performRequest(
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pytapo/__init__.py", line 183, in performRequest
    raise Exception(
Exception: Error: Parameter to get/do does not exist, Response: {"error_code": -40106}

Home Assistant 2023.6.3
Operating System 10.3

Hello

I want to be able to add different camera but they are remote (over wan) How I can do that? Is there any way to do it?

I managed to add 1 but for more than one from the same public ip it’s not possible because the port i cannot forward 2020/443/554 to multiple camera.

thanks

Just a shout out to thank you for a very well integrated integration.

1 Like

Hi there,

I use the integration since two weeks.
it works good, but if I click on the live stream I had to wait 5-10 secs until the camera is activated.
Is there a way to reduce the time?

Regards