How to Connect Wyze Camera to HomeKit

Danila Loginov
12 min readAug 9, 2024

--

I recently bought a new Wyze Cam v4 to capture noise recordings from our new neighbors. I was sold by the capability of Wyze Cam v4 to trigger recording when sound is detected which they documented on their website unlike other manufacturers and, initially, I was not interested much in the rest of the capabilities, like AI detection.

Soon the sound problem was resolved and I started to look at what else I could do with the newly bought Wyze Cam v4, so I was a little bit disappointed that even basic features like watching the recording from the event triggered it were not available without a paid subscription, even though there are enough technical capabilities to do so without requiring Wyze Cloud.

While I respect business decisions made by Wyze and am happy to pay for the integrated experience, the cornerstone of my home platform is Apple HomeKit and I find it extensible enough and very convenient to share with my family access to without having them dealing with other services and applications.

Surfing Reddit it seems I’m not alone in this frustration as there is no out-of-the-box integration between Wyze and HomeKit today, and there is no Matter support as well. With that we are approaching the problem to be solved by this tutorial: how to connect Wyze cameras to HomeKit?

Solution Overview

On one hand, we have the Apple Home app serving as a HomeKit client and the Apple Home Hub working as a HomeKit hub (for example Apple TV). On another we have Wyze cameras communicating with Wyze Cloud (that cannot be disabled).

Component View

Our goal is to set up a bridge on a computer within the home network (LAN) with two services:

  • Docker Wyze Bridge that will get access to Wyze cameras through Wyze Cloud and obtain RTSP stream;
  • Scryped that will help to integrate RTSP into the HomeKit.

In the last (optional) part I will describe what I used as a standalone server to run this middleware. Having this up and running you’ll get:

  • Live video stream in the Apple Home app;
  • Motion detection with people, animals, vehicles, packages, and even face recognition based on your Photos library;
  • Event recordings that are saved to iCloud and can be watched anytime in the Home app;
  • Event notifications in the Home app;
  • Automation support, such as turning off streaming or recording with somebody is home, controlling other accessories when the motion is detected, and so on.

All of these capabilities are native to HomeKit meaning it will work seamlessly with any other Apple devices. Note that automation and external access will only work if you have Home Hub set up, such as Apple TV or HomePod.

It took me a few hours to figure out all of that including testing on a personal computer and setting up a standalone server, so following this tutorial, it should take you well under an hour.

Part 1. Docker Wyze Bridge

In the first part, we will get access to the Wyze Cam v4 and obtain an RTSP stream so it can be piped into HomeKit. To do that we will utilize the most common approach — using the help of open source bridge packaged as a Docker container: https://github.com/mrlt8/docker-wyze-bridge — it simulates the Wyze app to get authorization and communicates directly with the cameras.

Assuming you have Docker installed, on your local machine that is in the same network as the Wyze camera, pull and launch a container directly from the Docker Hub https://hub.docker.com/r/mrlt8/wyze-bridge, no modifications required:

docker run -p 8554:8554 -p 8888:8888 -p 5000:5000 mrlt8/wyze-bridge

If the container launched successfully, you should be able to open http://localhost:5000 which serves Web UI in your browser.

Screenshot 1. Wyze Bridge Login

First, you will be presented with a login screen asking you to provide Wyze user credentials (email and password) and API ID and Key. While the first should not be a problem, to get the API ID and Key we need to do an additional step following the instructions in the Wyze Help Center: https://support.wyze.com/hc/en-us/articles/16129834216731-Creating-an-API-Key

Go to https://developer-api-console.wyze.com, log in using the same account, and click on the “Create an api key” button to get “Key Id” and “Api Key” generated. Copy and save them in a secure place since these credentials provide access to your cameras.

Screenshot 2. Wyze API Credentials

Switch back to the Docker Wyze Bridge Web UI and paste the “Key Id” to the “API ID” and the “Api Key” to the “API Key” fields. Click on “Login” and if the credentials are valid, you will be asked to enter your username and password. This time these are not from the Wyze account, but the configuration of the HTTP authentication for Docker Wyze Bridge.

Since we did not configure HTTP authorization when launching the Docker container, it will fall back to defaults which are wbadmin for username and the username portion of Wyze email (johndoe in johndoe@example.com) as a password (starting from Docker Wyze Bridge v2.10).

Screenshot 3. Wyze Bridge Web UI

Eventually, you will get to the dashboard displaying all the cameras you have in the Wyze app.

If you want to have more control over how the Docker container is launched, you can follow the steps described in https://github.com/mrlt8/docker-wyze-bridge?tab=readme-ov-file#docker-compose-recommended to use Docker Compose sample and pass configuration, including credentials, through environment variables.

Part 2. Scrypted

The second part, a bit more complex, is to get the RTSP stream obtained through the Docker Wyze Bridge into the HomeKit. Following the Docker Wyze Bridge documentation we will use another open-source project Scrypted (GitHub).

Step 2.1. Install Scrypted

Follow the Scrypted docs to install the platform on the same computer running the Docker Wyze Bridge: https://docs.scrypted.app/installation.html I am using a Mac, so having Homebrew installed, I used the following command:

curl -s https://raw.githubusercontent.com/koush/scrypted/main/install/local/install-scrypted-dependencies-mac.sh > ~/install-scrypted-dependencies-mac.sh 
bash ~/install-scrypted-dependencies-mac.sh
rm ~/install-scrypted-dependencies-mac.sh
Screenshot 4. Scrypted Installation

When the installation is completed, you should be able to open https://localhost:10443 in the browser, that first will ask you to create a user which will be used to log into the Scrypted Console in the future.

Screenshot 5. Scrypted Splash Screen

Click on the “Management Console” button and you will end up on the “Devices” screen that will be empty for now.

Screenshot 6. Scrypted Devices Screen

Step 2.2. Set up RTSP

To configure the RTSP stream as a camera, we need to go to “Plugins”…

Screenshot 7. Scrypted Plugins Screen

…search for “rtsp” and install the @scrypted/rtsp plugin.

Screenshot 8. Installing RTSP Plugin

After the plugin installation is done we’ll see its screen.

Screenshot 9. RTSP Plugin Screen

Click on the “ADD RTSP CAMERA” button, enter the camera name (not the stream URL), and click on the “ADD” button.

Screenshot 10. Adding RTSP Camera

After the RTSP camera is created in Scrypted, let’s switch back to the Docker Wyze Bridge Web UI (http://localhost:5000), click on “Streams” under the video player, and right-click on the “RTSP” item to copy the stream URL.

Nota Bene! No matter how, I could not make streaming into Scrypted work when the authentication is enabled, and because Docker Wyze Bridge always requires streaming authentication when the Web UI authentication is enabled, I had to fully disable any authentication in Docker Wyze Bridge.

So make sure the server running Docker Wyze Bridge is accessible only within the local private home network. Any device that can connect to your network will be able to get the video streaming from the cameras as well.

Authentication is disabled in Docker Wyze Bridge by setting the WB_AUTH environment variable to false, like this:

docker run -p 8554:8554 -p 8888:8888 -p 5000:5000 -e WB_AUTH=false mrlt8/wyze-bridge

If you have a better solution for this, please post it in the comments, and I will test and rewrite the article with a more secure approach!

Screenshot 11. Getting RTSP Stream URL

Switch to the Scrypted Console, select the new camera, and paste copied RTSP stream URL to the corresponding field in the general settings.

Screenshot 12. Setting RTSP Stream URL

Right after that, you should have video streaming in Scrypted on the right — and with that, the most challenging integrations are done, hooray!

Step 2.3. Set up HomeKit

The next step is to connect Scrypted to HomeKit: find and install the @scrypted/homekit plugin, it will be on top of the plugins list, as the most used.

Screenshot 13. HomeKit Plugin Screen

After the installation the plugin will present a QR code for an accessory pairing that can be used in the Apple Home app, however, this will create a “bridge” device in the Home app, while we are going to configure the RTSP camera as a standalone HomeKit accessory (as recommended).

Let’s go to the RTSP camera “Extensions” section in the settings and enable the newly appeared “HomeKit” integration, this will add the “HomeKit” section in the settings above.

Screenshot 14. Enabling HomeKit Extension

The only thing we need to do here is to enable “Standalone Accessory Mode” in the “Pairing” tab and save changes.

Screenshot 15. Enabling Standalone Accessory Mode

Refresh the page if the QR code did not appear on a separate tab yet.

Screenshot 16. Getting HomeKit Pairing QR Code

Use an iPhone or another Apple device to add an accessory by scanning the QR code in the Home app.

Screenshot 17. Adding Camera to the Home App
Screenshot 18. Camera Added
Screenshot 19. Camera Streaming

Now you can click on the added camera and get live streaming from the Wyze camera in your Home app, great!

Step 2.4. Motion Detection

While we already have video streaming, our current setup lacks advanced features provided by HomeKit that are only available when there is a stream of motion detection events from the camera into HomeKit.

As we cannot use the Wyze motion detection capabilities, we’ll need another plugin @scrypted/opencv to be installed.

Screenshot 20. Motion Detection Plugin Screen

Right after the installation, it may not display devices supported, however, wait for a minute or refresh the page to have the plugin fully bootstrap and eventually, it will show the RTSP camera we configured in the right bottom corner. Enable the integration and that’s it!

Screenshot 21. Enabling Motion Detection Extension

Just to double-check, switching to the RTSP camera page, we should see the following extensions enabled in the settings:

Screenshot 22. RTSP Camera Extensions

The Motion Detection plugin has different configuration parameters including motion area, threshold, blur radius, and so on. I kept defaults for now and it works well enough, capturing all the motion seen through the camera lens.

Screenshot 23. Motion Detection Extension Configuration

Part 3. HomeKit

Now, when motion detection is happening, HomeKit will not only be able to stream but also react to motion detection events. Being notified about the events, it will analyze the video, capture recordings, and keep them in iCloud (if configured).

If you go to the camera settings in the Home app, you will see an accessory connected to the camera which is treated as a motion detection sensor, so it can be used in automation scenarios such as turning on lights when the motion is detected (or a garden hose, hehe).

Screenshot 24. Camera Settings

Next, with “Recording Options” you can control when the camera should be off, detect activity and trigger automation and notifications without streaming, stream and record when activity is detected. Also, different levels can be configured for when somebody or nobody is home. Additionally, you can set it to react only to some types of motion analyzed by HomeKit.

Screenshot 25. Recording Options

You may want to receive notifications per special types of motion: people, animals, vehicles, or packages; or when the camera goes offline. You can also narrow down to the time when you want to be notified as well as when somebody is home or not. Apart from that it can also show you snapshots in notifications.

Screenshot 26. Camera Recordings Timeline

With the camera settings updated, on the camera screen, you will see a timeline that will help you navigate across different events captured and watch the corresponding recording.

Another setting I want to mention is that you can draw activity zones on the camera view to limit the area where motion should be detected.

Finally, you can enable Face Recognition utilizing your Photo library so that HomeKit can recognize people detected on the camera and show names in notifications and recordings. According to Apple, this analysis happens between the Home hub and your Apple device without sending data to Apple servers.

Screenshot 27. Apple Watch Screen

Having all that configured with the Home hub in my home network, I can even stream video from the Wyze camera when not at home on my Apple Watch, amazing!

Optional Part 4. Standalone Server

The additional topic I wanted to cover since I did it in my setup, is how I installed the described components on a separate server running in my home network 24/7.

You can still have Docker Wyze Bridge and Scrypted services running on your computer, but if it’s not always at home and you need a constant connection between the Wyze cameras and HomeKit, a better idea would be to use something like Raspberry Pi.

What I have is a Libre Computer Sweet Potato which is an alternative to Raspberry Pi with a 1.4 GHz CPU and 2GB SDRAM, running Raspberry Pi OS (previously called Raspbian) 12 Bookworm with Homebridge.

Looking ahead, its parameters seem to be not enough at least by the Scrypted recommendations: “All servers are recommended to have at least 8GB of RAM, 16GB preferred” from https://docs.scrypted.app/buyers-guide/servers.html#server-recommendations

I launched Docker Wyze Bridge using Docker Compose following the instructions here: https://github.com/mrlt8/docker-wyze-bridge?tab=readme-ov-file#docker-compose-recommended

SSH to Raspberry and install Docker Compose for example with the following command:

sudo apt install docker-compose

It’s also useful to enable Docker to start when the OS starts so that it will be up and running after the power outage.

Then I created the docker-compose.yaml file in the Documents directory…

cd Documents
touch docker-compose.yaml

…copied sample contents from the GitHub: https://raw.githubusercontent.com/mrlt8/docker-wyze-bridge/main/docker-compose.sample.yml and configured environment variables with Wyze credentials.

The only thing left is to run docker-compose up to start Docker Wyze Bridge in detached mode.

docker-compose up -d

Scrypted is installed using Docker Compose as well, but with the help of the script available here: https://github.com/koush/scrypted/wiki/Installation:-Docker-Compose-Linux

Following the same steps described above I was able to configure both Docker Wyze Bridge and Scrypted with plugins without any issues. Note that Scrypted can communicate with Docker Wyze Bridge over localhost if running on the same server.

Before installation Sweet Potato was barely loaded, keeping CPU usage stable under ~3% and memory available at ~1.2 GB. After the setup is done CPU usage jumps from 20% to 40% and the memory available is left at ~0.6 GB.

However, the Sweet Potato goes down in less than 24 hours, so I recommend setting up a separate and more powerful computer for running Docker Wyze Bridge and Scrypted.

Conclusion

In conclusion, by following these steps, you can seamlessly integrate your Wyze Cam v4 into Apple HomeKit, unlocking a range of powerful features and enhancing your smart home experience.

While it takes a bit of effort to set up, the result is a fully functional, HomeKit-compatible camera that fits perfectly into your Apple ecosystem.

Whether you’re looking to expand your smart home or just want more control over your devices, this guide should help you achieve that. Happy automating!

That’s all Folks!

--

--