-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
Have to re-configure with every restart #612
Comments
same here. rpi5. |
Same. |
Same here. |
Is this new since HA 2024.7.x? |
Not sure if coincidence but I will try to rollback when I get home. |
Looks like the problem is new to 2024.7.x: I rolled back to 2024.6.4 and the problem seemed to go away, and came back when I restored to 2024.7.1.
…________________________________
From: Brian Rogers ***@***.***>
Sent: Tuesday, July 9, 2024 12:26:16 PM
To: SecKatie/ha-wyzeapi ***@***.***>
Cc: ancjsd ***@***.***>; Author ***@***.***>
Subject: Re: [SecKatie/ha-wyzeapi] Have to re-configure with every restart (Issue #612)
Is this new since HA 2024.7.x?
—
Reply to this email directly, view it on GitHub<#612 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AZ7R5A7ZYSCLB7PKVSC4CHLZLRBORAVCNFSM6AAAAABKTKGSUWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJYGY3DSMBQHE>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Rollback from core 2024.7.1 to core 2024.7.0 |
I am also having this issue and unlike others i am farily new to home assistant so im not sure how to downgrade from core 7.1 down to 7.0 |
Me too same problem |
Anyone using the latest update 7.2 if this fix the issue? Changelog doesn't include the wyze but maybe it's working. I am still out of town and I am not going to hit update as I need to restart my hallway tablet controller manually everytime after the update. |
So the interesting thing is there is nothing that changed from a Wyze perspective going to 2024.7. Something on the HA side must have changed that’s affecting this but I haven’t been able to dive into it very much yet. |
Upgraded to 7.2 thinking the same thing but nope it is still not working
…On Wed, Jul 10, 2024 at 9:33 AM Likaybai ***@***.***> wrote:
Anyone using the latest update 7.2 if this fix the issue? Changelog
doesn't include the wyze but maybe it's working. I am still out of town and
I am not going to hit update as I need to restart my hallway tablet
controller manually everytime after the update.
—
Reply to this email directly, view it on GitHub
<#612 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABPSHCPKZR32BDUMW5F64Q3ZLUZ4FAVCNFSM6AAAAABKTKGSUWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRQGUZDKMBRHA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I rolled back to 2024.6.4 and still have this issue. Running in Kubernetes with |
@SecKatie do you have a guess what could have changed in HA that would all of a sudden cause a |
I also have this issue on the latest HAOS. Following for updates... if needed, I'll follow-up with debug info. |
To further complicate this, I rolled all the way back to HA 2024.4 and Wyze 0.5.21 and I get the same error when its time for a token refresh (we didn't refresh on startup back then so it survives a restart), so something else is going on. But my other setup has been running fine this whole time. I suspect that if I re-configure that one from scratch it will start acting up too. |
(I've had HA for 2 days, bear with me) File "/usr/local/lib/python3.12/site-packages/wyzeapy/utils.py", line 85, in check_for_errors_standard This is from the log error I'm seeing, it says it's occurred 15,000 times in the last 12 hours. Does that mean 'data' is null rather than containing the refresh token? |
No the refresh token is sent and this is the response. I’m not sure anything is normally in the data field. For anybody else having this happen, when you re-login does it start to fail after ~23 hours? |
https://support.wyze.com/hc/en-us/articles/16129834216731-Creating-an-API-Key
Notes: |
Oh right, that would have the new access and refresh token normally. But it’s not sent because of the 2002 error. |
Mine starts failing an hour and 45 minutes after reauthenticating. |
Mine is the same, the errors show a message that the refresh key is error. I tried pulling the wyze-sdk python package an auth and then refresh with the same error. Also just used python requests to call the endpoints according to their specs with the same issue. I thought maybe it was my account as I wasnt seeing others, yet, reporting the issue. I created a new account today after getting frustrated with it and it has the same issue. This seems to be an issue with the refresh tokens on Wyze's end and I think the JWTs are being revoked on the wyze side in short order as well. I tried to put a ticket in with wyze support, but I wasnt expecting much from that end. |
Note to all:
4 days now using core 2024.7.0, Wyze still no issue and it's working same as before. |
I rolled back to 2024.7.0 and still have the issue. I think there may be a couple of things going on here, or maybe just coincidental that it started working for some after rolling back. When i decode the access token, the expiration is about 1.6 hours after refresh for the ones I get issued, not 48 hours. Also the refresh tokens are only valid for 28 days not 30. Mine will generally work around that long in HA now. The issue for me, and I suspect others too, is that my refresh tokens appear to be broken, or their API does not like mine for some reason. I created a brand new account and have the same issue as well, so I suspect it may be more wide spread. All that to say, this appears like it could be an issue with Wyze, not this integration specifically. |
*** Took this as a "go-ahead" and did the same (i.e. ha core update --version
2024.7.0)
and Wyze is chugging along just fine again .. without re-auth setup after a
reboot
just to be clear I reverted to ha core 2024.7.0*** and everything is working
without incident now and across reboots without issue
EDITED : Spoke too soon!! problem persists on HA Core 2024.7.0
leaning towards the tokens being messed up type problem.. good post regarding this (cant find right now even though i was JUST reading it)
J
…On Sat, Jul 13, 2024 at 6:15 PM Likaybai ***@***.***> wrote:
Note to all:
Rollback from core 2024.7.1 to core 2024.7.0 Now all working.
4 days now using core 2024.7.0, Wyze still no issue and it's working same
as before.
—
Reply to this email directly, view it on GitHub
<#612 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABPSHCIA7BO43KW6H5GLZDTZMGRHLAVCNFSM6AAAAABKTKGSUWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRXGEYTONBXGU>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I did some more testing with my account. If I downgrade this integration to 0.1.23 it works over restarts. The only reason I can guess for this behavior based on the code changes is that the wyzeapy version went from 0.5.20 to 0.5.21, however 0.5.20 tag no longer exists int he wyzeapy repo to look at what changed there. It seems like the change there is that it almost always, or always, attempts to do a token refresh on load where 0.5.20 (and probably earlier) only refreshed if the access token expired I'm guessing. Still the root of this issue seems to be broken refresh tokens on Wyze end. I waited the 1 hour and 40ish minutes for my access token to expire and still had to log back in with 0.1.23 |
I suspect this is related to the fix put in wyzepy 0.5.22 https://github.com/SecKatie/wyzeapy/releases/tag/0.5.22
Nevermind, latest already has 0.5.23. |
It’s not related to what was changed in 0.5.22 directly, but because we started refreshing on startup vs waiting for a token expired error it makes the integration fail on a HA reboot. I think what @bmatticus said is the issue. The access token is expiring too soon and the refresh token is invalid. This unfortunately is a Wyze issue, not an issue we can fix here. I have a support ticket open with Wyze but they don’t seem to have any idea what I’m talking about most of the time. |
Same problem here. I tried everything also. Resetting passwords. Down grading. It only lasts an hour or so then starts complaining about the refresh token. How about a temporary work around where you handle that error by having it delete the refresh token and restart? |
Suspected that the expiration of the access token may be an issue after my initial update, so really wyzeapy has to be updated for this workaround to really work. It will work across restarts and you could just reload every 2 hours if you wanted. I made some quick hacks to the wyzeapy to pass back an access token exception that already existed to the login method. If this is caught it will attempt to do another user login. Seems to work locally: |
Mine seems to not be having issues running on Core 2024.7.0. I did have to downgrade the core and only the core but once i did, the authentication expiring issue has stopped |
Wonder if there needs to be a new issue opened for refresh tokens specifically? I'm not sure what the rollback is fixing for the people it is fixing (rolling back HA Core only). I have no issues with the refresh token hacks I made locally and 2024.7.2 and downgrading never made a difference for me. I'm assuming that the people rolling back can actually control devices, like light bulbs, a couple hours after they reload? I know mine would act fine and let me toggle things when i downgraded the integration, but it wasnt actually controlling things and there were error like these in the logs.
|
Looks like i couldnt use your code directly in homebridge because of how they integrated it. This is what i did jfarmer08/homebridge-wyze-smart-home#258 (comment) |
Been working fine with it refreshing the refresh token every hour. My code didn't activate at all except once when installed a plug in. When HomeKit rebooted for a plugin install Wyze said the token was bad when it came back up. Must be something very messed up on their end. I keep getting emails about the V3 app being released maybe they are breaking things. [15/07/2024, 00:23:15] Homebridge v1.8.3 (HAP v0.12.2) (Homebridge E07F) is running on port 51184. |
Update: Still randomly had my refresh token denied last night even with it refreshing every hour. At least now that its automatically deleting the token after I receive error 2002 it still worked great this morning. If I didn't do this, it would just be in a loop this morning until i delete the file out of the persistent folder. [15/07/2024, 01:15:58] [MikesDesktop] [NetworkDevice] Awake cycle started |
Same for me... required to "reauthenticate" and enter all information on each HA restart. |
6 days still working. Never hit the reload. |
I assume when you say "rollback" you mean restore from a backup right? If that's the case then that makes sense. It really has nothing to do with the HA version, its because when you restore from a backup, you restore a working access and refresh token. And for whatever reason, it only seems to be the new tokens created when you login with username/pass/key that are generating bad refresh tokens. I basically just tried this so I think it should work for anybody that wants to try:
|
Interesting enough, i went into my incremental backups from 6/30 and the refresh token does work. Also the access token from that time was for 2 days. When I refresh using that refresh token i get a new working refresh token and the new access token is good for 2 days. The only other difference I see in the new jwts is that native_oauth2_resource is in aud as well as oauth2-resource. |
same here! such a shame Wyze is a really good brand! |
More than a week now and mine still working. Skipping all the updates except the latest version of core 2024.7.3 and still working. No modifications or whatsoever, just rollback to the last working core 2024.7.0 |
one of the privileged ones :P I only just got HA and has nothing to rollback to. |
When is coming out an update for this bug?m |
As we said in the comments several times, this is a Wyze issue, not something we can easily remedy. They are aware of it. The instructions to restore a working token above do work if you have a backup to restore from. |
Can you send instructions please how to use a token from a old backup? |
I will add one caveat to that, the backup you restore from probably has to be from within the last 30 days because that’s how long the refresh token is good for. I’m not positive on that but I think that’s what I saw on the decoded token. |
Why there is no other way to integrate with Wyze? |
Screen_Recording_20240722_225843_tinyCam.PRO.mp4
|
Because this is the way Wyze has asked 3rd party integrations to connect. We used to use a simple username/password but Wyze now requires the API key. https://support.wyze.com/hc/en-us/articles/16129834216731-Creating-an-API-Key |
So the only solution is waiting for the fix from Wyze....😔 |
Somehow I set CPU passthrough in my VM setting, then Wyze integration works
fine now.
Not sure why.
…On Mon, Jul 22, 2024 at 8:07 PM Shwerzb ***@***.***> wrote:
Because this is the way Wyze has asked 3rd party integrations to connect.
We used to use a simple username/password but Wyze now requires the API key.
https://support.wyze.com/hc/en-us/articles/16129834216731-Creating-an-API-Key
So the only solution is waiting for the fix from Wyze....🙂
|
Even after you restart home assistant? |
I am still needing to reauthenticate on restart, but I generated a new API key about 12 hours ago and it is still working as of now. Previously it was breaking at 1.6 hours. |
Yes, I restarted HA multiple times, no need to re-auth. I set it for other
experiment but it fixes this issue at least from what I see for 1hr.
…On Tue, Jul 23, 2024 at 7:45 AM Shwerzb ***@***.***> wrote:
Somehow I set CPU passthrough in my VM setting, then Wyze integration
works fine now. Not sure why.
… <#m_-6840981821927499710_>
On Mon, Jul 22, 2024 at 8:07 PM Shwerzb *@*.*> wrote: Because this is the
way Wyze has asked 3rd party integrations to connect. We used to use a
simple username/password but Wyze now requires the API key.
https://support.wyze.com/hc/en-us/articles/16129834216731-Creating-an-API-Key
<https://support.wyze.com/hc/en-us/articles/16129834216731-Creating-an-API-Key>
So the only solution is waiting for the fix from Wyze....🙂
|
I just generated a new API and it's working!! |
Can confirm that the tokens appear to have been fixed! I'll let it run for a while but the access token is back to expiring after 2 days like it used to be, and the refresh token issued now seems to be working properly again. 🤞 |
I think we're all good here now. Closing |
I'm being required to re-configure--i.e. provide all authentication information---every time I restart Home Assistant.
Running Home Assistant in VMWare on Windows.
Core 2024.7.1
Supervisor 2024.06.2
Operating System 12.4
Log details:
Logger: custom_components.wyzeapi
Source: custom_components/wyzeapi/init.py:114
integration: Wyze Home Assistant Integration (documentation, issues)
First occurred: 9:17:48 AM (1 occurrences)
Last logged: 9:17:48 AM
Wyzeapi: Could not login. Please re-login through integration configuration
The text was updated successfully, but these errors were encountered: