Custom component - Tapo: Cameras Control - to add Tapo cameras into Home Assistant
Copy contents of custom_components/tapo_control/ to custom_components/tapo_control/ in your Home Assistant config folder.
HACS is a community store for Home Assistant. You can install HACS and then install Tapo: Camera Control from the HACS store.
Following target TCP 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
Add cameras via Integrations (search for Tapo) in Home Assistant UI.
To add multiple cameras, add integration multiple times.
See examples for lovelace cards or examples for template entities.
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
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.
- entity_id Required: Entity to adjust
- 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.
- entity_id Required: Entity to set privacy mode for
- privacy_mode Required: Sets privacy mode for camera. 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.
- entity_id Required: Entity to set alarm mode for
- 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.
- entity_id Required: Entity to set LED mode for
- led_mode Required: Sets LED mode for camera. Possible values: on, off
tapo_control.format
Formats SD card of a camera
- entity_id Required: Entity to format
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!
- entity_id Required: Entity to set motion detection mode for
- motion_detection_mode Required: Sets motion detection mode for camera. Possible values: high, normal, low, off
tapo_control.set_auto_track_mode
Warning: This mode is not available in Tapo app and we do not know why. Use at your own risk and please report any success or failures in Home Assistant: Community Forum.
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.
- entity_id Required: Entity to set auto track mode for
- auto_track_mode Required: Sets auto track mode for camera. Possible values: on, off
tapo_control.reboot
Reboots the camera
- entity_id Required: Entity to reboot
tapo_control.save_preset
Saves the current PTZ position to a preset
- entity_id Required: Entity to save the preset for
- name Required: Name of the preset. Cannot be empty or a number
tapo_control.delete_preset
Deletes a preset
- entity_id Required: Entity to delete the preset for
- 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
- entity_id Required: Entity to set day/night mode for
- day_night_mode Required: Sets day/night mode for camera. Possible values: on, off, auto
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
Please open a new issue, or discuss on Home Assistant: Community Forum.
Join discussion on Discord.
- Dale Pavey from NCC Group for the initial research on the Tapo C200
- likaci and his github repository for the research on the Mercury camera on which tapo is based
- Tim Zhang for additional research for Mercury camera on his github repository
- Gábor Szabados for doing research and gathering all the information above in Home Assistant Community forum
- Davide Depau for additional research of the cameras and work on pytapo library
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.