If you take a look at the last commit for MyLeaf (Android Leaf app), it doesn’t look too crazy.
It uses a different base URL than pycarwings2 (which has “gworchest” in the URL, not “api”), so I don’t think the exact same as MyLeaf uses can be utilized, but a MITM-sniffer should be able to get the correct one.
I’ve been trying to get it to work by making modifications to pycarwings2 and importing it as a custom component, but so far I’ve not been able to get it going.
I think the necessary changes are the ones I linked earlier, as I’ve seen some other projects making the same ones.
With the new setup, the manifest.json needs to be updated with the new pycarwings version to get the update to download. So a HA update will be needed, but if the changes are done in pycarwings it can easily be ran as a custom component until it’s merged in official release.
I do not use the HomeAssistant component but the pycarwings2 library directly but, anyway, I fix my setup updating the pycarwings2.py file of the python library with the changes presented on this link:
I am not sure the default path where you have the python library files, but if you find the files and make these changes the component maybe works again.
I got some time to look at this today, to get the official fix, we basically need 2 things.
@filcole, has to update his version of pycarwings2 with the above changes (to v 2.9 I guess) and then we need the manifest.json updated.
I don’t have a clue how this works on github, never used it.
But I have tested the changes in a local Hass.io installation and it does work.
Edit: Since Nissan have disabled the positioning, the device_tracker should probably be removed and maybe also some changes regarding that in pycarwings2 to get rid of some error messages.
I’m running this on a NUC so just don’t copy paste the config, consider the platform. I.e use armhf if you are running this on a pi.
Once the custom pycarwings2 is installed you can find it under /config/deps/lib/python3.7/site-packages/pycarwings2/ and here you can edit the existing file. Then it’s a reboot and it’s working again.
@michel72 I don’t understand, reboot your server AND restarting the container? I have change those 3 lines inside the container (pycarwings2.py) but still get an invalid JSON response.
So, I finally found the time to get around to looking into this. An updated pycarwings2 (v2.9) has been released to pypi. And pull request https://github.com/home-assistant/home-assistant.io/pull/10207 now exists, awaiting merging into homeassistant.
Please note that device tracker support has been removed due to the Nissan European APIs no longer supporting it. This means that the nissan_connect: element in the config will have to be removed. This is a breaking change!