Closed danfratamico closed 7 months ago
+1. Same exact issue started occurring for me today.
Another one here. Got an email, updated password just in case. Issued new API and key, no joy.
I wonder if a problem with authentication from this plugin (my Homebridge is on 24/7 like I imagine most people use it) caused Wyze to think there was "suspicious activity."
I, too, did the reset dance and still get "Request Blocked" (by Cloudfront).
Adding myself as a me too. Same exact issue as everyone has described so far, prompted by the same "suspicious activity" email.
I submitted a request for support via Wyze's website explaining this as an issue with accessing their API. Wyze Ticket 3635265 if anyone needs to reference it.
Adding myself as a me too as well, same above, same config.
+1.
My uneducated guess is that this plugin is not designed correctly. I thought the whole point of API keys was that I don't have to also share my username password with services like this. The plugin should be able to authenticate to Wyze using only the API key, no need to have my username/password.
+1 Same issue here. Was attempting to uninstall and reinstall and came across this thread/bug :(
I'm having the same issue. I noticed last night that my outdoor plugs were taking a long time to respond to Siri, then this morning everything completely stopped working. I have 2 Wyze accounts, one for work cameras and the other for home that I use on HomeBridge. I never got a "suspicious activity" email for my home account, but I did get one for work; the email said I'd be logged out of all my devices, but I wasn't so I ignored the email and everything is still fine, I don't have my work account connected to a homebridge.
I've changed the password on my home account, deleted and re-created my Key ID and Token and still no luck.
Hopefully this can be fixed quickly.
+1 seeing the same issue
+1
+1… also did a support chat with Wyze (ticket 3634716).
I also found that curiously, my Wyze switches were still responding to HomeKit commands, but outlets were not.
I was able to get a workaround by downgrading the plugin to v0.5.33. Homebridge logs are still showing authentication errors, but at least the HomeKit commands are working for both switches and outlets.
I just downgraded to 0.5.33 and still no luck with the outlets. I only have outlets so I’m unable to tell if anything else still works.
Adding my name to this issue. Looks like Wyze switched to Cloudflare and are probably using their bot protection. I think if we can just get this plugin updated to no longer use the username/password and just the API key/secret that users generate then it might be ok.
I am using Scrypted (dev has his own Wyze plugin) for viewing my cameras in HomeKit and those are still working, not seeing any cloudflare errors in the plugin log.
I'm at work currently and thus can't access my HomeBridge, but is this as simple to test as just removing the username and password keys from the JSON config?
Adding my name to this issue. Looks like Wyze switched to Cloudflare and are probably using their bot protection. I think if we can just get this plugin updated to no longer use the username/password and just the API key/secret that users generate then it might be ok.
I am using Scrypted (dev has his own Wyze plugin) for viewing my cameras in HomeKit and those are still working, not seeing any cloudflare errors in the plugin log.
+1. Same problem here. Got that e=mail about "suspicious activity". Reset (changed) my password. Generated new API Key. Updated my pliug-in configuration. Everything seemed fine until overnight I started getting these errors!
I'm at work currently and thus can't access my HomeBridge, but is this as simple to test as just removing the username and password keys from the JSON config?
Adding my name to this issue. Looks like Wyze switched to Cloudflare and are probably using their bot protection. I think if we can just get this plugin updated to no longer use the username/password and just the API key/secret that users generate then it might be ok. I am using Scrypted (dev has his own Wyze plugin) for viewing my cameras in HomeKit and those are still working, not seeing any cloudflare errors in the plugin log.
I just did this and do not see a difference.
Same issue here after resetting my password
[2/2/2024, 10:23:30 AM] [Wyze] Error, logging in and trying again
[2/2/2024, 10:23:30 AM] [Wyze] Request failed: AxiosError: Request failed with status code 403
[2/2/2024, 10:23:30 AM] [Wyze] Response PerformRequest ([object Object]): "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[http://www.w3.org/TR/html4/loose.dtd/">/n](http://www.w3.org/TR/html4/loose.dtd/%22%3E/n)<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">\n<TITLE>ERROR: The request could not be satisfied</TITLE>\n</HEAD><BODY>\n<H1>403 ERROR</H1>\n<H2>The request could not be satisfied.</H2>\n<HR noshade size="1px">\nRequest blocked.\nWe can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.\n<BR clear="all">\nIf you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.\n<BR clear="all">\n<HR noshade size="1px">\n<PRE>\nGenerated by cloudfront (CloudFront)\nRequest ID: jgGxFtTujsfaBKjAcWZoWRoPLjJzTVpkU5rwtHMmxHMIxEsD4oOrKA==\n</PRE>\n<ADDRESS>\n</ADDRESS>\n</BODY></HTML>"
I ran the request described here in the Wyze api docs via curl: https://support.wyze.com/hc/en-us/articles/16129834216731-Creating-an-API-Key
It still works, via curl. However, looking at the api logging from the plugin that a user-agent is also set, this appears to cause the issue:
[09:39:43] ~ λ curl --write-out '%{http_code}' -SsL --output /dev/null -XPOST -d "{\"email\":\"$EMAIL\",\"password\":\"$PASSWORD\"}" --header "Content-Type: application/json" --header "apikey: $API_KEY" --header "keyid: $KEY_ID" https://auth-prod.api.wyze.com/api/user/login
200%
[09:39:49] ~ λ curl --write-out '%{http_code}' -SsL --output /dev/null -XPOST -d "{\"email\":\"$EMAIL\",\"password\":\"$PASSWORD\"}" --header "Content-Type: application/json" --header "apikey: $API_KEY" --header "keyid: $KEY_ID" --header "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15" https://auth-prod.api.wyze.com/api/user/login
403%
I am guessing the header is set from before the API existed. As a temporary workaround, setting userAgent
in the json config appears to work.
EDIT: found this issue in wyze-api
after writing up this comment, https://github.com/jfarmer08/wyze-api/issues/2
Unfortunately I receive this barrage of errors and no functionality after trying the userAgent fix.
It looks like it is unable to use the refresh token, so it is logging in every time, this also is likely going to be an issue in the wyze-api
repo.
Did it log any errors when you attempted to perform an action?
Unfortunately I receive this barrage of errors and no functionality after trying the userAgent fix.
Same here
+1
Docker-Wyze-Bridge is also working just fine, so I'm hopeful this plugin can be fixed.
Weird, just noticed on the "accessory" page in Homebridge that things were not stuck trying to refresh, so I tried triggering one of my in-wall switches and it worked. Also tried turning a camera on and off and it worked as well. so not sure if something is cached or it really is working but acting in the logs like it is not.
I also tried adding the user agent, but I'm still getting errors in the log.
[2/2/2024, 12:11:21 PM] [Wyze] Error: SUCCESS at WyzeAPI._performRequest (/volume1/homebridge/node_modules/homebridge-wyze-smart-home/src/wyze-api/src/index.js:132:15) at processTicksAndRejections (node:internal/process/task_queues:95:5) at WyzeAPI.request (/volume1/homebridge/node_modules/homebridge-wyze-smart-home/src/wyze-api/src/index.js:80:14) at WyzeAPI.getObjectList (/volume1/homebridge/node_modules/homebridge-wyze-smart-home/src/wyze-api/src/index.js:234:20) at WyzeSmartHome.refreshDevices (/volume1/homebridge/node_modules/homebridge-wyze-smart-home/src/WyzeSmartHome.js:101:26) at WyzeSmartHome.runLoop (/volume1/homebridge/node_modules/homebridge-wyze-smart-home/src/WyzeSmartHome.js:90:9) [2/2/2024, 12:11:21 PM] [Wyze] Error, refreshing access token and trying again [2/2/2024, 12:11:21 PM] [Wyze] Error, logging in and trying again [2/2/2024, 12:11:22 PM] [Wyze] Error getting devices: Error: SUCCESS [2/2/2024, 12:12:23 PM] [Wyze] Error: SUCCESS at WyzeAPI._performRequest (/volume1/homebridge/node_modules/homebridge-wyze-smart-home/src/wyze-api/src/index.js:132:15) at processTicksAndRejections (node:internal/process/task_queues:95:5) at WyzeAPI.request (/volume1/homebridge/node_modules/homebridge-wyze-smart-home/src/wyze-api/src/index.js:80:14) at WyzeAPI.getObjectList (/volume1/homebridge/node_modules/homebridge-wyze-smart-home/src/wyze-api/src/index.js:234:20) at WyzeSmartHome.refreshDevices (/volume1/homebridge/node_modules/homebridge-wyze-smart-home/src/WyzeSmartHome.js:101:26) at WyzeSmartHome.runLoop (/volume1/homebridge/node_modules/homebridge-wyze-smart-home/src/WyzeSmartHome.js:90:9) [2/2/2024, 12:12:23 PM] [Wyze] Error, refreshing access token and trying again [2/2/2024, 12:12:23 PM] [Wyze] Error, logging in and trying again [2/2/2024, 12:12:24 PM] [Wyze] Error getting devices: Error: SUCCESS [2/2/2024, 12:13:25 PM] [Wyze] Error: SUCCESS at WyzeAPI._performRequest (/volume1/homebridge/node_modules/homebridge-wyze-smart-home/src/wyze-api/src/index.js:132:15) at processTicksAndRejections (node:internal/process/task_queues:95:5) at WyzeAPI.request (/volume1/homebridge/node_modules/homebridge-wyze-smart-home/src/wyze-api/src/index.js:80:14) at WyzeAPI.getObjectList (/volume1/homebridge/node_modules/homebridge-wyze-smart-home/src/wyze-api/src/index.js:234:20) at WyzeSmartHome.refreshDevices (/volume1/homebridge/node_modules/homebridge-wyze-smart-home/src/WyzeSmartHome.js:101:26) at WyzeSmartHome.runLoop (/volume1/homebridge/node_modules/homebridge-wyze-smart-home/src/WyzeSmartHome.js:90:9) [2/2/2024, 12:13:25 PM] [Wyze] Error, refreshing access token and trying again [2/2/2024, 12:13:25 PM] [Wyze] Error, logging in and trying again [2/2/2024, 12:13:26 PM] [Wyze] Error getting devices: Error: SUCCESS
Assuming all of your files are configured in the same way mine were, if you update this file /usr/lib/node_modules/homebridge-wyze-smart-home/src/wyze-api/index.js
and adjust line 131
From this:
131 if (result.data.msg == "DeviceIsOffline") { return result } else
To this:
131 if (result.data.msg == "DeviceIsOffline" || result.data.msg == "SUCCESS") { return result } else
It appears to work without errors, I am guessing the previous API has changed slightly and it now always returns a msg
field in the response data.
This would strictly be a temporary fix until the upstream wyze-api
package can be updated.
Awesome. Thanks @hgoscenski that seems to have done the trick.
For anyone else following along, the path to the relevant file in the synology version (non-docker) of homebridge is: [...]/node_modules/homebridge-wyze-smart-home/src/wyze-api/src/index.js
And is editable by using homebridge's terminal + vi
I am running Homebridge in Docker and am at the following path:
/var/lib/homebridge/node_modules/homebridge-wyze-smart-home/src/wyz-api/index.js
I do not see the contents of line 131 in that file. Am I looking in the wrong place?
@anderfrank screenshot of what is in the file for you?
According to nano, this is line 131
I also searched for "DeviceIsOffline" but it did not find it.
The block we're editing is where you have the "catch-all" block, are you sure you aren't on an older version? Might be able to swap that whole block with this:
if (result.data.msg == "DeviceIsOffline" || result.data.msg == "SUCCESS") { return result } else
throw new Error(result.data.msg)
} else { return result }
i'm on 0.5.36
@anderfrank you could do something like this, I believe this will work, though I do not have an older version at hand to test.
if (result.data.msg && result.data.msg != "SUCCESS")
I went ahead and updated to 0.5.37alpha7 and was able to edit the file as specified. I also added the userAgent line in the json file and restarted homebridge. Now I am just seeing a token error.
Assuming all of your files are configured in the same way mine were, if you update this file
/usr/lib/node_modules/homebridge-wyze-smart-home/src/wyze-api/index.js
and adjust line 131From this:
131 if (result.data.msg == "DeviceIsOffline") { return result } else
To this:
131 if (result.data.msg == "DeviceIsOffline" || result.data.msg == "SUCCESS") { return result } else
It appears to work without errors, I am guessing the previous API has changed slightly and it now always returns a
msg
field in the response data.This would strictly be a temporary fix until the upstream
wyze-api
package can be updated.
This worked for me as well! Thank You
Assuming all of your files are configured in the same way mine were, if you update this file
/usr/lib/node_modules/homebridge-wyze-smart-home/src/wyze-api/index.js
and adjust line 131From this:
131 if (result.data.msg == "DeviceIsOffline") { return result } else
To this:
131 if (result.data.msg == "DeviceIsOffline" || result.data.msg == "SUCCESS") { return result } else
It appears to work without errors, I am guessing the previous API has changed slightly and it now always returns a
msg
field in the response data.This would strictly be a temporary fix until the upstream
wyze-api
package can be updated.
this worked for me along with the user agent in json. I hope things get figured out. thanks all!
Assuming all of your files are configured in the same way mine were, if you update this file
/usr/lib/node_modules/homebridge-wyze-smart-home/src/wyze-api/index.js
and adjust line 131 From this:131 if (result.data.msg == "DeviceIsOffline") { return result } else
To this:
131 if (result.data.msg == "DeviceIsOffline" || result.data.msg == "SUCCESS") { return result } else
It appears to work without errors, I am guessing the previous API has changed slightly and it now always returns a
msg
field in the response data. This would strictly be a temporary fix until the upstreamwyze-api
package can be updated.this worked for me along with the user agent in json. I hope things get figured out. thanks all!
same here, working again.
I must be an idiot, how are you getting to this page to edit this line? I'm running Homebridge on a pi
+1 this solution worked for me.
I must be an idiot, how are you getting to this page to edit this line? I'm running Homebridge on a pi
In the Homebridge GUI, Go to your ellipses in the top right corner and select terminal (or if SSH'ing in, just use CLI.) Below is what I did... use whatever editor you want. I made a backup copy of the index.js file, just in case.
cd /usr/local/lib/node_modules/homebridge-wyze-smart-home/src/wyze-api/src/
sudo cp index.js index.bak
sudo vi +131 index.js
Added the user agent to the json config, and updated that line (131) and still telling me the token isn't valid :\
Added the user agent to the json config, and updated that line (131) and still telling me the token isn't valid :\
Do you have 2FA enabled? You might need to re-enter your auth code.
I am running Homebridge in Docker and am at the following path:
/var/lib/homebridge/node_modules/homebridge-wyze-smart-home/src/wyz-api/index.js
I do not see the contents of line 131 in that file. Am I looking in the wrong place?
Same here with the path. No content on line 131.
+1 having issues as well. hopefully this plugin can be fixed.
I don't think the variously suggested fixes COMPLETELY resolve the issue. I am a long time Homebridge user, but was using the Wyze Connected Home plugin until a few minutes ago when it realized it had stopped working (logs had endless requests for an API key). After a Google search, IN installed Wyze Smart Home (this plugin) as 0.5.37-alpha.7, which based on scanning the above bugs, has the various fixes suggested.
In my case, as a, in some sense new user (newly generated API key that has never connected to Wyze before) I am NOT seeing any success. In particular what I am seeing is
[2/2/2024, 7:45:43 PM] [Wyze] Error getting devices: AxiosError: Request failed with status code 403 [2/2/2024, 7:46:43 PM] [Wyze] Request failed: AxiosError: Request failed with status code 403 [2/2/2024, 7:46:43 PM] [Wyze] Response PerformRequest ([object Object]): "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n
<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">\n\nGenerated by cloudfront (CloudFront)\nRequest ID: -t3dMQauq9bCj2gB4kvVP6Kjmu4-cWtLT-PBAvdNKN8yTYfGhlHdWA==\n\n\n\n"
It's hard to be sure quite what the complaint is, but I'm guessing it remains a variant of the suspicions above – that (perhaps only for new/first time API key users) the path being followed still tries to submit a password, or at least does not negotiate correctly the installation and first use of the API key.
Oh, god! Alright let's try to submit that log again in a way that doesn't present it as HTML.
[2/2/2024, 7:51:44 PM] [Wyze] Error getting devices: AxiosError: Request failed with status code 403 [2/2/2024, 7:52:44 PM] [Wyze] Request failed: AxiosError: Request failed with status code 403 [2/2/2024, 7:52:44 PM] [Wyze] Response PerformRequest ([object Object]): "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<HTML><HEAD><META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">\n<TITLE>ERROR: The request could not be satisfied</TITLE>\n</HEAD><BODY>\n<H1>403 ERROR</H1>\n<H2>The request could not be satisfied.</H2>\n<HR noshade size=\"1px\">\nRequest blocked.\nWe can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.\n<BR clear=\"all\">\nIf you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.\n<BR clear=\"all\">\n<HR noshade size=\"1px\">\n<PRE>\nGenerated by cloudfront (CloudFront)\nRequest ID: vekWB-UCw1WTmd9wY5YbVt7HODCq7C3Pl4QnfkoobhG0TubC7x72cg==\n</PRE>\n<ADDRESS>\n</ADDRESS>\n</BODY></HTML>" [2/2/2024, 7:52:44 PM] [Wyze] Error getting devices: AxiosError: Request failed with status code 403
I have modified line 131 but still getting the same error:
[2/3/2024, 1:10:05 AM] [Wyze] Error: access token is error at WyzeAPI._performRequest (/usr/local/lib/node_modules/homebridge-wyze-smart-home/src/wyze-api/src/index.js:132:15) at processTicksAndRejections (node:internal/process/task_queues:95:5) at WyzeAPI.request (/usr/local/lib/node_modules/homebridge-wyze-smart-home/src/wyze-api/src/index.js:80:14) at WyzeAPI.getObjectList (/usr/local/lib/node_modules/homebridge-wyze-smart-home/src/wyze-api/src/index.js:234:20) at WyzeSmartHome.refreshDevices (/usr/local/lib/node_modules/homebridge-wyze-smart-home/src/WyzeSmartHome.js:101:26) at WyzeSmartHome.runLoop (/usr/local/lib/node_modules/homebridge-wyze-smart-home/src/WyzeSmartHome.js:90:9) [2/3/2024, 1:10:05 AM] [Wyze] Error, refreshing access token and trying again [2/3/2024, 1:10:05 AM] [Wyze] Error, logging in and trying again [2/3/2024, 1:10:05 AM] Loaded 0 cached accessories from cachedAccessories.. [2/3/2024, 1:10:05 AM] [Wyze] Request failed: AxiosError: Request failed with status code 403 [2/3/2024, 1:10:05 AM] [Wyze] Response PerformRequest ([object Object]): "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n
<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">\n\nGenerated by cloudfront (CloudFront)\nRequest ID: oZ7Kd1fI-JzZ1tZSp3SQuHjxodYQkKOBrHNWUjxUPSJloVC0WPy-bA==\n\n\n\n" [2/3/2024, 1:10:05 AM] [Wyze] Error getting devices: AxiosError: Request failed with status code 403
Just to provide some assistance for those still struggling.
Same experience here:
Received email from Wyze "Wyze reset your Wyze account password on 1/31/24"
Then this plugin, due to API calls, broke:
The 2 fixes as identified above was changing two items and it started working for me.
JSON File Config:
Adding this:
And the modification of the index.js file:
Just to provide some assistance for those still struggling.
Same experience here:
Received email from Wyze "Wyze reset your Wyze account password on 1/31/24"
Then this plugin, due to API calls, broke:
The 2 fixes as identified above was changing two items and it started working for me.
JSON File Config:
Adding this:
And the modification of the index.js file:
Thanks so much for the steps, this worked for me!
Added the user agent to the json config, and updated that line (131) and still telling me the token isn't valid :\
Do you have 2FA enabled? You might need to re-enter your auth code.
Its been a while......
I made the changes to the json config and the index.js file. Still getting errors. I added a line to the json file for mfaCode, but that didn't seem to help either. The code I entered was good for 28 second when I clicked restart on home bridge.
"username": "xxxxxxxxx@gmail.com", "password": "mxxxxxxxxxxxxxx", "keyId": "8##############################d", "apiKey": "D############Bg###################a", "mfaCode": "2#####7",
Describe The Bug:
I received an email to change my Wyze password and noticed afterwards that Homebridge could no longer connect to Wyze. I updated the password, generated a new API key, uninstalled plugin, tried different version, nothing worked.
To Reproduce:
Expected behavior:
Logs:
Plugin Config:
Screenshots:
Environment: