Integrating the Wyze Cam v2 with Home Assistant (including motion detection)

Disclosure: This post contains affiliate links. If you click through and make a purchase, I will earn a commission, at no additional cost to you. Read my full disclosure here.

The Wyze Cam v2 is a very popular security camera in the Home Assistant community. It can broadcast video in 1080p Full-HD quality, it has night vision using four infrared LEDs, and 2-way audio. Despite boasting impressive specs, the Wyze Cam v2 can be bought for just $20 (MSRP). And the company seems like one deserving of support. Wyze got plaudits from the community when they responded to webcams selling out during the pandemic when by developing and releasing a Webcam Firmware for their cameras.

Wyze's Approach to RTSP Implementation: A Double-Edged Sword?

A point of contention among some users is the manner in which Wyze has integrated Real Time Streaming Protocol (RTSP) into their devices. Rather than incorporating it as a default feature within the firmware, they have chosen to offer it as a separate beta release, which requires users to download and manually install it onto their cameras.

Though updates for the RTSP are released sporadically, one could argue that this approach is not entirely unreasonable, especially when considering that a significant number of security cameras on the market do not support RTSP in the first place.

Wyze's decision to offer RTSP through a beta release might be seen as a way to cater to those who value this functionality, whilst not overloading the firmware with unnecessary features for users who may not require it. This approach enables them to maintain a balance between versatility and simplicity, ensuring that their products remain accessible to a broad range of customers.

Nonetheless, it is important to keep in mind that the beta release status of the RTSP implementation might result in occasional glitches or compatibility issues. Users who embark on this journey should be prepared to encounter potential hiccups along the way, and to rely on community support and their own resourcefulness to troubleshoot any challenges that may arise.

A white Wyze Cam v2 mounted to a wall.
The Wyze Cam v2 mounted to a wall

Why RTSP matters

The Real Time Streaming Protocol (RTSP) is a network control protocol designed for use in entertainment and communications systems. Using RTSP, you can display your camera’s video stream on any supported platform. And it just so happens that Home Assistant supports RTSP.

While researching the topic, I couldn’t help but become overwhelmed with nostalgia when I read that RealNetworks, who built the RealPlayer, and Netscape were involved in the development of RTPS. Today, RTSP is still kicking because of how easy it is to implement. Better solutions, such as the standards defined by the Open Network Video Interface Forum, would be available.

Currently, the only way of integrating your Wyze Cam v2 with Home Assistant is by flashing the beta firmware and enabling RTSP.

How to prepare your Wyze Cam v2

Detailed instructions on how to flash the RTSP firmware are available on the Wyze website. All you need is your Wyze Cam v2 and a microSD card. Once your camera is ready and RTSP has been enabled, you can get started with the integration.

On the subject of microSD cards: If you are planning to continuously record footage with your Wyze Cam v2, make sure you get a card which is rated for endurance. You will quickly burn through cheaper options because microSD cards do wear out quickly when they are frequently being written to.

If you want this integration to keep working without any hiccups, you will want to assign a static IP address to each and every camera you have. If you don’t do that, the Wyze Cam v2’s IP might change after a certain amount of time or during a reboot and the integration will stop working.

Enabling motion detection in Home Assistant

The following discovery was made by Reddit user /u/ChiefBroady. As detailed in their post, you will have to set up a binary_sensor using the platform ffmpeg_motion for each Wyze Cam v2. Copy the code down below and change the username, password, and IP address as well as the sensor’s name.

binary_sensor:
  - platform: ffmpeg_motion
    input: -rtsp_transport http -i rtsp://USER:PASSWORD@IP-ADDRESS/live
    name: CAMERA_MOTION
    extra_arguments: -pred 1 -q:v 2
    changes: 10
    reset: 10

The extra arguments in the code define the quality of your stream. The changes argument defines how many details between two frames need to change to detect it as a motion event. If the motion detection is too sensitive, you might want to increase that number (it goes from 0-100). Finally, reset defines the time to reset the state after no new motion is detected.

Adding Wyze Cam v2 video stream to Home Assistant

You will probably also want to see the camera’s video stream in your Home Assistant dashboard. Why else would you use a security camera capable of RTSP streaming? To accomplish that, you can simply add a camera using the ffmpeg platform. Here you will once again have to adjust the camera’s name and the username, password, and IP address.

camera:
  - platform: ffmpeg
    name: CAMERA_NAME
    input: -rtsp_transport http -i rtsp://USER:PASSWORD@IP-ADDRESS/live
    extra_arguments: -pred 1 -q:v 2
A portrait photo oif Liam Alexander Colman, the author, creator, and owner of Home Assistant Guide wearing a suit.

About Liam Alexander Colman

is an experienced Home Assistant user who has been utilizing the platform for a variety of projects over an extended period. His journey began with a Raspberry Pi, which quickly grew to three Raspberry Pis and eventually a full-fledged server. Liam's current operating system of choice is Unraid, with Home Assistant comfortably running in a Docker container.
With a deep understanding of the intricacies of Home Assistant, Liam has an impressive setup, consisting of various Zigbee devices, and seamless integrations with existing products such as his Android TV box. For those interested in learning more about Liam's experience with Home Assistant, he shares his insights on how he first started using the platform and his subsequent journey.

Comments

Leave a comment

Share to...