[Custom Component] Tapo: Cameras Control

@JurajNyiri Does it support the C310 as well?

And is it possible to make a service for setting the alarm on or off?
I want the motion detection always on but would like to turn off the alarm when i am at home.

Thanks for your awesome work!

Thank you :slight_smile:

It needs to be tested, I do not own c310 and I do not plan to buy it as I already have all the outside cams I need.

The service for alarm has been available since 2.0, check the readme services section, you are able to automate what you described.

1 Like

@JurajNyiri can answer this question. @JurajNyiri, is it possible to do with the current videostream? Or is the new feature what you planned was the snapshot?

Anyone had issues after upgrading to 117.0 ?

I got

Setup failed for tapo_control: Unable to import component: No module named 'zeep.asyncio'
7:45:34 AM ā€“ setup.py (ERROR)

See post 44 in this thread. Issue was in HA 0.116.3 and fixed with 2.1.1 of this component.
At a guess you need to update this custom component :+1:t2:

@djm you can do this with the camera.snaphost service.

action:
  service: camera.snapshot
  data:
    entity_id: camera.yourcamera
    filename: '/tmp/yourcamera_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg'

A word of warning, this appears to have issues at times which I suspect are linked to the current streaming issues that are being worked on.

2 Likes

Sorry, but I don understand, what wrong on this code. If I tap the button, nothing does it. :frowning:

type: button
tap_action:
  action:
    - service: camera.snapshot
    - data:
        entity_id: camera.tapo_hd
        filename: '/config/tmp/yourcamera_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg'
entity: camera.tapo_hd

@radek-foltyn Iā€™m not so hot on buttons but the first thing Iā€™d try is changing the path to the media directory which is available by default in HA (115 onwards I think) e.g.

type: button
tap_action:
  action:
    - service: camera.snapshot
    - data:
        entity_id: camera.tapo_hd
        filename: '/media/yourcamera_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg'
entity: camera.tapo_hd

Another approach is to create the snapshot via a script, that way you can reuse it if needs be.

Hereā€™s a quick example based on my camera name:

'1604089117818':
  alias: Front Door Camera Snapshot
  sequence:
  - service: camera.snapshot
    data:
      filename: /media/frontdoorsnapshot_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg
    entity_id: camera.front_door_hd
  mode: single

Then you can created a button that calls the script.

type: button
tap_action:
  action: toggle
entity: script.1604089117818

Hope that helps?

It still doesnā€™t work with the button. May I ask why? Using a script itā€™s ok.

Iā€™m still learning so canā€™t really say what exactly but I would suggest its something to do with the YAML structure/format - especially if the script works. Iā€™ll try and have a look later though. hopefully someone else will come along with more experience than me :slight_smile:

How about using a picture card?

type: picture-entity
entity: camera.tapo_hd
camera_image: camera.tapo_hd
camera_view: live
tap_action:
  action: call-service
  service: camera.snapshot
  service_data:
    entity_id: camera.tapo_hd
    filename: '/media/cameratapohdsnapshot{{ now().strftime("%Y-%m-%d-%H%M%S") }}.jpg'
name: Click For Snapshot

The above works for me. You get a live feed as the picture and clicking will take a snapshot. All Iā€™ve done thats different from my working code is change the camera name to your cameras name so this should work.

I cant get it to work with a button either.

YouĀ“re right, got it working now. Thanks!

I have updated today my Home Assistant and Supervisor and now i get this error when i restart:

Invalid config

The following integrations and platforms could not be set up:

Anyone getting the same?

What is the error in the log?

Logger: homeassistant.setup
Source: setup.py:138
First occurred: 6:30:45 PM (1 occurrences)
Last logged: 6:30:45 PM

Setup failed for tapo_control: Unable to import component: cannot import name ā€˜ONVIFAuthErrorā€™ from ā€˜onvif.exceptionsā€™ (/usr/local/lib/python3.8/site-packages/onvif/exceptions.py)

FWIW, Iā€™m running 0.117.2 (upgraded from 117.1) without issue with latest version of this component.
Iā€™m on HassOS on a Pi 4 if thatā€™s relevant

Make sure you are on the latest version of component. This has been fixed previously and mentioned here before.

I rolled back to Home Assistant Core 0.116.4 and everything works again.

Did you test on latest HASS and latest component version? It should work properly.

Updated Tapo Control to 2.2.1 from HACS and it works again. Thanks!