Wyzecam integration

Dont know if this was request before, but it will be good to have a official wyzecam integration to Home assistant, with local support

Flash your WyzeCam with this firmware and it will work via RTSP in HASS: https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks

I’ve been using this for a while and it works pretty well. Only issue is that enabling MQTT on the camera seems to harm the stream, so until that’s fixed, I’ve left it off.

2 Likes

Did you use this file? rtspserver.conf
If so, how do you have it configured?

I do. Here’s what mine looks like:

#######################################################################
# Edit this file and move it to /system/sdcard/config/rtspserver.conf #
# if you need to add options, otherwise defaults will be used         #
#######################################################################

# Configure RTSP Servers
# Use /system/sdcard/bin/v4l2rtspserver-master -h to see available options

PORT=8554

# H264 RTSP server options
# Examples:
# RTSPH264OPTS="-W960 -H540"
# To enable authentication:
# RTSPH264OPTS="-U user:password"
RTSPH264OPTS="-W1280 -H720"

# MJPEG RTSP server options
# Examples:
# RTSPMJPEGOPTS="-W960 -H540"
# To enable authentication:
# RTSPMJPEGOPTS="-U user:password"
RTSPMJPEGOPTS="-W1280 -H720"

# Video
BITRATE=5000
# Framerate
FRAMERATE_DEN=1
FRAMERATE_NUM=15
# Video format: (0 = FixedQp, 1 = CBR, 2 = VBR, 3 = SMART, default = 2)
VIDEOFORMAT=2

# AudioFormat
# Can be: OPUS | MP3 | PCM | PCMU
AUDIOFORMAT=OFF
# Audio sampling rate
AUDIOINBR=16000
# Audio streaming sampling rate
AUDIOOUTBR=44100
HWVOLUME=70
SWVOLUME=-1
FILTER=4
HIGHPASSFILTER=true
AECFILTER=true
USERNAME=
USERPASSWORD=

I’ve applied your settings and so far so good.

This is my config in hass. Is yours similar?

camera:
  - platform: ffmpeg
    name: WyzeCam-Front
    input: -rtsp_transport tcp -i rtsp://10.0.0.35:8554/unicast

Your config has the video at 1280x720.
It would be great if it could handle 1080 but the openipc doc shows the max it can handle is 1600x900 have you had any luck getting higher than 720?

How else are you using your camera with hass? motion detection… storing video streams or images… etc?

I think the Wyze software is pretty decent so hopefully they’ll come through and as RTSP as they’ve mentioned they will.

thanks

This is my config in hass. Is yours similar?

Exact same!

It would be great if it could handle 1080 but the openipc doc shows the max it can handle is 1600x900 have you had any luck getting higher than 720?

Yes, but it can be a bit tricky because you have to flash a new bootloader. Instructions here: Xiaomi-Dafang-Hacks/hacks/flashinguboot.md at master · EliasKotlyar/Xiaomi-Dafang-Hacks · GitHub

How else are you using your camera with hass? motion detection… storing video streams or images… etc?

Right now, I’m just using it as a passive camera for me to view on-demand. To be really useful for automation, you need MQTT, but there’s an active bug wherein the HASS video stream gets killed when MQTT support is activated (Turning on MQTT services breaks HomeAssistant image retrieval · Issue #638 · EliasKotlyar/Xiaomi-Dafang-Hacks · GitHub). Hope there’s a fix soon…

After using it for a couple of days, the connection seems to unstable to use. It seems very hit or miss trying to get video from it. I’ll wait for official RTSP.

If you are looking for motion detection to trigger actions, have you looked into their IFTTT integration?
This may prove useful.
Motion detected with the camera could trigger an API call to turn on lights or perform other actions.

An alternative (which may be overkill for your use case) is to set up zoneminder to talk to the cameras and have HA talk to ZM. This works far better with none of the odd cutouts and choppy video that I was seeing when HA was talking directly to the cameras.

1 Like

This is how I configured mine, although admittedly it is still unstable. Luckily I only purchased the camera for testing blue iris and home assistant/mqtt. I will however be replicating the setup for all of my other ip cams.

I’ve been relying on TinyCam Pro to get my Wyze Cams on HomeAssistant, but I wish there was just a native way to get them running without me having to leave my PC on running an Android Emulator to be able to see those feeds.

Their recent video indicated that RTSP would be coming in “first half of” 2019… I think that’s what I heard. Or maybe that was the Google Home integration? They did show a sample of a Wyze running on a Google Home Hub towards the end. I think they said “first quarter” for that…

That’s wonderful news, here’s to hoping.

I just quickly found the video and skimmed to the section. He did say RTSP by Q2 2019 with “high confidence”. And Google by Q1. It’s here if anyone cares to watch. Other interesting tidbits about an outdoor camera and general marketing hubbub. :slight_smile:

4 Likes

Anything new regarding integration of Wyze camera with stock firmware into home assistant?

Did I hear that Wyze cam that is produced after Dec 2018 won’t get RTSP firmware support at 6:54?

No. He said any new features released after Dec 2018 in the regular firmware - will not be available for the RTSP firmware.

Unfortunately I don’t know how to program, but could this be ported to Home Assistant code?

looks like the TinyCam author has shared some of his source code

1 Like

It is a memory issue. You could create a swap file to leverage some of this problems. I only use motion detection with mqtt. But status and control servers are off otherwise the camera will hang after a while. You will need to activate the mqtt servers once though to get the entity ID in hass.

I want to do this, how do you run ZM? (As in on what device?) I want to create a VM just for it, however I have no clue on how much resources it would need to operate.

I have an old HP 8200 SFF running ZM and HA - CPU use is less than 10%.