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

PARAM_SIGN_INVALID for locks.create_access_code #174

Closed
onigor opened this issue Mar 28, 2024 · 2 comments · Fixed by #177
Closed

PARAM_SIGN_INVALID for locks.create_access_code #174

onigor opened this issue Mar 28, 2024 · 2 comments · Fixed by #177
Assignees

Comments

@onigor
Copy link

onigor commented Mar 28, 2024


perm = LockKeyPermission(type=LockKeyPermissionType['ALWAYS'])

result = client.locks.create_access_code(
   device_mac='YD.LO1.xxx',
   access_code='123456',
   name='TEST_CODE',
   permission=perm
   )

the response is

{
    "ReqID": "5610c131aa",
    "ErrNo": "14008",
    "ErrMsg": "PARAM_SIGN_INVALID"
}

Fist thought maybe I was providing the wrong params but doesn't matter what I send, always get the same response.

@jose96043
Copy link

I am getting the same error. I am not able to create an access_code

@shauntarves shauntarves self-assigned this May 6, 2024
@shauntarves shauntarves linked a pull request May 6, 2024 that will close this issue
@shauntarves
Copy link
Owner

@onigor @jose96043, thanks for reporting the issues you had with this. There's a problem since Wyze stopped supporting the old login method in favor of the developer key/token. In short, we no longer get the user_id value "for free" from the login process, but the lock client needs this user_id when creating new lock codes. I've updated the code and created a new release version, BUT there is still a change you need to make in your own scripts:

# create a client
client = wyze_sdk.Client(token='<...>', refresh_token='<...>')
# query the user info to get the userid
user_info = client.user_get_info() # <-- this is currently an UNSTRUCTURED wyze response

# there are two options:
# 1. set the user_id globally on your client (doesn't require latest code)
client._user_id = user_info['data']['user_center_id']
# 2. update your call to create_access_code to pass the user_id value (notice no underscore in the prop name)
client.locks.create_access_code(device_mac='<...>',  ....., userid='<value from the user_info>')

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

Successfully merging a pull request may close this issue.

3 participants