All Projects → JurajNyiri → HomeAssistant-Tapo-Control

JurajNyiri / HomeAssistant-Tapo-Control

Licence: Apache-2.0 license
Control for Tapo cameras as a Home Assistant component

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to HomeAssistant-Tapo-Control

Home Assistant Configuration
My Home Assistant Config. For more Information visit ->
Stars: ✭ 102 (-68.81%)
Mutual labels:  home-automation, home-assistant, homeassistant
Homeassistant
Example Home Assistant Configs
Stars: ✭ 168 (-48.62%)
Mutual labels:  home-automation, home-assistant, homeassistant
Addon Ssh
SSH & Web Terminal - Home Assistant Community Add-ons
Stars: ✭ 114 (-65.14%)
Mutual labels:  home-automation, home-assistant, homeassistant
Homeassistant Config
Configuration for @brianjking & @KinnaT's Home Assistant Installation
Stars: ✭ 80 (-75.54%)
Mutual labels:  home-automation, home-assistant, homeassistant
google fit hass
A Home assistant custom component to get your fitness information using Google Fitness API.
Stars: ✭ 23 (-92.97%)
Mutual labels:  home-automation, home-assistant, homeassistant
Frigate
NVR with realtime local object detection for IP cameras
Stars: ✭ 1,329 (+306.42%)
Mutual labels:  home-automation, camera, home-assistant
Home Assistant Mail And Packages
Home Assistant integration providing day of package counts and USPS informed delivery images.
Stars: ✭ 155 (-52.6%)
Mutual labels:  home-automation, home-assistant, homeassistant
Homeassistant
Example Home Assistant Configs
Stars: ✭ 846 (+158.72%)
Mutual labels:  home-automation, home-assistant, homeassistant
Home-Assistant-Config
🏠 My huizebruin Home Assistant configuration, Be sure to 🌟 this repository for updates! huizebruin
Stars: ✭ 29 (-91.13%)
Mutual labels:  home-automation, home-assistant, homeassistant
home-assistant-config
🏠 Home Assistant Configuration & Documentation for my smart home using Node-RED for automations. Press ⭐ for notification of updates.
Stars: ✭ 34 (-89.6%)
Mutual labels:  home-automation, home-assistant, homeassistant
Ha Bt Proximity
Distributed Bluetooth Room Presence Sensor for Home Assistant
Stars: ✭ 77 (-76.45%)
Mutual labels:  home-automation, home-assistant, homeassistant
ocpp
Home Assistant integration for electric vehicle chargers that support the Open Charge Point Protocol (OCPP).
Stars: ✭ 82 (-74.92%)
Mutual labels:  home-automation, home-assistant, homeassistant
Streamdeck Homeassistant
🏠 Use the Elgato Stream Deck as Home Assistant controller. Call any available service and toggle lights or resume your music.
Stars: ✭ 69 (-78.9%)
Mutual labels:  home-automation, home-assistant, homeassistant
Home Assistant Config
My Home Assistant configuration & documentation.
Stars: ✭ 99 (-69.72%)
Mutual labels:  home-automation, home-assistant, homeassistant
Home Assistant Config
🏠 My Home Assistant configuration, a bit different that others :) Be sure to 🌟 this repository for updates!
Stars: ✭ 1,050 (+221.1%)
Mutual labels:  home-automation, home-assistant, homeassistant
Simple Weather Card
Minimalistic weather card for Home Assistant
Stars: ✭ 135 (-58.72%)
Mutual labels:  home-automation, home-assistant, homeassistant
Home Assistantconfig
🏠 Home Assistant configuration & Documentation for my Smart House. Write-ups, videos, part lists, and links throughout. Be sure to ⭐ it. Updated FREQUENTLY!
Stars: ✭ 3,687 (+1027.52%)
Mutual labels:  home-automation, home-assistant, homeassistant
Homeassistant
Home Assistant Configuration Files and Documentation
Stars: ✭ 395 (+20.8%)
Mutual labels:  home-automation, home-assistant, homeassistant
Ha Wyzeapi
Home Assistant Integration for Wyze Bulbs, Switches, Sensors and Lock
Stars: ✭ 187 (-42.81%)
Mutual labels:  home-automation, home-assistant, homeassistant
ha-illuminance
Home Assistant Illuminance Sensor
Stars: ✭ 53 (-83.79%)
Mutual labels:  home-automation, home-assistant, homeassistant-custom-component

HomeAssistant - Tapo: Cameras Control

Custom component - Tapo: Cameras Control - to add Tapo cameras into Home Assistant

Installation

Copy contents of custom_components/tapo_control/ to custom_components/tapo_control/ in your Home Assistant config folder.

Installation using HACS

HACS is a community store for Home Assistant. You can install HACS and then install Tapo: Camera Control from the HACS store.

Requirements

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.

Usage

Add cameras via Integrations (search for Tapo) in Home Assistant UI. You can also simply click the button below if you have MyHomeAssistant redirects set up.

Open your Home Assistant instance and start setting up a new integration.

Cameras are also automatically discovered when they are (re)connected to WIFI.

To add multiple cameras, add integration multiple times.

See examples for lovelace cards or examples for template entities.

Services

This custom component creates:

  • tapo_control.* services to control a camera
  • 2 camera entities, one for HD and one for SD stream
  • 1 binary sensor for motion after the motion is detected for the first time
  • 1 light entity, if the camera supports a floodlight switch

Use these services in following service calls.

tapo_control.ptz

Pan and tilt camera.

You are also able to use presets and set distance the ptz should travel.

  • tilt Optional: Tilt direction. Allowed values: UP, DOWN
  • pan Optional: Pan direction. Allowed values: RIGHT, LEFT
  • preset Optional: PTZ preset ID or a Name. See possible presets in entity attributes.
  • distance Optional: Distance coefficient. Sets how much PTZ should be executed in one request. Allowed values: floating point numbers, 0 to 1
tapo_control.set_privacy_mode

Sets privacy mode.

If privacy mode is turned on, camera does not record anything and does not respond to anything other than turning off privacy mode.

  • privacy_mode Required: Sets privacy mode for camera. Possible values: on, off
tapo_control.set_alarm

Activates or deactivates active alarm.

  • alarm Required: Possible values: on, off
tapo_control.set_alarm_mode

Sets alarm mode.

If camera detects motion, it will sound an alarm, blink the LED or both.

  • alarm_mode Required: Sets alarm mode for camera. Possible values: on, off
  • sound Optional: Sets whether the alarm should use sound on motion detected. Possible values: on, off
  • light Optional: Sets whether the alarm should use light on motion detected. Possible values: on, off
tapo_control.set_led_mode

Sets LED mode.

When on, LED is turned on when camera is on.

When off, LED is always off.

  • led_mode Required: Sets LED mode for camera. Possible values: on, off
tapo_control.format

Formats SD card of a camera

tapo_control.set_motion_detection_mode

Sets motion detection mode.

Ability to set "high", "normal" or "low".

These turn on motion detection and set sensitivity to corresponding values in the app.

Also ability to set to "off", this turns off motion detection completely.

Turning motion detection off does not affect settings for recordings so you do not need to re-set those unless you open the settings through the Tapo app.

Notice: If you use motion detection triggered recording and you turn off motion recording, it will no longer record!

  • motion_detection_mode Required: Sets motion detection mode for camera. Possible values: high, normal, low, off
tapo_control.set_auto_track_mode

Starting with firmware 1.1.7 the feature requires Tapo Care subscription.

Sets auto track mode.

With this mode, camera will be adjusting ptz to track whatever moving object it sees.

Motion detection setting does not affect this mode.

  • auto_track_mode Required: Sets auto track mode for camera. Possible values: on, off
tapo_control.reboot

Reboots the camera

tapo_control.save_preset

Saves the current PTZ position to a preset

  • name Required: Name of the preset. Cannot be empty or a number
tapo_control.delete_preset

Deletes a preset

  • preset Required: PTZ preset ID or a Name. See possible presets in entity attributes
tapo_control.set_day_night_mode

Sets day or night mode

  • day_night_mode Required: Sets day/night mode for camera. Possible values: on, off, auto
tapo_control.synchronize_time

Sets date and time on camera to the date of Home Assistant.

This is also done automatically by integration every hour if enabled in configuration.

Sound Detection

Integration is capable of analysing sound from camera microphone and expose a new attribute noise_detected on cameras when a voice threshold is reached.

You need to enable this feature in integration options by checking "Enable sound threshold detection". After enabling it, you can also set any other options starting with [Sound Detection]. You will need to restart Home Asssistant after doing any changes.

For more information and troubleshooting see Home Assistant ffmpeg documentation on which this feature is based on.

Troubleshooting | FAQ

Binary sensor for motion doesn't show up or work

Motion sensor is added only after a motion is detected for the first time.

  • Make sure the camera has motion detection turned on
  • Make sure the camera has privacy mode turned off
  • Make sure the camera can see you and your movement
  • Try walking in front of the camera
  • If above didn't work, restart the camera and try again

Also make sure that:

  • binary sensor is not disabled via entity, check .storage/core.entity_registry for disabled entities, look for "disabled_by": "user" on platform "tapo_control". If it is, remove the whole entity or change to "disabled_by": null, and restart HASS.
  • binary sensor is enabled in tapo integration options
  • onvif port 2020 on camera is opened
Big delay in camera stream

This is a known issue of Home Assistant.

There is an ability to disable usage of Home Assistant Stream component for the camera, which might lower the delay very significantly at cost of higher CPU usage.

You can choose to disable stream component when adding the camera, or via Options when camera has already been added. This change requires a restart of Home Assistant.

There might be some disadvantages to doing this, like losing option to control playback and a higher CPU usage. Results depend on your hardware and future Home Assistant updates.

If you disable stream and your hardware is not up to the task, you will get artifacts, bigger delay and freezes.

If you wish, try it out and see what works best for you.

Another possibility is using WebRTC Camera by AlexxIT.

Example working configuration:

type: custom:webrtc-camera
entity: camera.bedroom_hd
No audio in camera stream

Supported audio codecs in Home Assistant are "aac", "ac3" and "mp3".

Tapo Cameras use PCM ALAW (alaw) which is not supported.

More details here.

You can get sound working using WebRTC Camera by AlexxIT.

Example working configuration:

type: custom:webrtc-camera
entity: camera.bedroom_hd
Supported models

Users reported full functionality with following Tapo Cameras:

  • TC60
  • TC70
  • C100
  • C110
  • C200
  • C210
  • C310
  • C320WS

The integration should work with any other Tapo Cameras.

If you had success with some other model, please report it via a new issue.

Have a comment or a suggestion?

Please open a new issue, or discuss on Home Assistant: Community Forum.

Join discussion on Discord.

Thank you

Buy Me A Coffee

Disclaimer

This integration is using python module Pytapo which is an unofficial module for achieving interoperability with Tapo cameras.

Author is in no way affiliated with Tp-Link or Tapo.

All the api requests used within the pytapo library are available and published on the internet (examples linked above) and the pytapo module is purely just a wrapper around those https requests.

Author does not guarantee functionality of this integration and is not responsible for any damage.

All product names, trademarks and registered trademarks in this repository, are property of their respective owners.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].