-
Notifications
You must be signed in to change notification settings - Fork 19
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
User Agent problem again? #28
Comments
Hello, I had the same issue starting yesterday. Thanks a lot! |
Well, that's annoying of them. Clearly an explicit change to make life harder for unofficial integrations. Can confirm that setting an empty string is working here. |
That's extremely annoying. It seems like it fails with User-Agent "pycarwings2/2.0" but not "" or "Mozilla/5.0" so they are clearly upset at this use of the API. My leaf app did not stop working at the same time. Maybe someone should try to get in touch with Nissan and find out what has prompted this change? |
I can confirm this issue (and the fix). Is there any chance we could get a 2.11 release with the empty string User-Agent in the meantime? |
I wonder if we should just fake the exact User Agent that the official Nissan Leaf app also uses. That would probably future-proof it (or make it harder to detect). Or replace the User Agent with a message to the Nissan developers. |
@filcole I'd be happy to get a PR together if you like... |
Ahaha, good idea. :-D By(t)e |
…san. This reverts 4005247 , and fixes filcole#28 .
Here's a PR: #29 . It just reverts back to sending an empty string, since I know that works, and I suspect Nissan will block any other identifiable User-Agent :( |
@filcole Any chance of a merge? The PR is consistent with the discussion in this thread |
Made the change proposed here and my app started running normally again |
How about, instead of hardcoding the user agent, let "pycarwings2/2.10" (or empty string, or whatever) be default in the library, but allow to override it from the user program? |
Still experiencing this issue... I guess we have both a quick fix and a solution which will require a bit more coding? |
At the moment I can't even log into the Nissan EV app. So, I think that the problem is in Nissan server, not in integration. By(t)e |
I have a locally-hacked HomeAssistant with my workaround in place and it has been reliably reporting charge levels from my car for several months (including this morning). |
Same here, works. :-) |
I’m running a pretty stock rpi home assistant and don’t really know how to incorporate this fix into my environment. I’m happy to take some coaching on doing so, but would be more interested in learning what it would take to get this “fix” incorporated into the main build. |
@filcole I hope you are OK. It would be good to get this fixed in a more sustainable way, without having to fork this repo. |
From this morning, the integration doesn't work anymore.
I delete the useragent from pycarwings2.py, at line 125, from:
headers={"User-Agent": "pycarwings2/2.10"}
to
headers={"User-Agent": ""}
and now works.
By(t)e
The text was updated successfully, but these errors were encountered: