Closed DrGomek closed 3 years ago
Version | core-2021.4.4 |
---|---|
Installation Type | Home Assistant OS |
Development | false |
Supervisor | true |
Docker | true |
Virtual Environment | false |
Python Version | 3.8.7 |
Operating System Family | Linux |
Operating System Version | 5.4.83-v7l |
CPU Architecture | armv7l |
Timezone | America/New_York |
2021-04-13 20:21:18 DEBUG (SyncWorker_1) [homeassistant.components.nissan_leaf] Logging into You+Nissan 2021-04-13 20:21:18 DEBUG (SyncWorker_1) [pycarwings2.pycarwings2] invoking carwings API: https://gdcportalgw.its-mo.com/api_v190426_NE/gdc/InitialApp_v2.php 2021-04-13 20:21:18 DEBUG (SyncWorker_1) [pycarwings2.pycarwings2] params: { "RegionCode": "NNA", "custom_sessionid": "", "initial_app_str": "9s5rfKVuMrT03RtzajWNcA", "lg": "en-US" } 2021-04-13 20:21:19 DEBUG (SyncWorker_1) [pycarwings2.pycarwings2] Response HTTP Status Code: 200 2021-04-13 20:21:19 DEBUG (SyncWorker_1) [pycarwings2.pycarwings2] Response HTTP Response Body: b'{"status":200,"message":"success","baseprm":"88dSp7wWnV3bvv9Z88zEwg"}' 2021-04-13 20:21:19 DEBUG (SyncWorker_1) [pycarwings2.pycarwings2] invoking carwings API: https://gdcportalgw.its-mo.com/api_v190426_NE/gdc/UserLoginRequest.php 2021-04-13 20:21:19 DEBUG (SyncWorker_1) [pycarwings2.pycarwings2] params: { "Password": "REDACTED", "RegionCode": "NNA", "UserId": "REDACTED", "custom_sessionid": "", "initial_app_str": "9s5rfKVuMrT03RtzajWNcA" } 2021-04-13 20:21:22 DEBUG (SyncWorker_1) [pycarwings2.pycarwings2] Response HTTP Status Code: 200 2021-04-13 20:21:22 DEBUG (SyncWorker_1) [pycarwings2.pycarwings2] Response HTTP Response Body: b'{"status":"-2010","message":"INVALID PARAMS","resultKey":""}' 2021-04-13 20:21:22 ERROR (SyncWorker_1) [pycarwings2.pycarwings2] carwings error INVALID PARAMS: -2010 2021-04-13 20:21:22 ERROR (SyncWorker_1) [homeassistant.components.nissan_leaf] An unknown error occurred while connecting to Nissan: <class 'pycarwings2.pycarwings2.CarwingsError'>
Hey there @filcole, mind taking a look at this issue as its been labeled with an integration (nissan_leaf
) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)
As noted here -- https://community.home-assistant.io/t/nissan-leaf-component-s-platform/38663/506 -- it appears that the Nissan servers are erroring based on a User-Agent field sent by the pycarwings2 library. I applied the fix mentioned in that comment, replacing the User-Agent field with an empty string, and it started working again for me.
Looks like the dodgy User-Agent was added here: https://github.com/filcole/pycarwings2/commit/4005247aa51127f8b999ebdbeb15c48bceb8390e and is new in pycarwings2 2.10.
I have updated to core-2021.8.8 which I thought consumed the new pycarwings2 library, but the error persists.
Still an issue in 2021.9
as described in https://github.com/filcole/pycarwings2/issues/26#issuecomment-919905673 , pycarwings 2.11 is now in HA 2021.9.6 and should be working, but unfortunately I think Nissan have made another breaking API change. details in that comment.
This appears to be broken again.
HA log: carwings error INVALID PARAMS: -2010
An unknown error occurred while connecting to Nissan: <class ‘pycarwings2.pycarwings2.CarwingsError’>
Originally posted by @BakaNode in https://github.com/home-assistant/core/issues/43312#issuecomment-768790023