Core: Nissan Leaf component stops updating

Created on 25 Jun 2019  路  9Comments  路  Source: home-assistant/core

Home Assistant release with the issue:

0.94.4

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.):

Ubuntu 18.04.2 LTS Hassio
Component/platform:

https://www.home-assistant.io/components/nissan_leaf/

Description of problem:
Updates have worked fine from the car after a restart of Home Assistant, but then after a while it stops updating. Looking at the entities they say update in progress = true. Looking at all the entities for the component right now, they all says updated 4 days ago and update in progress = true. Restarts have fixed the issue before, but now I've tried to restart Home Assistant multiple times without getting updates. Calling the nissan_update service updates the next update time on the entities, but nothing happens after that, still (update in progress = true) .Tried both the Nissan EV app and Leaf manager app, they both update fine.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):


Traceback (if applicable):


Additional information:

nissan_leaf

Most helpful comment

I have just updated the library that the nissan leaf uses, pycarwings to version 2.9 to fix the login issue. It has changed the API again, so I'm updating home assistant now to match. Apologies for the delay.

All 9 comments

Hey there @filcole, mind taking a look at this issue as its been labeled with a integration (nissan_leaf) you are listed as a codeowner for? Thanks!

_This is a automatic comment generated by codeowners-mention to help ensure issues and pull requests are seen by the right people._

I can find this in the log.

2019-06-25 19:56:32 WARNING (SyncWorker_5) [homeassistant.components.nissan_leaf] WARNING: This may poll your Leaf too often, and drain the 12V battery.  If you drain your cars 12V battery it WILL NOT START as the drive train battery won't connect. Don't set the intervals too low.
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/nissan_leaf/__init__.py", line 226, in async_update_data
    await self.async_refresh_data(now)
  File "/usr/src/homeassistant/homeassistant/components/nissan_leaf/__init__.py", line 276, in async_refresh_data
    server_response = await self.async_get_battery()
  File "/usr/src/homeassistant/homeassistant/components/nissan_leaf/__init__.py", line 352, in async_get_battery
    self.leaf.get_latest_battery_status)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/pycarwings2/pycarwings2.py", line 396, in get_latest_battery_status
    return CarwingsLatestBatteryStatusResponse(response)
  File "/usr/local/lib/python3.7/site-packages/pycarwings2/responses.py", line 596, in __init__
    bs = recs["BatteryStatus"]
TypeError: list indices must be integers or slices, not str

I just sent an update from the Nissan EV app, got updates from the car, then restarted Home Assistant. Now the values have updated in Home Assistant.
Im pretty sure the issue hasn't been fixed, as it will freeze up in Home Assistant again after some hours +-day or two.

Thanks for raising this. I'm facing the same issue.

I got this fixed for me by adding the device_tracker entry for my car. I had automatically track new devices turned off because I kept getting new entries for guests on my wifi network, but this also blocked the addition of my Leaf to the device_trackers. From the moment I set my car to tracked the integration hasn't stopped working. So it apparently couldn't handle not having the device_tracker in place at some point.

Now it's also stopped working but that's because Nissan apparently changed their API, at least for European users...

That is awesome @Qonstrukt! I have also turned off track new devices, and will try to set my car to tracked and see if it resolves the problem. Can't really check if its working before the API issue is fixed though. Will close this issue when/if tested and working. Thanks again.

On a second note @Qonstrukt . I have a pre 2015 Nissan Leaf without tracking. So nissan_connect is set to false as the documentation states. This won't generate a device tracker for my car. Any suggestion?

Ah, then no, I have no clue. I have a 2018 Leaf 2.0.

I have just updated the library that the nissan leaf uses, pycarwings to version 2.9 to fix the login issue. It has changed the API again, so I'm updating home assistant now to match. Apologies for the delay.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sh0rez picture sh0rez  路  3Comments

piitaya picture piitaya  路  3Comments

coolriku picture coolriku  路  3Comments

Elmardus picture Elmardus  路  3Comments

kirichkov picture kirichkov  路  3Comments