API won't login

My Camect won’t connect to any of the V2 or V3 cameras after updating the firmware yesterday. So I rebooted the camect, and remove the cameras, and went to add them back. Used a new API Key +Key ID +my Email/Password, but it won’t sign in. Has something changed with the API? Note my iPhone app is showing all the cameras just fine and working. This is purely API device access.

Did you create and use an API key?

From my understanding, an API key is now required for API device access.

1 Like

I happened to be playing around with the api the other day and also couldn’t get it to work. However I have never used it and am likely doing something wrong.

I will definitely be keeping an eye out for other reports of this potential issue.

1 Like

I used the API website about a week or two ago to create a key for Home Assistant and it worked fine then. Haven’t used it since.

1 Like

In case you are using Homebridge, Please upgrade Homebridge Wyze Plugin to latest version.

4 Likes

Am using a product called Camect. https://camect.com/
It is in home hardware device best described as a smart NVR. It is recording 7x24 all of my cameras. Only at normal FPS when events detected, and at a lower FPS recording with nothing being detected. Sends me alerts and so forth, but bigger than that, I can keep a browser window open showing all or 1 of my cameras all the time on my computer monitor. Yes Wyze app can send alerts and so forth too with the service, but the web view times out after X time. That doesn’t work for me very well. Hence I still use the Camect. Also I’ve had the Camect for years, and it can do both Wyze and my other security cameras too. Had it long before your https://my.wyze.com came out. If the my.wyze.com didn’t have cameras time out and stop streaming I wouldn’t need my camect for them.

Thanks for sharing this detail !
But I am not sure how camect work with Wyze and which connection was broken since camect must customize the Wyze connection themself.
BTW, would you mind give another shot my.wyze.com ? There has been couple improvements was done last couple weeks.

2 Likes

I have the wyze api on Home assistant, but when I try to connect the API with wyze, I get the dreaded “an unexpected error occurred”.

Not sure what to say. My HA configuration for Wyze stuff is working perfectly. I do remember reading somewhere that you need to get a new API token annually.

1 Like

I’m facing a similar issue with Scripted Wyze Plugin @scrypted/wyze v0.0.52. I’ve entered all the required details (email, pass, key id and API key), but the login request is failing with 400 code:

HTTPError(‘400 Client Error: Bad Request for url: https://auth-prod.api.wyze.com/api/user/login’)>

Is there an issue with the login API?

I don’t think so, I just tested with curl. Please refer https://support.wyze.com/hc/en-us/articles/16129834216731-Creating-an-API-Key Log in using your API key part to try to curl or postman.

I haven’t try the Scripted Wyze Plugin yet, I will give a shot and report back here

1 Like

I tried to follow that documentation but was not able to get it to work using curl or postman. Could you share what command you used to md5 the password 3 times? I was reading a few things about how it has issues with special characters in password sometime but didn’t find a definitive answer.

Thanks!

1 Like
from hashlib import md5

def hash_password(password: str) -> str:
    """Run hashlib.md5() algorithm 3 times."""
    password_clean = password.strip()
    for _ in range(3):
        password_clean = md5(password_clean.encode("ascii")).hexdigest()
    return password_clean

above python code should work.

3 Likes

I’m not super familiar with python so I apologize if I’m incorrect, but I believe that code would only return the last value hashed, and the hash would not apply to the previously hashed one. Would it be better if it was like this:


from hashlib import md5

def hash_password(password: str) -> str:
    """Run hashlib.md5() algorithm 3 times."""
    password_clean = password.strip()
    for _ in range(3):
        password_clean = md5(password_clean.encode("ascii")).hexdigest()
    return password_clean

1 Like

yes! you are right , thanks for fixing it

3 Likes

No problem. Thanks for providing that code, I will try it out.

Do I need to do anything to the email, or just provide it in plain text in the json?

2 Likes

yeah, plain text is good

3 Likes

Cool.

I don’t fully understand the reason for using an api key if you still need an email and password? Is it just to bypass the MFA? Once users complete the MFA they are still able to refresh their access token like normal, so couldn’t clients like wyze docker bridge just ask for MFA input as well, or does this just eliminate that step so they don’t have to implement UI for that and everything (creds can be put straight into a config file instead of having to go through the whole flow and wait for a SMS or whatever)

1 Like