JurajNyiri / HomeAssistant-Tapo-Control

Control for Tapo cameras as a Home Assistant component
Apache License 2.0
1.13k stars 89 forks source link

Feature Request: Give an example / Documentation #15

Closed ic2hrmk closed 4 years ago

ic2hrmk commented 4 years ago

Hi! Thanks a lot for the great work you are doing!

I am pretty new to Home Assistant and I found it a little bit confusing to start work with. Can you, please, add an example configuration on how to invoke the API you are providing from the integration? For example, a simple card with a live stream and motion controls.

Thanks a lot!

ic2hrmk commented 4 years ago

As an example it could be something like:

type: picture-glance
title: Tapo C200 (Eye)
camera_image: camera.eye_hd
camera_view: live
entities:
  - entity: camera.eye_hd
    icon: 'mdi:arrow-left-drop-circle-outline'
    tap_action:
      action: call-service
      service: tapo_control.ptz
      service_data:
        entity_id: camera.eye_hd
        pan: LEFT
  - entity: camera.eye_hd
    icon: 'mdi:arrow-up-drop-circle-outline'
    tap_action:
      action: call-service
      service: tapo_control.ptz
      service_data:
        entity_id: camera.eye_hd
        tilt: UP
  - entity: camera.eye_hd
    icon: 'mdi:arrow-down-drop-circle-outline'
    tap_action:
      action: call-service
      service: tapo_control.ptz
      service_data:
        entity_id: camera.eye_hd
        tilt: DOWN
  - entity: camera.eye_hd
    icon: 'mdi:arrow-right-drop-circle-outline'
    tap_action:
      action: call-service
      service: tapo_control.ptz
      service_data:
        entity_id: camera.eye_hd
        pan: RIGHT
  - entity: camera.eye_hd
    icon: 'mdi:eye-outline'
    tap_action:
      action: call-service
      service: tapo_control.set_privacy_mode
      service_data:
        entity_id: camera.eye_hd
        privacy_mode: 'off'
  - entity: camera.eye_hd
    icon: 'mdi:eye-off-outline'
    tap_action:
      action: call-service
      service: tapo_control.set_privacy_mode
      service_data:
        entity_id: camera.eye_hd
        privacy_mode: 'off'
  - entity: camera.eye_hd
    icon: 'mdi:power'
    tap_action:
      action: call-service
      service: tapo_control.reboot
hold_action:
  action: more-info
Screenshot 2020-10-08 at 01 37 16
JurajNyiri commented 4 years ago

Hey @ic2hrmk

Thank you for your example. It looks really great!

If you would like to, please go ahead, create a new folder called docs and file for example EXAMPLES.md and put in your examples, then just create a PR 👍

ic2hrmk commented 4 years ago

Hi @JurajNyiri , I created a short page with examples but I'm not able to push my branch to this repository. Can you please review the repo access policy?

JurajNyiri commented 4 years ago

Hello @ic2hrmk you need to fork this repository, clone your fork, push it there and then create a Pull Request from there to here.

More info: https://opensource.com/article/19/7/create-pull-request-github

antstyl commented 2 years ago

Anyone please kind enough to help how to implent the above? Of course I have installed the Tapo cameras integration and I can see live camera in HA but with default card.

I try to edit the card inside HA and insert the above code and I get this:

Visual editor is not supported for this configuration: Key 'entities' is not expected or not supported by the visual editor. You can still edit your config in YAML.

JurajNyiri commented 2 years ago

You can find many examples below.

https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/blob/main/examples/EXAMPLES_LOVELACE.md https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/blob/main/examples/EXAMPLES_ENTITIES.md

If you are having trouble with picture glance card, read the official documentation. If you are still having issues, reach out for help in community forums.