Open seecoolguy opened 4 years ago
hi @seecoolguy, sorry for the late response. i've been busy with other stuff. indeed homebridge is pretty CPU intensive in its boot and on limited hardware like a raspberry pi it can take longer to start to the point that your wyze 2FA pin is no longer valid. this can also be the case for people who has tons of plugins and devices plugged to homebridge.
here are two a workarounds i suggest you try. WORKAROUND 1:
NOTE 1: i noticed that restarting the service via the config ui can take much longer than via command line. NOTE 2: it could be that due to your hardware limitation your pin changes again before your wyze authentication is done. if so, try the next approach which is a little more hard core.
WORKAROUND 2
NOTE 1: once you authenticate with 2FA once, a token is generated and we'll reuse it from that time on so you don't need to mind using the pin everytime you need to restart homebridge. clever, right?
i hope one of those solve your problem. if not and you're ok dropping the 2FA in favour or the integration with homebridge, your hardware limitation won't be a problem as you won't be limited to those 20-30 seconds.
best regards. let us know if it worked :) we wish you luck!
Thanks I’ll try these steps to see if i can beat the clock
Needed to disable 2FA until I can get an updated Pi that is fast enough to boot up within 20-30 seconds.
You might be able to copy what they did w/ the homebridge-ring plugin during the authentication step of the setup process
It's 2022, almost 2023, not sure if what I'm doing is relevant, but this is what I did to fix the same issue (running on a Pi Zero W, takes too long, MFA code expires). The idea is to manually fetch and store the access/refresh tokens. I used python wyze_sdk.
pip install wyze_sdk
python
, then:
from wyze_sdk import Client
client = Client(email="myemail@gmail.com", password="mypass")
# it asks for the 2FA code, get from authenticator
client.devices_list() # it works
# let's get the tokens (copy the value somewhere)
print(client._token)
print(client._refresh_token)
exit()
We need to store these tokens in the wyze persist file. It's somewhere in ~pi/.homebridge/persist/
and looks like wyze-....json
. Edit the JSON file, replace the access_token
by what you got in client._token
, same for the refresh one, save, restart the bridge. It should work.
Hi,
This plugin works pretty awesome, so thank you. I don't know what a good polling interval should be since 5 seconds seems way too long for motion sensors for automation tasks.
When I first tried setting up the Wyze plugin when I have 2FA turned on, the homebridge on raspberry pi 1 restarts really slow, almost 2 minutes before I see the log and my 2FA is expired by then. This causes my login to get locked due to failed attempts because the pin is now no longer valid.
I suppose a solution would be to get a CPU cooler for the raspberry PI and overclock it.