Wyzecam integration


#1

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


#2

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.


#3

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


#4

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=

#5

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


#6

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: https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/blob/master/hacks/flashinguboot.md

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 (https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/issues/638). Hope there’s a fix soon…


#7

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.


#8

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.


#9

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.