Nissan Leaf Component(s)/Platform

Hi guys, I’ve tried my best and spent hours doing it, but I don’t use python, never got the hang of it.

I’ve fiddled about with some files and got nothing.

I’ve got a copy of the above updated pycarwings.py but I haven’t got a clue where to put it.

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.

Well?!? How did you get it going then? :wink:

Please tell.

Sure, I used an add-on named “Custom deps deployment” found here: https://github.com/home-assistant/hassio-addons-development

Using this config for the addon:

{
  "pypi": [
    "https://wheels.home-assistant.io/alpine-3.10/amd64/pycarwings2-2.8-py3-none-any.whl"
  ],
  "apk": []
}

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.

1 Like

Hi, thanks. I tried installing this, but It won’t work.

I made the changes as outlined here: API changes 25 July 2019 · ubarni/pycarwings2@078b710 · GitHub (3 lines)

Can you please attach your pycarwings2.py ?

Oops, it does work. After a reboot it initially didn’t work, but after restarting the homeassistant docker container it now does work.

@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.

There is an invalid json response. Nissan has taken away the GPS tracker, so the device_tracker will give json error.

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!

4 Likes

Cheers @filcole :slight_smile:

Great work @filcole!!

Works like a charm, very nice. Happy to be abled to see battery info in 10 secs again, instead of waiting for the Nissan server to wake up.

Thanks for fixing this!

Hello!

I am using Hassio, and home assistant v 0.99.3 and the last couple days, after updating perfectly the following rows appearing again and again until I restart the homeassistant server:
2019-09-29 10:05:01 DEBUG (MainThread) [homeassistant.components.nissan_leaf] Refresh currently in progress for Leaf
2019-09-29 10:05:01 DEBUG (MainThread) [homeassistant.components.nissan_leaf] Next update=2019-09-29 08:35:01.039855+00:100:

My refresh period is 30 minutes. It looks like after a while it stucks in this state.

Can somebody help with this?

Having the same issue since when I started using with this component in February this year. I was hoping the move of Nissan with the updated API would fix some issues, but apparently they still don’t care, the native Nissan app also fails more than it succeeds when polling updates. Unfortunately with the Hassio component I have to reboot to get it functioning again. It seems to be stuck in an update? Can this be cancelled and restarted somehow (perhaps when an update takes longer than a predefined period)?

1 Like

Same issue here. Now I barely get any updates from the car, even after restart.

Just got this after a restart:

carwings error; logging in and trying request again: {‘status’: 408}

12:18 AM /usr/local/lib/python3.7/site-packages/pycarwings2/pycarwings2.py (ERROR)

The Nissan server seems to have been down for some weeks. It’s working again, and the Home Assistant fixed itself. So apparently it does fix itself eventually.

I am looking for a configuration example for two cars (I have a eNV200 and a 2016 Leaf). Anybody?

Hey,

I added my account and it seems to be working fine (EU servers). Any way to add two accounts ? We each have a separate account, and it’d be nice to get the two cars in there.

Thanks

It seems the EU servers have been down again for a couple of days now. I honestly cannot get my head around the quality of this service. And then seeing adverts on tv bragging about their Nissan connect service…
Looks like I’m leaving home again with a complete frosted car again today.
The Hassio integration is working as it should though. Really happy with that. Just too bad we’re let down by the Nissan servers.

1 Like