Skip to content

Home Assistant

mrlt8 edited this page Jul 6, 2024 · 22 revisions

Use as an Add-on

Install

  1. Add the docker-wyze-bridge repo:

    Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.

  2. Install Docker Wyze Bridge as an add-on 🎉

Config

Once installed, you'll need to add the email and password associated with your wyze account on the configuration tab before starting the container.

Two-Factor Authentication (2FA)

If you have Two-Factor Authentication enabled on your wyze account ("Two-Step Verification" in the wyze app), you'll need to enter your verification code when you login.

Starting with v1.8.7, visiting the WebUI should give you a form where you can submit your 2FA code.

Additionally, you can also add your verification code to the text file: /config/wyze-bridge/mfa_token.txt.

Automated 2FA

If you're using the Time-based One-Time Password (TOTP), you can have the bridge generate and enter the verification when needed by setting TOTP_KEY to your shared secret/secret key which is provided in the wyze app when setting up TOTP.

Still Images/Snapshots

The add-on should automatically grab a thumbnail for each of your cameras from wyze and save it to /media/wyze/img/cam-name.jpg which can be accessed using the WebUI: http://homeassistant.local:5000/img/cam-name.jpg.

The add-on will use SNAPSHOT: API by default which will pull the image from the wyze api once, but you can set SNAPSHOT: RTSP if you want it to capture the image directly from the RTSP stream every 180 seconds.

SNAPSHOT_FORMAT can be used in combination with SNAPSHOT to specify the output file to be used for snapshot. e.g. SNAPSHOT_FORMAT={cam_name}/%Y-%m-%d/%H-%M.jpg could be used to save multiple snapshots.

On-demand snapshots

You can also grab a fresh snapshot by accessing the snapshot WebUI endpoint:

http://homeassistant.local:5000/snapshot/cam-name.jpg

MQTT

MQTT discovery will be enabled by default if available. This can be disabled by setting MQTT_HOST: false

Other Config Options

Note: Formatting in HA is slightly different than the standard docker-compose yml.

in Home Assistant, USE:

FILTER_NAMES: Front Door, porch

instead of the standard:

- FILTER_NAMES=Front Door, porch

Camera Specific Options

Camera specific options can now be passed to the bridge using CAM_OPTIONS. To do so you, will need to specify the CAM_NAME and the option(s) that you want to pass to the camera.

CAM_OPTIONS:

- CAM_NAME: Front
  AUDIO: true
  ROTATE: true
- CAM_NAME: Back door
  QUALITY: SD50

Available options:

  • AUDIO - enable audio for this camera.
  • FFMPEG - use a custom ffmpeg command for this camera.
  • LIVESTREAM - specify a rtmp url to livestream to for this camera.
  • NET_MODE - change the allowed net mode for this camera only.
  • QUALITY - Adjust the quality for this camera only.
  • RECORD - enable recording for this camera.
  • ROTATE - rotate video (rotation options)
  • ROTATE_IMG - rotate snapshots.
  • SUBSTREAM - enable high/low substream for this camera if supported.
  • SUB_QUALITY - Adjust the quality for this substream only.

MediaMTX

MediaMTX options can be customized by entering each customization into MEDIAMTX, e.g. use paths_all_readuser=123 for paths: all: readuser:123.

UI config:

paths_all_readuser=123

YAML config:

MEDIAMTX: 
  - paths_all_readuser=123

Adding Cameras

Generic Camera

Your cameras can be added to Home Assistant using the generic camera platform.

  • still_image_url: http://127.0.0.1:5000/snapshot/cam-name.jpg
  • stream_source: rtsp://127.0.0.1:8554/cam-name

FFmpeg Camera

The FFmpeg Camera platform can also be used with the advantage of automatically generating an updated thumbnail.

  • input: rtsp://127.0.0.1:8554/cam-name