[Custom Component] Tapo: Cameras Control

Here is what is in the logs (searching tapo)

2022-10-07 15:00:35.607 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration tapo_control which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

homeassistant.requirements.RequirementsNotFound: Requirements for tapo_control not found: [‘onvif-zeep-async==1.2.0’].

homeassistant.requirements.RequirementsNotFound: Requirements for tapo_control not found: [‘onvif-zeep-async==1.2.0’].

homeassistant.requirements.RequirementsNotFound: Requirements for tapo_control not found: [‘onvif-zeep-async==1.2.0’].

Ok, then it is indeed a dependency issue. @JurajNyiri was there any bump of that onvif component recently which could cause this?

@brianj74 do you run any integration for cameras?

If you are running Home Assistant on linux machine and not supervised/Home Assistant OS/Docker you need to take care of packages yourself.

pip install onvif-zeep-async==1.2.0
2 Likes

Thank you - some progress. Now getting this error

Logger: homeassistant.util.package
Source: util/package.py:98
First occurred: 4:12:24 PM (3 occurrences)
Last logged: 4:12:31 PM

Unable to install package onvif-zeep-async==1.2.0: ERROR: Will not install to the user site because it will lack sys.path precedence to onvif-zeep-async in /snap/home-assistant-snap/527/lib/python3.10/site-packages

edit - have got it working wih rtsp credentials in the meantime, but the sensors would be super useful. hoping this sys.path precedence wont be too tough to reconfig. I did try uninstall the component and re add after the veep update

update - installed a vm with the HA container and transferred the backup. All good now

do these cameras integrate well with HA for basic notifications and recordings to view next day (eg overnight)? And if so is there a recommended model for outdoor use that works best with HA?

I’ve had battery powered before which is convenient but the lack of fast live view means I’ll probably go wired this time

C310/ C320 are the outdoor ones. They seem to work quite well (my integration issues aside)

Juraj,

The ‘tapo:camera controls’ integration had 3 entities.
After deleting it and then adding it again (the last one on github) I only have 2 entities left.
I miss the third: ‘binary sensor movement’
how to explain this problem

THANKS

Read faq in readme.

ok i found the 3 entities…

Curious how you’re finding the quality of the Tapo camera image. I picked up a C110 but it doesn’t have any better bitrate than my Wyze, and the image quality looks similar. Hoping it’s something that I overlooked.

What do you expect regarding image quality?

Just updated to v4.0 but nearly all my control is gone because of the changes - I know it’s to be expected and I’m not criticising the hard work, but it would be nice to have more updated examples, perhaps just the code for the examples in the release notes which look great btw. I can’t even figure out how to set a button to move the camera to a specific preset, all I have managed to do is create a new selector card but that’s useless to me. I also need to know how to make the move actions move the camera in smaller increments because at the moment my C200 moves far too much with each press.

Hello,

instead complaining…a little search on the “cards” docs…

i am not an expert but i made it within 15 minutes… : enjoy :wink:

Of course you need this custom card : custom:stack-in-card to install with HACS https://github.com/custom-cards/stack-in-card

type: custom:stack-in-card
cards:
  - type: picture-glance
    title: Bedroom
    camera_image: camera.cam_garage_int_sd
    camera_view: live
    entity: camera.cam_garage_int_hd
    entities:
      - entity: camera.cam_garage_int_hd
  - type: glance
    show_icon: true
    show_name: false
    show_state: false
    style: |
      ha-card.type-glance .entities, 
      ha-card.type-glance .entity {
        padding: 0px;
        margin: 0px;
      }
      ha-card.type-glance {
        margin-top: 14px;
      }
    entities:
      - entity: button.cam_garage_int_move_left
        icon: mdi:arrow-left-drop-circle-outline
        tap_action:
          action: toggle
      - entity: button.cam_garage_int_move_up
        icon: mdi:arrow-up-drop-circle-outline
        tap_action:
          action: toggle
      - entity: button.cam_garage_int_move_down
        icon: mdi:arrow-down-drop-circle-outline
        tap_action:
          action: toggle
      - entity: button.cam_garage_int_move_right
        icon: mdi:arrow-right-drop-circle-outline
        tap_action:
          action: toggle
  - type: glance
    show_icon: true
    show_name: false
    show_state: false
    style: |
      ha-card.type-glance .entities, 
      ha-card.type-glance .entity {
        padding: 0px;
        margin: 0px;
      }
      ha-card.type-glance {
        margin-bottom: 0px;
      }
    entities:
      - entity: switch.cam_garage_int_privacy
        icon: mdi:eye-off-outline
        tap_action:
          action: toggle
      - entity: select.cam_garage_int_night_vision
        icon: mdi:theme-light-dark
        tap_action:
          action: more-info
      - entity: select.cam_garage_int_light_frequency
        icon: mdi:sine-wave
        tap_action:
          action: more-info
      - entity: number.cam_garage_int_movement_angle
        icon: mdi:map-marker-distance
        tap_action:
          action: more-info
  - type: glance
    show_icon: true
    show_name: false
    show_state: false
    style: |
      ha-card.type-glance .entities, 
      ha-card.type-glance .entity {
        padding: 0px;
        margin: 0px;
      }
      ha-card.type-glance {
        margin-top: 14px;
      }
    entities:
      - entity: select.cam_garage_int_motion_detection
        icon: mdi:motion-sensor
        tap_action:
          action: more-info
      - entity: switch.cam_garage_int_auto_track
        icon: mdi:radar
        tap_action:
          action: toggle
      - entity: switch.cam_garage_int_indicator_led
        icon: mdi:car-light-high
        tap_action:
          action: toggle
      - entity: switch.cam_garage_int_lens_distortion_correction
        icon: mdi:google-lens
        tap_action:
          action: toggle
  - type: entities
    entities:
      - entity: binary_sensor.cam_garage_int_motion
        name: Motion Sensor
    style: |
      ha-card.type-entities {
        margin-right: 14px;
      }
      ha-card.type-entities #states {
        padding-top: 10px;
      }

result is :

3 Likes

Code examples are here.

Degrees for movement are set with the number entity exposed by integration.

Some example for script:

set_entry_room_camera_away:
  alias: "Privacy: OFF"
  sequence:
    - data:
        privacy_mode: "off"
      service: tapo_control.set_privacy_mode
      entity_id: camera.entry_room_sd
    - service: tapo_control.ptz
      data:
        preset: Away
      entity_id: camera.entry_room_sd
  mode: single

Becomes:

set_entry_room_camera_away:
    alias: "Privacy: OFF"
    sequence:
      - service: switch.turn_off
        data: {}
        target:
          entity_id: switch.entry_room_privacy
      - service: select.select_option
        data:
          option: Away
        target:
          entity_id: select.entry_room_move_to_preset

Hey, could I add this example to docs?

1 Like

I use TinyCam to view my cameras and the bitrate of the Tapo is about the same as the Wyze camera. The picture is not very crisp and has a lot of artifacts.

If the camera would stream at a higher bitrate, the picture would be better.

Thanks, I was looking at the same through my work laptop this morning and it seems the proxy was still caching very old pages (we have a support ticket with our network team for several weeks for other similar issues), they look fine from home so I should be able to fix my cards now.

Yes! of course! happy to help you a little! :wink:

Hi Juraj,

First of all, thank you for your hard work. However, I am having a bit of difficulties in getting my buttons for moving the camera to a different preset to work. This is how I had it in the previous version:

type: button
name: Living Room
icon: mdi:arrow-up-bold-outline
tap_action:
  action: call-service
  service: tapo_control.ptz
  service_data:
    entity_id: camera.tapio_hd
    preset: 1

I have tried to model the example given in code examples and come up with this:

type: button
name: Living Room
icon: mdi:arrow-left-bold-outline
tap_action:
  action: select.select_option
  data:
    option: 2
  target:
    entity_id: select.tapio_move_to_preset

However, pressing the new button does not do anything. In the Github example the ‘option’ variable was set to ‘Room’. Does this mean I need to use something else than ID values of the presets? If so, are these the same names as entered in the Tapo app? Tried entering ‘Living Room’ into the option as well, without success.

I am glad to help your examples by submitting an example of how to simply move the camera to a preset, once I have this figured out myself. I do have several years of experience with HA tinkering, but this ‘select_option’ pattern is something new to me.

It looks like with this update we lost an ability to use IDs as a preset and it only accepts strings / names now.

You can get possible values from Device page
image

Or from developer tools

image

Example I just tested working with above values for my camera:

service: select.select_option
data:
  option: Privacy
target:
  entity_id: select.bedroom_move_to_preset

Because of Home Assistant doing check on select values, we now need to send a value from a list of possible values of that select, meaning IDs will no longer be possible. Names of presets shall be used instead.

Edit: In your example it should look something like:

type: button
name: Living Room
icon: mdi:arrow-left-bold-outline
tap_action:
  action: call-service
  service: select.select_option
  data:
    option: Preset name
  target:
    entity_id: select.tapio_move_to_preset