Overview
Seam provides a universal API to connect and control many brands of devices. This guide provides a rapid introduction to connecting your Tapo cameras to Seam, retrieving them as devices, and receiving their motion events. Seam reaches Tapo cameras on the local network through a Seam Bridge. To learn more about other device brands supported by Seam, head over to our integration page.1 — Install Seam SDK
Seam provides client libraries for many languages, such as JavaScript, Python, Ruby, PHP, and others, as well as a Postman collection and OpenAPI spec.- JavaScript / TypeScript (npm, GitHub)
- Python (pip, GitHub)
- Ruby Gem (rubygem, GitHub)
- PHP (packagist, GitHub)
- C# (nuget, GitHub)
- Java (Maven, GitHub)
This guide uses a Sandbox Workspace. Only virtual devices can be connected. If
you need to connect a real Tapo camera, use a non-sandbox workspace and API
key.
2 — Link a Tapo Camera with Seam
To use a Tapo camera through the Seam API, you must first authorize your Seam workspace to reach the camera. To do so, Seam provides Connect Webviews: pre-built UX flows that walk you through pairing a Seam Bridge and entering the camera’s connection details. Tapo is a beta provider, so includetapo in the Connect Webview’s accepted_providers list. The Tapo login in the Connect Webview works only after Seam turns on Tapo for your workspace, including your sandbox workspace.
Request a Connect Webview
Authorize Your Workspace
Navigate to the URL returned by the Webview object. Since you are using a sandbox workspace, you don’t need to install Seam Bridge. Continue past the Seam Bridge instructions, submit the prefilled sandbox pairing token, and then enter the Tapo sandbox camera details below:- Camera address: camera.test
- ONVIF port: 2020
- Camera Account username: tapo-test-user
- Camera Account password: tapo-test-password
- Tapo account password (optional): tapo-sandbox-account-password
3 — Retrieve the Tapo Camera Device
After a Tapo camera is linked with Seam, you can retrieve it as a device. Each Tapo connected account contains exactly one camera, with thetapo_camera device type.
The can_stream_live_video capability flag is true when the camera supports live video and is online. To stream its live video, live video must also be turned on for your workspace. Otherwise, /cameras/live_views/create returns a camera_not_available error. The sandbox camera reports true, but the sandbox can’t stream video, so use a real camera to try live view.
4 — Receive Motion Events
When a connected Tapo camera detects motion, Seam creates acamera.activated event with activation_reason set to motion_detected. To receive these events as they happen, set up a webhook. You can also list events for the camera.
The Tapo sandbox camera doesn’t simulate motion, so this step returns no events in a sandbox workspace. Use a real camera in a non-sandbox workspace to see motion events.
camera.activated event:
media_ids when event media is turned on for your workspace. video_url and image_url point to /media/get with format=redirect, and are included for compatibility. Use media_ids in new integrations.
5 — Retrieve Event Recordings
If you enter the Tapo account password when you connect a real camera, Seam retrieves the camera’s microSD recording of each motion event. The event’smedia_ids list a video clip and a thumbnail, which you fetch with /media/get. The returned url expires within minutes, and the media’s expires_at is 7 days after Seam stores the clip. The camera needs a microSD card and Third-Party Compatibility turned on in the Tapo app. For the full flow, see Retrieve Event Media and Tapo event recordings.
The sandbox camera accepts the sandbox Tapo account password so that you can test the Connect Webview, but it has no microSD recordings, so its media would end in the unavailable status.
6 — Stream Live Video
You can stream a Tapo camera’s live video to a browser over WebRTC when itscan_stream_live_video capability flag is true and live video is turned on for your workspace. The flag means the camera supports live video and is online. It doesn’t reflect whether live video is turned on for your workspace: if it isn’t, /cameras/live_views/create returns a camera_not_available error. The flag is false while the camera or its Seam Bridge is offline. Live view uses a client session token scoped to the camera, so your users’ browsers never see your API key. For the full flow, see Stream Live Video.