Skip to content

Camera Motion

mrlt8 edited this page May 31, 2024 · 4 revisions

Uses motion events from the Wyze Web API, so an active connection to the camera is not required - great for battery based cams.

Note

This uses Wyze's motion detection, so each device will be limited by its own 5 minute cooldown similar to the official wyze app. A CamPlus subscription is recommended if you need more frequent detection.

Config

  • MOTION_API=True to enable motion events. (Default: False)
  • MOTION_INT=<float> number of seconds between motion checks. (Default: 1.5)
  • MOTION_START=True to have the bridge initiate a connection to the camera on a motion event. (Default: False)

MQTT Topics

  • wyzebridge/{cam-name}/motion
  • wyzebridge/{cam-name}/motion_ts

REST endpoints

  • /api/{cam-name}/motion
  • /api/{cam-name}/motion_ts

Webhooks

Can optionally use {cam_name} in the url to make a request to a url with the camera name.

For all cameras:

environment:
  ...
  - MOTION_WEBHOOKS=http://localhost/event?cam={cam_name}

For a specific camera:

environment:
  ...
  - MOTION_WEBHOOKS_CAM-NAME=http://localhost/myEvent
  - MOTION_WEBHOOKS_CAM2=http://localhost/myOtherEvent
  - MOTION_WEBHOOKS_CAM3=http://localhost/all_events?cam={cam_name}

🏠 Home Assistant - Use CAM_OPTIONS and add a new entry for each camera:

- CAM_NAME: My Camera
  MOTION_WEBHOOKS: http://localhost/myEvent

Webhooks payload

Motion detected on cam-name at hh:mm:ss

Image url and camera name are available in the request header:

X-Title: Motion Event
X-Attach: https://...
X-Tags: camera-name, motion
X-Camera: camera-name
X-Event: motion

ntfy

Motion webooks are ntfy ready and will automatically display the title and preview image.

- MOTION_WEBHOOKS=https://ntfy.sh/mytopic/trigger

self hosted ntfy:

- MOTION_WEBHOOKS=http://<local IP>/mytopic/trigger