Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for WyzeCam OG #150

Open
richt00 opened this issue Sep 11, 2023 · 12 comments
Open

Add Support for WyzeCam OG #150

richt00 opened this issue Sep 11, 2023 · 12 comments
Assignees
Labels
enhancement New feature or request

Comments

@richt00
Copy link

richt00 commented Sep 11, 2023

I'm trying to do some basic functions with my WyzeCam OG (turn on, turn off) using the SDK. The Web Client works just fine (I can list my OG using wyze_sdk.api.Client().devices_list()), but when I try to use the CamerasClient (wyze_sdk.api.Client().cameras.list()), I get nothing. I'm assuming that there is no support for the OG yet?

@mihaisiia
Copy link

I've submitted pull request #151 to add it to the models list.

@richt00
Copy link
Author

richt00 commented Sep 25, 2023 via email

@richt00
Copy link
Author

richt00 commented Jan 5, 2024 via email

@shauntarves
Copy link
Owner

Hey @richt00, if you're willing to send me some debugging information, I can try to get this working. Without an OG cam myself, I'm flying a bit blind.

Please enable debug logging by adding wyze_sdk.set_stream_logger('wyze_sdk', level=logging.DEBUG) to your python script and then running a few of the commands you are trying.

@richt00
Copy link
Author

richt00 commented Jan 5, 2024 via email

@shauntarves shauntarves added the enhancement New feature or request label Jan 13, 2024
@ConnorKneeland
Copy link

Hi All,

I am also hoping that I can use this to work with my WyzeCam OG. Please do let me know if there is any additional information I can provide!

@shauntarves
Copy link
Owner

@richt00 @ConnorKneeland,

Everything seems reasonable enough in this output, though I've never seen result: 3 like is shown in the last line {'ts': 1704475883638, 'code': '1', 'msg': '', 'data': {'session_id': '', 'custom_string': None, 'action_session_id': '', 'result': 3}}.

There's a little too much noise in what you pasted for me to be sure which lines correspond to which command(s).

Can we try this: Try the "turn off" action with and without debug enabled and paste the output here directly (don't upload a text file or try to attach to an email to respond)? And then do the same for the "restart" action

@richt00
Copy link
Author

richt00 commented Jan 22, 2024

Turn Off - No Debug:
{'ts': 1705952788027, 'code': '1', 'msg': '', 'data': {'session_id': '', 'custom_string': None, 'action_session_id': '', 'result': 3}}

Turn Off - Debug Enabled:
2024-01-22 14:37:53,581 [DEBUG] wyze_sdk.service.base: merging request-specific headers into session headers
2024-01-22 14:37:53,584 [DEBUG] wyze_sdk.service.base: unmodified prepared request
2024-01-22 14:37:53,585 [DEBUG] wyze_sdk.service.base: <PreparedRequest [POST]>
2024-01-22 14:37:53,585 [INFO] wyze_sdk.service.base: requesting POST to https://api.wyzecam.com/app/v2/auto/run_action
2024-01-22 14:37:53,586 [DEBUG] wyze_sdk.service.base: headers: {'User-Agent': 'okhttp/4.7.2', 'Accept-Encoding': 'gzip', 'Accept': '/', 'Connection': 'keep-alive', 'Content-Type': 'application/json;charset=utf-8', 'Content-Length': '582'}
2024-01-22 14:37:53,586 [DEBUG] wyze_sdk.service.base: body: b'{"instance_id":"GW_GC1_D03F2771A1BB","action_key":"power_off","provider_key":"GW_GC1","sv":"011a6b42d80a4f32b4cc24bb721c9c96","action_params":{},"access_token":"lvtx.CcCOykxdmrTkN5Q7tsH9dpGV0ZiHzzLKyJmMQ+tJo+ssQFNK/y3l5i16wViTxw/jQivM4VWkwAct/92vgcrgvUfJF3h9FTvfTKxZEUVa34gsb0Xk5gCdWmUqt6qvgK/9Z5HMYoeSBUaUQqgiJnLZgcTBHH4J1yrWeHUvoID+I7f4RFWiGWxttwN4kKFaju5kWBBHMw==","app_name":"com.hualai","app_ver":"com.hualai___2.19.14","app_version":"2.19.14","phone_id":"6c54e530-522d-4612-8df4-5dceba069d61","phone_system_type":"2","sc":"a626948714654991afd3c0dbd7cdb901","ts":1705952273581}'
2024-01-22 14:37:53,588 [DEBUG] wyze_sdk.service.base: settings: {'proxies': OrderedDict(), 'stream': False, 'verify': True, 'cert': None}
2024-01-22 14:37:54,192 [DEBUG] wyze_sdk.service.wyze_response: Received the following response - status: 200
headers: {"Date": "Mon, 22 Jan 2024 19:37:54 GMT", "Content-Type": "application/json; charset=utf-8", "Content-Length": "120", "Connection": "keep-alive", "Cache-Control": "no-cache", "Pragma": "no-cache", "Expires": "-1", "Server": "Microsoft-IIS/8.5", "Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Cache-Control, Accept, authorization, content-type", "Access-Control-Allow-Methods": "POST,GET,OPTIONS", "Access-Control-Allow-Origin": "*", "X-AspNet-Version": "4.0.30319", "X-Powered-By": "ASP.NET"}
body: {"ts": 1705952274174, "code": "1", "msg": "", "data": {"session_id": "", "custom_string": null, "action_session_id": "", "result": 3}}
2024-01-22 14:37:54,192 [DEBUG] wyze_sdk.service.wyze_response: response code: 1

@richt00
Copy link
Author

richt00 commented Jan 22, 2024

Restart - No Debug:
{'ts': 1705958141248, 'code': '1', 'msg': '', 'data': {'session_id': '', 'custom_string': None, 'action_session_id': '', 'result': 3}}

Restart - Debug Enabled:
2024-01-22 16:12:54,488 [DEBUG] wyze_sdk.service.base: merging request-specific headers into session headers
2024-01-22 16:12:54,489 [DEBUG] wyze_sdk.service.base: unmodified prepared request
2024-01-22 16:12:54,489 [DEBUG] wyze_sdk.service.base: <PreparedRequest [POST]>
2024-01-22 16:12:54,490 [INFO] wyze_sdk.service.base: requesting POST to https://api.wyzecam.com/app/v2/auto/run_action
2024-01-22 16:12:54,490 [DEBUG] wyze_sdk.service.base: headers: {'User-Agent': 'okhttp/4.7.2', 'Accept-Encoding': 'gzip', 'Accept': '/', 'Connection': 'keep-alive', 'Content-Type': 'application/json;charset=utf-8', 'Content-Length': '580'}
2024-01-22 16:12:54,490 [DEBUG] wyze_sdk.service.base: body: b'{"instance_id":"GW_GC1_D03F2771A1BB","action_key":"restart","provider_key":"GW_GC1","sv":"011a6b42d80a4f32b4cc24bb721c9c96","action_params":{},"access_token":"lvtx./xRMjbvFFheDHi8wB0hO4JYU9kGyAXxN35V6ZpTg+HSQZW4VcMHdp6xVqkbH56DUdmiLnJ/v8cp3jsJFRLCs0F+CwQtn08sn/bX9eWdBMTlAdK//Pv13OLxffK2gt/Tz7qx/6Bq7u7zNzqwSzqueIap4+CEWUnwkX7MITHdiNWP5em7MEU2V9r6MjhqCP8RXK6Qqgw==","app_name":"com.hualai","app_ver":"com.hualai___2.19.14","app_version":"2.19.14","phone_id":"255d3fc3-a2d6-4a07-8b6a-e5dcfb6b3d27","phone_system_type":"2","sc":"a626948714654991afd3c0dbd7cdb901","ts":1705957974488}'
2024-01-22 16:12:54,491 [DEBUG] wyze_sdk.service.base: settings: {'proxies': OrderedDict(), 'stream': False, 'verify': True, 'cert': None}
2024-01-22 16:12:55,083 [DEBUG] wyze_sdk.service.wyze_response: Received the following response - status: 200
headers: {"Date": "Mon, 22 Jan 2024 21:12:55 GMT", "Content-Type": "application/json; charset=utf-8", "Content-Length": "120", "Connection": "keep-alive", "Cache-Control": "no-cache", "Pragma": "no-cache", "Expires": "-1", "Server": "Microsoft-IIS/8.5", "Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Cache-Control, Accept, authorization, content-type", "Access-Control-Allow-Methods": "POST,GET,OPTIONS", "Access-Control-Allow-Origin": "*", "X-AspNet-Version": "4.0.30319", "X-Powered-By": "ASP.NET"}
body: {"ts": 1705957975003, "code": "1", "msg": "", "data": {"session_id": "", "custom_string": null, "action_session_id": "", "result": 3}}
2024-01-22 16:12:55,083 [DEBUG] wyze_sdk.service.wyze_response: response code: 1

@richt00
Copy link
Author

richt00 commented Jan 22, 2024

The list_devices command was very verbose when I turned on debug, but the last line was this:
!!! Camera's constructor args (mac, first_activation_ts, first_binding_ts, enr, nickname, timezone_name, product_model, product_model_logo_url, hardware_ver, firmware_ver, user_role, binding_user_nickname, conn_state, conn_state_ts, push_switch, device_params, is_in_auto, event_master_switch, parent_device_mac, parent_device_enr, binding_ts, timezone_gmt_offset) were ignored. If they should be supported by this library, report this issue to the project https://github.com/shauntarves/wyze-sdk/issues

Could this be the issue?

@shauntarves shauntarves self-assigned this Jan 29, 2024
@mcduffman
Copy link

That is just a disclaimer and not an error.

I have been working on the streaming part of the OG cams, and am close to a solution that I will be able to share. It is kinda hacked together however so it will absolutely be a YMMV.

@carTloyal123
Copy link

@mcduffman just seeing this update but super interested. I started a project to enable video streaming from Gwell IotVideo based Wyze cameras which include the OG Cam, Video Doorbell Pro and maybe others. I am wondering what your approach has been and if you have a repo you can link to? My project is here: Cryze

Hope we can work together on this and support pushing this forward!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants