Skip to content
Brice Ruth edited this page Dec 5, 2021 · 19 revisions

This guide documents how to set up Wyze Cameras with the Dafang-Hack mod to enable motion alerts and RTSP streams.

MQTT

  1. Install the Scrypted MQTT Plugin and enable the MQTT Broker.

Dafang-Hacks

MQTT

  1. In the Dafang-Hacks web ui of your camera, go to the gear icon located in the top navigation bar then network services.
  2. Enter the ip address of Scrypted. The default server port is 1883. If you didn't set up a user id and password in your MQTT plugin, you can leave those fields blank. Set your Location and Device to whatever you'd like. I used "Home" for location on all my cameras and whatever room the camera is in as the device name, i.e. "Garage".
  • Ensure that MQTT notifications and Motion Detection are enabled, they may not be by default.

Camera Settings

  1. Go to gear icon, camera, video, format. The settings I use which give me reliable streaming are: H264, 1280x720, 299kbps, FixedQp, 15FPS. This should allow you to stream through Scrypted without transcoding (copy).
  • Community reports also indicate H264, 1280x720, 2000kbps, VBR, 15FPS works well.
  1. Go to Audio, change the audio format to MP3. This will further prevent any streaming issues.
  2. Go to the wrench/screwdriver icon, services. Ensure that "MQTT Live Status Updates" control is set to start and autostart is set to on. I believe these are already activated by default.

Passwords

  1. Go to gear icon, system, properties. Set your http root password. (ID should be "root" by default.) This is supposed to set your password protection for dafang's web ui, but I can't remember if I ever have been asked to enter my password. This will be used for the snapshot url later in Scrypted.
  2. Go to gear icon, camera, video, network/security. Set your user id and password. These will be used for your rtsp stream later in Scrypted.

Scrypted

Plugins

  1. In the Scrypted web ui, go to the plugins page and click "Install Plugin". Install the following plugins: mqtt (should already have this), rtsp, rebrebroadcast, and homekit.

MQTT

  1. From the plugins page, open the mqtt plugin, and type the name of the device into the "Add MQTT Custom Handler" field inside the "Settings" panel. Then click the green paper airplane icon to add it. Click on your new device which should now be showing in the "Providing Things" panel.
  2. In the "MQTT Handler" panel, I replaced all of the default code with:
createMotionSensor({
    topic: 'motion',
    when: ({text}) => text === 'ON',
    delay: 10
})
  1. Set your device type to "Sensor".
  2. Within the "Settings" panel, for the "Subscription URL" field enter your mqtt url: mqtt://ip.address.of.pi/Home/Garage/
  3. Within the "Integrations and Extensions" panel, make sure the "Homekit" checkbox is NOT checked. The motion sensor will be integrated with the camera later.

Adding cameras

  1. From the plugins page, open the RTSP Camera Controller plugin and add a new camera. In the "Settings" panel type the name of your camera and click the green paper airplane icon to add it. The new camera should be in the "Provider Things" panel.
  2. In the "Integrations and Extensions" panel, ensure the rebroadcast plugin and homekit checkboxes are checked.
  3. In the "Settings" panel under "General", enter the username and password you used in step 8. Make sure you click the green paper airplane icon after each field is filled to save that particular field.
  4. For snapshot url use: http://root:password_from_step7@ip.address.of.camera/cgi-bin/currentpic.cgi
  5. For RTSP Stream URL use: rtsp://ip.address.of.camera:8554/unicast This field won't display a green paper airplane icon for saving. Instead click the "Save RTSP Stream URL" button.
  6. Under "Rebroadcasting: Stream 1", "Audio Codec Transcoding", select "MP2/MP3 Audio".
  7. Under "Homekit", "Linked Motion Sensor", select the mqtt motion sensor you created in step 10.
  8. The remaining settings I left as default.
  9. You might need to restart scrypted (in settings) to ensure everything is working.

Homekit

  1. From the plugins page, open the Homekit plugin. In the settings panel, you can see the pairing info needed to add Scrypted to homekit.
  2. In the "Homekit" panel, click console button to view the homekit QR code.