Skip to content

Commit

Permalink
Wyze Cam Doorbell v2 (#1034)
Browse files Browse the repository at this point in the history
* trigger interval snapshots via web API #1030

* Add support for V4 and Doorbell V2 #1024

* Newer auth protocol and fw11 bitrate check #1024

* Add commands for spotlight and accessories #921

* Revert "Update MediaMTX version from v1.1.1 to v1.2.1 (#1016)"

This reverts commit 8f6767a.

* Add latest fw version #1026

* changelog
  • Loading branch information
mrlt8 authored Nov 4, 2023
1 parent 8f6767a commit fc71815
Show file tree
Hide file tree
Showing 10 changed files with 327 additions and 516 deletions.
52 changes: 32 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ You can then use the web interface at `http://localhost:5000` where localhost is

See [basic usage](#basic-usage) for additional information or visit the [wiki page](https://github.com/mrlt8/docker-wyze-bridge/wiki/Home-Assistant) for additional information on using the bridge as a Home Assistant Add-on.

## What's Changed in v2.5.0

* NEW camera support:
* HL_DB2: Wyze Cam Doorbell v2 - thanks @hoveeman!
* HL_CAM4: Wyze Cam V4
* NEW API Endpoint:
* `/api/all/update_snapshot` - trigger interval snapshots via web API #1030

## What's Changed in v2.4.0

* Motion Events!
Expand Down Expand Up @@ -84,33 +92,37 @@ See [basic usage](#basic-usage) for additional information or visit the [wiki pa
![Wyze Cam Outdoor](https://img.shields.io/badge/wyze_outdoor-yes-success.svg)
![Wyze Cam Outdoor V2](https://img.shields.io/badge/wyze_outdoor_v2-yes-success.svg)
![Wyze Cam Doorbell](https://img.shields.io/badge/wyze_doorbell-yes-success.svg)
![Wyze Cam Doorbell V2](https://img.shields.io/badge/wyze_doorbell_v2-yes-success.svg)

Cameras from [Gwell Times](http://cloud.gwell.cc) are currently not supported:

![Wyze Cam Doorbell Pro](https://img.shields.io/badge/wyze_doorbell_pro-no-inactive.svg)
![Wyze Cam OG](https://img.shields.io/badge/wyze_og-no-inactive.svg)
![Wyze Cam OG 3x](https://img.shields.io/badge/wyze_og_3x-no-inactive.svg)

| Camera | Model | Supported |
| ----------------------------- | -------------- | ----------------------------------------------------------- |
| Wyze Cam v1 [HD only] | WYZEC1 ||
| Wyze Cam V2 | WYZEC1-JZ ||
| Wyze Cam V3 | WYZE_CAKP2JFUS ||
| Wyze Cam V3 Pro [2K] | HL_CAM3P ||
| Wyze Cam Floodlight | WYZE_CAKP2JFUS ||
| Wyze Cam Pan | WYZECP1_JEF ||
| Wyze Cam Pan v2 | HL_PAN2 ||
| Wyze Cam Pan v3 | HL_PAN3 ||
| Wyze Cam Pan Pro [2K] | HL_PANP ||
| Wyze Cam Outdoor | WVOD1 ||
| Wyze Cam Outdoor v2 | HL_WCO2 ||
| Wyze Cam Doorbell | WYZEDB3 ||
| Wyze Battery Cam Pro | AN_RSCW ||
| Wyze Cam Doorbell Pro 2 | AN_RDB1 ||
| Wyze Cam Flood Light Pro [2K] | LD_CFP | [⚠️](https://github.com/mrlt8/docker-wyze-bridge/issues/822) |
| Wyze Cam Doorbell Pro | GW_BE1 | [⚠️](https://github.com/mrlt8/docker-wyze-bridge/issues/276) |
| Wyze Cam OG | GW_GC1 | [⚠️](https://github.com/mrlt8/docker-wyze-bridge/issues/677) |
| Wyze Cam OG Telephoto 3x | GW_GC2 | [⚠️](https://github.com/mrlt8/docker-wyze-bridge/issues/677) |
| Camera | Model | Tutk Support | Latest FW |
| ----------------------------- | -------------- | ------------------------------------------------------------ | --------- |
| Wyze Cam v1 [HD only] | WYZEC1 || 3.9.4.x |
| Wyze Cam V2 | WYZEC1-JZ || 4.9.9.x |
| Wyze Cam V3 | WYZE_CAKP2JFUS || 4.36.11.x |
| Wyze Cam V4 [2K] | HL_CAM4 || 4.52.? |
| Wyze Cam Floodlight | WYZE_CAKP2JFUS || 4.36.11.x |
| Wyze Cam Floodlight V2 | HL_CFL2 || - |
| Wyze Cam V3 Pro [2K] | HL_CAM3P || 4.58.11.x |
| Wyze Cam Pan | WYZECP1_JEF || 4.10.9.x |
| Wyze Cam Pan v2 | HL_PAN2 || 4.49.11.x |
| Wyze Cam Pan v3 | HL_PAN3 || 4.50.4.x |
| Wyze Cam Pan Pro [2K] | HL_PANP || - |
| Wyze Cam Outdoor | WVOD1 || 4.17.4.x |
| Wyze Cam Outdoor v2 | HL_WCO2 || 4.48.4.x |
| Wyze Cam Doorbell | WYZEDB3 || 4.25.1.x |
| Wyze Cam Doorbell v2 [2K] | HL_DB2 || 4.51.1.x |
| Wyze Cam Doorbell Pro 2 | AN_RDB1 || - |
| Wyze Battery Cam Pro | AN_RSCW | [⚠️](https://github.com/mrlt8/docker-wyze-bridge/issues/1011) | - |
| Wyze Cam Flood Light Pro [2K] | LD_CFP | [⚠️](https://github.com/mrlt8/docker-wyze-bridge/issues/822) | - |
| Wyze Cam Doorbell Pro | GW_BE1 | [⚠️](https://github.com/mrlt8/docker-wyze-bridge/issues/276) | - |
| Wyze Cam OG | GW_GC1 | [⚠️](https://github.com/mrlt8/docker-wyze-bridge/issues/677) | - |
| Wyze Cam OG Telephoto 3x | GW_GC2 | [⚠️](https://github.com/mrlt8/docker-wyze-bridge/issues/677) | - |


## Compatibility
Expand Down
2 changes: 1 addition & 1 deletion app/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION=2.4.0
MTX_TAG=1.2.1
MTX_TAG=1.1.1
IOS_VERSION=17.0.3
APP_VERSION=2.44.5.3
MTX_HLSVARIANT=fmp4
Expand Down
9 changes: 9 additions & 0 deletions app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## What's Changed in v2.5.0

* NEW camera support:
* HL_DB2: Wyze Cam Doorbell v2 - thanks @hoveeman!
* HL_CAM4: Wyze Cam V4
* NEW API Endpoint:
* `/api/all/update_snapshot` - trigger interval snapshots via web API #1030


## What's Changed in v2.4.0

* Motion Events!
Expand Down
1 change: 1 addition & 0 deletions app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Should work on most x64 systems as well as on some arm-based systems like the Ra
![Wyze Cam Outdoor](https://img.shields.io/badge/wyze_outdoor-yes-success.svg)
![Wyze Cam Outdoor V2](https://img.shields.io/badge/wyze_outdoor_v2-yes-success.svg)
![Wyze Cam Doorbell](https://img.shields.io/badge/wyze_doorbell-yes-success.svg)
![Wyze Cam Doorbell V2](https://img.shields.io/badge/wyze_doorbell_v2-yes-success.svg)

![Wyze Cam Doorbell Pro](https://img.shields.io/badge/wyze_doorbell_pro-no-inactive.svg)
![Wyze Cam OG](https://img.shields.io/badge/wyze_og-no-inactive.svg)
Expand Down
2 changes: 2 additions & 0 deletions app/wyzebridge/bridge_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ def is_livestream(uri: str) -> bool:

def is_fw11(fw_ver: Optional[str]) -> bool:
with contextlib.suppress(IndexError, ValueError):
if fw_ver and (fw_ver.startswith("4.51") or fw_ver.startswith("4.52")):
return True
if fw_ver and int(fw_ver.split(".")[2]) > 10:
return True
return False
30 changes: 17 additions & 13 deletions app/wyzebridge/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def monitor_streams(self, mtx_health: Callable) -> None:
events = WyzeEvents(self.streams) if MOTION else None
while not self.stop_flag:
event.read(timeout=1)
self.snap_all(self.active_streams())
self.snap_all()
if events:
events.check_motion()
if int(time.time()) % 15 == 0:
Expand Down Expand Up @@ -138,21 +138,21 @@ def active_streams(self) -> list[str]:
"""
return [cam for cam, s in self.streams.items() if s.health_check() > 0]

def snap_all(self, cams: list[str]):
def snap_all(self, force: bool = False):
"""
Take an rtsp snapshot of the streams in the list.
Take an rtsp snapshot of active_streams.
Args:
- force (bool, optional): Ignore interval and force snapshot. Defaults to False.
Parameters:
- cams (list[str]): names of the streams to take a snapshot of.
"""
if SNAPSHOT_TYPE != "rtsp" or not cams:
return
if time.time() - self.last_snap < SNAPSHOT_INT:
return
self.last_snap = time.time()
for cam in cams:
stop_subprocess(self.rtsp_snapshots.get(cam))
self.rtsp_snap_popen(cam, True)
if force or (
SNAPSHOT_TYPE == "rtsp" and time.time() - self.last_snap >= SNAPSHOT_INT
):
self.last_snap = time.time()
for cam in self.active_streams():
stop_subprocess(self.rtsp_snapshots.get(cam))
self.rtsp_snap_popen(cam, True)

def get_sse_status(self) -> dict:
return {
Expand All @@ -176,6 +176,10 @@ def send_cmd(
"""
resp = {"status": "error", "command": cmd, "payload": payload}

if cam_name == "all" and cmd == "update_snapshot":
self.snap_all(True)
return resp | {"status": "success"}

if not (stream := self.get(cam_name)):
return resp | {"response": "Camera not found"}

Expand Down
4 changes: 4 additions & 0 deletions app/wyzebridge/wyze_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
"camera_info": "K10020CheckCameraInfo",
"battery_usage": "K10448GetBatteryUsage",
"rtsp": "K10604GetRtspParam",
"accessories": "K10720GetAccessoriesInfo",
"floodlight": "K10788GetIntegratedFloodlightInfo",
"whitelight": "K10820GetWhiteLightInfo",
"param_info": "K10020CheckCameraParams", # Requires a Payload
"_bitrate": "K10050GetVideoParam", # Only works on newer firmware
}
Expand Down Expand Up @@ -54,6 +57,7 @@
"ver_flip": "K10052VerticalFlip",
"rtsp": "K10600SetRtspSwitch",
"quick_response": "K11635ResponseQuickMessage",
"spotlight": "K10646SetSpotlightStatus",
}

CMD_VALUES = {
Expand Down
4 changes: 3 additions & 1 deletion app/wyzecam/api_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
"WYZEC1": "V1",
"WYZEC1-JZ": "V2",
"WYZE_CAKP2JFUS": "V3",
"HL_CAM4": "V4",
"HL_CAM3P": "V3 Pro",
"WYZECP1_JEF": "Pan",
"HL_PAN2": "Pan V2",
"HL_PAN3": "Pan V3",
"HL_PANP": "Pan Pro",
"WYZEDB3": "Doorbell",
"HL_DB2": "Doorbell V2",
"GW_BE1": "Doorbell Pro",
"AN_RDB1": "Doorbell Pro 2",
"GW_GC1": "OG",
Expand All @@ -40,7 +42,7 @@


# known 2k cameras
PRO_CAMS = {"HL_CAM3P", "HL_PANP"}
PRO_CAMS = {"HL_CAM3P", "HL_PANP", "HL_CAM4", "HL_DB2"}

PAN_CAMS = {"WYZECP1_JEF", "HL_PAN2", "HL_PAN3", "HL_PANP"}

Expand Down
Loading

0 comments on commit fc71815

Please sign in to comment.