Firstly you need to install ‘SSH & Web Terminal’, go to Supervisor, Add-on Store. In the section named ‘Home Assistant Community Add-ons’ you will find the ‘SSH & Web Terminal’. Install that add-on and make sure that in the info section ‘Protection mode’ is OFF, also turn on ‘Show in sidebar’
The above may require restarts, I’m not sure.
Next in the sidebar you should have ‘Terminal’
Open this up and this is where we need to access the docker.
type docker exec -it $(docker ps -f name=homeassistant -q) bash
type cd /usr/local/lib/python3.9/site-packages/pycarwings2/
type vi pycarwings2.py
go down to line 125
change to headers={"User-Agent": ""}
to exit and save vi use :x then enter.
This is basically @andbad instructions rehashed and in one place.
Good Luck and always back up first.
Edit: I fixed an important typo !! Second Edit: Changed to python3.9
I have modified this to fix up some bugs, and add location tracking. Also provided some clarification on the documentation to configure device_tracker / climate in Home-Assistant.
Feel free to feedback, although I am no expert in dart/flutter development I will do my best. I am currently trying to extend this to collect cockpit information (mileage).
Another bonus is that a docker container image is being automatically published and can be installed without building:
docker pull ghcr.io/k8s-at-home/leaf2mqtt:latest
There’s also a helm chart for those running kubernetes:
I had a similar problem: no python3.8 directory. However there was a directory python3.9 which contained the expected subdirectories and the file to edit.
In case other people are also suffering from no car status update, error 408.
I see there had been a recent merge.
So I decided to test it out by replacing the file in question, with the updated one from github. The file is located here in HA OS homeassistant container: /usr/src/homeassistant/homeassistant/components/nissan_leaf/__init__.py
I haven’t driven the car yet, but forced updates no longer give me any error messages.
Just need the upstream pycarwings2 package to merge the start-up 404 error fix now…
edit: still giving me error 408.
Edit 2: It IS working, gives me 408 error from time to time, but car battery does get updated eventually.
Yep, the 2021.8 changelog lists that change. It’s working for me without editing the file I specified in the earlier post. Still throws status 408 error but at least the battery reading is updated pretty much every hour as programmed.
You are seeing the common “invalid params” error. You need to go into HA dependency code and change a line.
This integration had been working for me, then it stopped working out of the blue and i’ve been banging my head off the wall with this for weeks, getting that INVALID PARAMS: -2010 error over and over again…
So this morning, after trying every combination of username & password, double checking them by signing out and back into the Leaf app and in the EVA app, but it didn’t make any difference - i knew the credentials were correct. Then i thought “i better log in to nissanconnect.eu just to make absolutely sure the credentials are correct…” and the HA integration started working again.