How to connect a Tuya Smart camera to an Anjielo video doorbell via Home Assistant?

Option 1: Direct Streaming via ONVIF/RTSP (Highly Recommended)

This is the most stable and lowest-latency local connection method. If the camera supports it, this is the preferred option.

Enable ONVIF in the App: Open the "Smart Life" or "Tuya Smart" app on your phone. Go to the camera's settings page and find and enable the "ONVIF" function.

Key Step: Set a dedicated ONVIF password. Please note that the username is usually fixed as "admin," and the password is not your app account password; it needs to be set separately.

Configure in Home Assistant:

Method A (Recommended): Using "ONVIF" Integration
Add "ONVIF" integration in Home Assistant's "Devices & Services." It usually discovers the camera automatically. Enter the username "admin" and the ONVIF password you just set.

Method B: Using "General Camera" Integration

If Method A doesn't work, you can manually add an RTSP link. The RTSP address format for a camera is typically as follows: Main stream (HD): rtsp://admin:password@cameraIP:8554/main Sub stream (smooth): rtsp://admin:password@cameraIP:8554/sub Please replace "password" with your ONVIF password and "camera IP" with the camera's actual address on your local network.

Method C (Reducing Latency): Using "WebRTC Camera"

If high latency is required, you can install the "WebRTC Camera" integration via HACS and then add it to the dashboard using the above RTSP address, achieving near real-time video.

Option Two: Using LocalTuya Custom Integration (Alternative)

If your camera does not support ONVIF, or if you want to control the camera's pan/tilt function in Home Assistant, you can try this method. It communicates directly with the graffiti device via the local network.

Install LocalTuya: Search for and install the "LocalTuya" integration via HACS.

Obtaining Key Device Information:

Device ID and Local Key: These can be obtained in two ways:
* Online: Go to the Tuya IoT platform, find the device details page in your cloud project, and copy these two pieces of information.
* Python Script: If the above doesn't work, you can run a small script from the tinytuya library on your computer, which can also scan for the device.
* IP Address: In your router's management interface, find the static internal network IP address assigned to the camera and write it down.
* Configuration in Home Assistant:
Add LocalTuya integration and select "Manual Configuration".
* Enter the camera's IP address, Device ID, and Local Key in sequence.
* Important! When configuring the entity type, because LocalTuya doesn't natively support camera video streams, we only configure the PTZ control-related entities in this step. This way, you can control the camera's rotation in HA.
* Special Note: Separate Video Stream and Control: Even if local control is achieved through Solution 2, the video stream usually still needs to be accessed via ONVIF/RTSP as in Solution 1.
* A static IP address is necessary: To ensure the configuration remains effective, it's best to assign a static internal IP address to the camera in the router settings.

Try Solution 1 first; most cameras supporting ONVIF will succeed. If you can't find the ONVIF switch or the RTSP address is incorrect, these are indeed the two most common problems encountered when connecting a Tuya camera. Don't worry, we'll troubleshoot and resolve them step by step. This usually means your camera model may not support ONVIF, or its RTSP address format is unusual.

Step 1: In-depth troubleshooting to confirm if the camera supports local RTSP

First, we need to confirm whether your camera supports local RTSP streaming. Tuya's solutions have two possibilities:

**Supports "Local RTSP":** Some newer or specific Tuya camera models have a built-in RTSP switch in the app. When turned on, the app will directly generate a complete RTSP address with a temporary password for your use.

**Supports "Cloud RTSP Only":** This is the default for most Tuya cameras. It does support RTSP, but the stream can only be obtained through Tuya's cloud forwarding, not directly from the camera. In this case, you won't find the switch in the app. How to differentiate?

In the Tuya Smart App, carefully look for switches like "Local RTSP," "ONVIF," or "LAN communication protocol" in the camera settings. If you find them, congratulations, it's the first scenario.

If you can't find them anywhere, your camera likely only supports the second mode, "Cloud RTSP." In this mode, the RTSP address needs to be dynamically generated via the Tuya developer platform's API and has an expiration time; it cannot be directly used for long-term Home Assistant configuration.

Step Two: Try solutions for different scenarios

Based on the findings in the previous step, choose the corresponding method:

Scenario A: RTSP switch found in the App

This is the simplest. After turning on the switch, the App will usually directly display an RTSP address or ask you to set an RTSP password.

If the full address is displayed: simply copy that address to the "General Camera" integration in Home Assistant. The address format might be as mentioned in the forum, simply rtsp://IP:8554/, or it might be like the Aqara camera, with a long token, such as rtsp://[IP]:554/live/ch00_1?token=[AUTH_TOKEN].

If you only need to set a username and password: the RTSP address format will likely be rtsp://[username]:[password]@[camera IP]:[port]/[path]. You'll need to combine them yourself. Common paths include /live/0, /main, /h264, etc. The port is usually 554 or 8554.

Scenario B: The app has no RTSP switch at all.

This is the most likely scenario. Since a direct connection is impossible, let's try a different approach, using a powerful Home Assistant plugin as a workaround.

Core solution: Use the tuya-connector plugin.
This plugin is specifically designed to solve this type of problem. It runs within Home Assistant and mimics the behavior of the official app, retrieving real-time video streams from the cloud using your Tuya account and playing them locally.

The specific steps are as follows:
* **Install Plugin:**
**Ensure you have HACS (Home Assistant Community Store) installed.**
**Search for "tuya-connector" on the "Integrations" page of HACS, download and install it.**
**After installation, restart Home Assistant.**
* **Configure Plugin:**
**On the "Device & Services" page of Home Assistant, click "+ Add Integration".**
**Search for and select "tuya-connector".**
**It will ask you to enter your Tuya IoT platform Access ID and Access Secret.** You need to create a cloud development project on the Tuya IoT platform to obtain these; the steps are the same as when you obtained your Local Key.**

After successful configuration, the plugin will automatically discover all camera devices under your account.

**Add to Dashboard:**
**After successfully adding the plugin, it will create an entity for your camera.**

In dashboard editing mode, add an "Image Entity" card, select this newly generated camera entity, and you will see the live feed on the interface.** The advantage of this solution is that you don't need to worry about whether the camera supports ONVIF or guess the RTSP address, as it completely reuses Tuya's official video transmission protocol.

If you encounter difficulties installing the tuya-connector plugin, or if the camera is added successfully but there is no video feed, this is usually due to some minor configuration or network issues.

Back to blog

Leave a comment