mrlt8 / docker-wyze-bridge

WebRTC/RTSP/RTMP/LL-HLS bridge for Wyze cams in a docker container
GNU Affero General Public License v3.0
2.45k stars 151 forks source link

CamPam V3 Home Assistant MQTT Cruise_Point positions 3 & 4 incorrect #1228

Closed Deach01 closed 2 weeks ago

Deach01 commented 1 month ago

Describe the bug

Sending MQTT cruise point position commands to the camera results in positions 3 and 4 moving to the wrong place. They appear to be about 180 deg from where they are set to in Wyze app. This occurs in all three of my CamPan V3 cameras. If I reset cruise points to factory default in Wyze app, MQTT still sends the camera to incorrect position for 3 and 4. Positions 1 and 2 are fine.

It acts as if it doesn’t know that the cam can go above 180deg pan and rotates all the way around in the wrong direction to try to reach the new point.

From logs [back-deck-cam] [CONTROL] Attempting to SET: cruise_point=('cruise_point', '1') [back-deck-cam] Pan to cruise_point=0 (75, 124) [back-deck-cam] [CONTROL] Attempting to SET: cruise_point=('cruise_point', '2') [back-deck-cam] Pan to cruise_point=1 (113, 162) [back-deck-cam] [CONTROL] Attempting to SET: cruise_point=('cruise_point', '3') [back-deck-cam] Pan to cruise_point=2 (91, 203) [back-deck-cam] [CONTROL] Attempting to SET: cruise_point=('cruise_point', '4') [back-deck-cam] Pan to cruise_point=3 (75, 15)

[back-deck-cam] [CONTROL] Attempting to GET: cruise_points [back-deck-cam] [CONTROL] response=[{'vertical': 75, 'horizontal': 124, 'time': 0, 'blank': 10}, {'vertical': 113, 'horizontal': 162, 'time': 0, 'blank': 10}, {'vertical': 91, 'horizontal': 203, 'time': 0, 'blank': 10}, {'vertical': 75, 'horizontal': 15, 'time': 1, 'blank': 10}]

After reset to Defaults from wyze: [back-deck-cam] [CONTROL] Attempting to GET: cruise_points [back-deck-cam] [CONTROL] response=[{'vertical': 90, 'horizontal': 40, 'time': 0, 'blank': 10}, {'vertical': 90, 'horizontal': 130, 'time': 0, 'blank': 10}, {'vertical': 90, 'horizontal': 220, 'time': 0, 'blank': 10}, {'vertical': 90, 'horizontal': 54, 'time': 1, 'blank': 10}]

Environment (if applicable)

mrlt8 commented 1 month ago

hmm... Can you try to manually pan to those positions by setting ptz_position to 90, 200?

Does this only happen for values above 255?

n00lan commented 3 weeks ago

I'm having the same issue, no matter where you set cruise point 3 and 4, it tries to go around and not directly to them. it doesnt matter where you have set points 3 and 4, it trues to spin the camera all the way around and gets lost.

Deach01 commented 3 weeks ago

Sorry for the delay replying and thanks for all the other fixes and updates. Manually panning to positions using MQTT works as expected: [driveway-cam] [CONTROL] Attempting to SET: ptz_position=90,0 [driveway-cam] [CONTROL] response=161,255,165,46 [driveway-cam] [CONTROL] Attempting to SET: ptz_position=90,255 [driveway-cam] [CONTROL] response=71,110,166,46 [driveway-cam] [CONTROL] Attempting to SET: ptz_position=90,300 [driveway-cam] [CONTROL] response=245,28,167,46 [driveway-cam] [CONTROL] Attempting to SET: ptz_position=90,300 [driveway-cam] [CONTROL] response=87,182,168,46 [driveway-cam] [CONTROL] Attempting to SET: ptz_position=90,254 [driveway-cam] [CONTROL] response=152,44,169,46 [driveway-cam] [CONTROL] Attempting to SET: ptz_position=90,340 [driveway-cam] [CONTROL] response=83,253,169,46

The 90,300 position is approximately where the cruise position 3 should be and where the camera goes to when commanded by the native WYZE app.

But [driveway-cam] [CONTROL] Attempting to GET: cruise_points [driveway-cam] [CONTROL] response=[{'vertical': 90, 'horizontal': 188, 'time': 0, 'blank': 10}, {'vertical': 90, 'horizontal': 245, 'time': 0, 'blank': 10}, {'vertical': 90, 'horizontal': 52, 'time': 1, 'blank': 10}, {'vertical': 116, 'horizontal': 26, 'time': 1, 'blank': 10}]

I created a similar (not identical) camera position to cruise 3 in cruise 1 using the WYZE app and the camera now goes to the incorrect position for cruise 1 when commanded from MQTT

[driveway-cam] [CONTROL] Attempting to SET: cruise_point=('cruise_point', '2') [driveway-cam] Pan to cruise_point=1 (90, 245) [driveway-cam] [CONTROL] Attempting to SET: cruise_point=('cruise_point', '1') [driveway-cam] Pan to cruise_point=0 (90, 34) [driveway-cam] [CONTROL] Attempting to GET: cruise_points [driveway-cam] [CONTROL] response=[{'vertical': 90, 'horizontal': 34, 'time': 1, 'blank': 10}, {'vertical': 90, 'horizontal': 245, 'time': 0, 'blank': 10}, {'vertical': 90, 'horizontal': 52, 'time': 1, 'blank': 10}, {'vertical': 116, 'horizontal': 26, 'time': 1, 'blank': 10}]

It appears that the incorrect pan value is being reported for some values when used in a cruise position.

Thanks for all your efforts Christopher

mrlt8 commented 3 weeks ago

@Deach01 Could you try the latest edge build to see if that fixes the issue?

Deach01 commented 2 weeks ago

That fixed it and also the cruise_points/get now returns the numbers expected.

Many thanks!

Wyze should pay you for this code. I would have dumped Wyze and gone to another brand if Wyzebridge didn’t exist.

Anyone reading this, please consider a donation to mrlt8! Just click on the coffee cup under “sponsor this project” on the right of the main page.