Closed ripple7511 closed 1 year ago
I'm getting this exact error as well.
I am as well.
I thought maybe it was something to do with an MFA code. Tried the following:
... /usr/local/lib/node_modules/@balansse/homebridge-vivint$ npm run mfa
@balansse/homebridge-vivint@1.8.3 mfa node scripts/vivint_mfa_cli
Please enter your Vivint login email: Please enter your Vivint login password: Status code was 200. MFA is not needed. Please use refreshToken: __cf_bm=HMp ... =
I don't think its that. I wonder perhaps if something changed on their API? Or, I'm seeing references to CloudFlare, perhaps they've raised some kind of captcha system?
I just began getting this error about 10 minutes ago. I'm completely down.
I tried to use another library, just to test login functionality via Python from this repo: https://github.com/ovirs/pyvivint I got a similar login error. This could be clouding the field, but I wonder if the source of error is upstream at Vivint.
Seeing similar chatter about this on Reddit: https://www.reddit.com/r/homebridge/comments/17cirri/vivint_failure/
Watching. I am having this issue as well.
Well, I’m dead in the water. I ended up trying to uninstall and reinstall the app but I get no MFA key when I try logging in. I’ll continue to watch this thread but currently my HomeKit set up is hosed as I had a lot of dependencies on the Vivint various sensors, thermostats, doorbell, camera, you name it :(
It looks like Vivint stopped sending the SET-COOKIE header from https://www.vivintsky.com/api/authuser If nothing else changed, then we should be able to comment out the highlighted lines and it should work again. I don't have time to work on it right now, heading out the door. Maybe later tonight or this weekend.
I commented out lines 165 and and 168-- no dice, unfortunately. I'll dig into this later tonight to see what I can find as well.
I'm no coder, but The Home Assistant integration still works. Not sure if the authentication methods are similar but hopefully that helps some of you who are much better at this troubleshoot!
I don’t believe Home Assistant has Vivint plug-in. That’s why I’m using Homebridge.
I don’t believe Home Assistant has Vivint plug-in. That’s why I’m using Homebridge.
https://github.com/natekspencer/hacs-vivint
It's a HACS repository, can add that way. Works perfectly with Home Assistant.
Interesting and awesome at the same time I had no idea I'll look into that because I need my Vivint. Thank you.
I created pull request #127 to fix this issue. This fix is working on my system.
Could be worthwhile examining this file, especially the first 100 lines, to see if there’s anything obvious:
https://github.com/natekspencer/vivintpy/blob/main/vivintpy/vivintskyapi.py#L18-L100
EDIT: I love open source software. By the time I posted, someone had already fixed the issue. Hah. Awesome @jgrimard !
Please please forgive my ignorance, buuuutttt.....the pull request mentioned above lists some changes which apparently work, how do I translate that into my plugin working? Do I just need to wait for an update or can I integrate these changes easily with a few clicks??
Please please forgive my ignorance, buuuutttt.....the pull request mentioned above lists some changes which apparently work, how do I translate that into my plugin working? Do I just need to wait for an update or can I integrate these changes easily with a few clicks??
It would be easiest to wait for @balansse to merge the pull request and publish to NPM. Then you can update the plugin.
OK I guess I'll wait for the update. But in the meantime, I went ahead and installed. HACS oh my existing Home Assistant, but I was not really using. And then I managed to get the Vivint integration installed and configured. I can't see everything on HomeKit but at least I have my access to my alarm and re-added them to my automations.
But I'll be glad when the Vivint plug-in for HomeKit/Homebridge is working again because I need access to everything via HomeKit 🤞🏽
I know absolutely nothing about node and using npm but it seems that I can manually install the patch from the PR's branch for now until a fix is merged and published using npm install git+https://github.com/jgrimard/homebridge-vivint.git\#patch-2
I know absolutely nothing about node and using npm but it seems that I can manually install the patch from the PR's branch for now until a fix is merged and published using
npm install git+https://github.com/jgrimard/homebridge-vivint.git\#patch-2
This isn't working for me... the process just hangs at the below step, unless I need to be more patient (waited for around 7-10 minutes):
$ npm install git+https://github.com/jgrimard/homebridge-vivint.git\#patch-2 [#########.........] / reify:@balansse/homebridge-vivint: timing reify:loadBundles Completed in 0ms
I'm executing the above within the homebridge container.
Yeah, it took a while for me. And yes, I did an exec into my container and ran it and then restarted the container
Unfortunately @jgrimard's solution is a very simplistic fix that only works if you already have a valid session token. If you've regenerated your token and it's now invalid, or if your session expires, his change would not fix the authentication issue. The issue is that Vivint apparently enabled Cloudflare Bot Management, which adds a new cookie into every request. The Vivint script is only set up to handle a single cookie, so when this new cookie appeared the script started grabbing the wrong cookie value. I'm currently working on my own PR to make sure it grabs the correct cookie.
Huge thanks to @jgrimard for the fix! I just published the new version to NPM - go ahead and update the plugin and it should work again!
Thank you @balansse. I just updated from the plugin from within Homebridge and all is working again. I also tested generating a new refresh token and it worked fine.
@balansse Please see my PR #128
@jgrimard Generating the token will sometimes work, as it depends on what order the cookie headers are in, which is not deterministic. If you're lucky enough that the s
session cookie is first, then it'll work. But if CloudFlare's __cf_bm
cookie is first, then that's the one you'll grab, which won't work for authentication.
@balansse @jgrimard Thank you both so much.
I can confirm however that what @zackman0010 describes did happen when I recently refreshed my credentials.
Beautiful, got it working again thank you. Since I had hosed it trying to get it to work I ended up uninstalling reinstalling and then generating a new token. All works beautiful. Thank you so much.
Confirmed @zackman0010 's issue.
Basically, I just sat at the settings page and generated a new refresh token until I got one that started with s=
instead of __cf_bm
and that did the trick.
It works now, very grateful. But, perhaps we need to do something to make sure the token comes up correctly.
It works now, very grateful. But, perhaps we need to do something to make sure the token comes up correctly.
@DevMan01 I've got an open PR to do exactly that, so this issue will be fixed as soon as it gets merged in.
Thank you to everyone who helped fix this!
Version 1.8.5 fixes these issues and is available as an update. Please set this issue as resolved with #128
Resolved with #128
Vivint is throwing errors this afternoon, and showing the below in the console.
I'm able to successfully get a cookie (though it begins with "__CF_bm=" which I don't think it used to do?), but always get a 401 Authorization Required error.
I'm using a Homebridge-specific account on Vivint that I can successfully login using on the Vivint app itself, and MFA is disabled for the account. I've even tried to use my main Vivint account as a test, but the MFA portion fails even though the code is correct. I've verified that I'm able to successfully login to the Vivint app using the code successfully.
I've tried running the "npm run mfa" from the terminal, but am getting a "Missing script: mfa" error while doing that. "npm run" returns no scripts whatsoever. I've tried installing and re-installing different versions of the same plugin with nothing working.
I'm running Homebridge as an LXC on ProxMox for more than a year now without any issues. Anyone have ideas as to what I can try next?
LOG (with cookie data and any other long strings of potentially-important characters removed...)
[@balansse/homebridge-vivint] Error occurred during login, retrying in 60 seconds... StatusCodeError: 401 - "\r\n
401 Authorization Required
401 Authorization Required
} }