Nissan Leaf Plugin

Posted on
Thu Feb 23, 2017 11:17 am
eriass offline
Posts: 26
Joined: May 12, 2016

Re: Nissan Leaf Plugin

Hi,
I suddenly get some errors on my Leaf plugin, any idea what it means?
It just stopped working the other night so I woke up to a cold car :(

Nissan Leaf not yet logged in; doing that first
Nissan Leaf Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
File "plugin.py", line 136, in runConcurrentThread
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Nissan Leaf.indigoPlugin/Contents/Server Plugin/indigo_leaf.py", line 113, in request_and_update_status
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Nissan Leaf.indigoPlugin/Contents/Server Plugin/indigo_leaf.py", line 132, in request_status
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Nissan Leaf.indigoPlugin/Contents/Server Plugin/indigo_leaf.py", line 51, in login
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Nissan Leaf.indigoPlugin/Contents/Server Plugin/pycarwings2/pycarwings2.py", line 148, in connect
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Nissan Leaf.indigoPlugin/Contents/Server Plugin/pycarwings2/pycarwings2.py", line 134, in _request
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 338, in loads
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 366, in decode
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 384, in raw_decode
ValueError: No JSON object could be decoded

Nissan Leaf Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)

Posted on
Thu Feb 23, 2017 11:42 am
dustysparkle offline
Posts: 54
Joined: Dec 14, 2015

Re: Nissan Leaf Plugin

Yep, it looks like Nissan changed their web service. I am working on an updated plugin release that fixes it; hopefully I can post that tonight.

In the interim, it would be helpful if you could try an interim 'beta' release with the fix and let me know if it works for you.

Posted on
Thu Feb 23, 2017 3:26 pm
eriass offline
Posts: 26
Joined: May 12, 2016

Re: Nissan Leaf Plugin

Thank you! It works great so far!
Any updates to the plugin besides the fix?

Thank you for my most important plugin :D

Posted on
Thu Feb 23, 2017 9:56 pm
dustysparkle offline
Posts: 54
Joined: Dec 14, 2015

Re: Nissan Leaf Plugin

I've posted a new version of the plugin! (version 0.2; seriously, what does it take to get to 1.0 around here?)

Changes include:
  1. New version of pycarwings2 library, with:
    1. fix for new Carwings web service endpoint, as of 2017-02-21(ish)
    2. handle new 401 error from web service (in addition to 404 error previously encountered)
    3. bug fix in remaining charge percentage calculation (always based on 12, even if total battery capacity is diminished to 11 bars or fewer)
  2. Added "lastUpdateTimestamp" and "secondsSinceLastUpdate" states to the Leaf device for your enjoyment
  3. Delay between updates when charging, not charging, or after receiving an error now configurable on the plugin config dialogue

Enjoy the update, and let me know how it goes!

Posted on
Fri Feb 24, 2017 2:02 am
howartp offline
Posts: 4206
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Nissan Leaf Plugin

Thanks for configurable delays - I've been using a custom version of your plugin to do this for a while so it's great you've included it!


Sent from my iPhone using Tapatalk

Posted on
Tue Jun 13, 2017 1:37 am
eriass offline
Posts: 26
Joined: May 12, 2016

Re: Nissan Leaf Plugin

Is it only me that have problems with the plugin? :(


Nissan Leaf Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
File "plugin.py", line 171, in runConcurrentThread
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Nissan Leaf.indigoPlugin/Contents/Server Plugin/indigo_leaf.py", line 146, in update_if_necessary
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Nissan Leaf.indigoPlugin/Contents/Server Plugin/indigo_leaf.py", line 166, in request_and_update_status
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Nissan Leaf.indigoPlugin/Contents/Server Plugin/indigo_leaf.py", line 295, in update_status
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Nissan Leaf.indigoPlugin/Contents/Server Plugin/pycarwings2/pycarwings2.py", line 386, in get_latest_hvac_status
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Nissan Leaf.indigoPlugin/Contents/Server Plugin/pycarwings2/responses.py", line 289, in __init__
KeyError: 'RemoteACRecords'

Nissan Leaf Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)

Posted on
Tue Jun 13, 2017 8:00 am
dustysparkle offline
Posts: 54
Joined: Dec 14, 2015

Re: Nissan Leaf Plugin

I had this issue, too, and I've worked on a fix. I'll try to put it into a point release today.

Posted on
Tue Jun 13, 2017 10:17 am
howartp offline
Posts: 4206
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Nissan Leaf Plugin

I've had it for several months.

If you send a remote AC on via the app, the error goes away for a while - though not as long as it used to!

I put a quick if() in my copy of the plugin that just reports failure in the log instead of crashing, but I'd much prefer a proper fix from Dusty.


Sent from my iPhone using Tapatalk Pro

Posted on
Tue Jun 13, 2017 10:46 am
dustysparkle offline
Posts: 54
Joined: Dec 14, 2015

Re: Nissan Leaf Plugin

OK, I just posted version 0.2.1 on GitHub. Give it a shot and let me know.

Posted on
Wed Jun 28, 2017 9:37 am
eriass offline
Posts: 26
Joined: May 12, 2016

Re: Nissan Leaf Plugin

I will try it out, thanks!

Posted on
Fri Jun 30, 2017 12:25 pm
eriass offline
Posts: 26
Joined: May 12, 2016

Re: Nissan Leaf Plugin

Seems to work fine so far! Thanks again

Posted on
Wed Nov 08, 2017 3:30 pm
howartp offline
Posts: 4206
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Nissan Leaf Plugin

Dusty,

Have you seen https://github.com/beejjacobs/nissan-co ... /config.js

Although it's in Node.js rather than Python, there's a number of extra endpoints we're not using.

The one to schedule AC would be useful?

(I was actually browsing to see if anyone with access to cars in Japan has published any API hacks for new Leaf/ENV200 yet)

Posted on
Wed Nov 08, 2017 3:45 pm
durosity offline
User avatar
Posts: 4018
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Nissan Leaf Plugin

howartp wrote:
(I was actually browsing to see if anyone with access to cars in Japan has published any API hacks for new Leaf/ENV200 yet)


From what little I’ve seen of it it the “new” leaf uses the exact same services for remote access. I’m kinda disappointed with the new Leaf.. I was hoping for a bigger battery and wireless CarPlay. In reality it’s a new body with an ugly dashboard plastered with buttons everywhere. My Zoe is going back to Renault soonish, and as it stands at the moment I’m pretty sure I’m gonna replace it with the new Z.e 40 model.

Computer says no.

Posted on
Wed Nov 08, 2017 4:07 pm
howartp offline
Posts: 4206
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Nissan Leaf Plugin

durosity wrote:
I was hoping for a bigger battery and wireless CarPlay.

Erm.... 40kWh battery available to order now, for delivery in January 2018, with CarPlay and Android Auto...?

60kWh being marketed in 2018, presumably for delivery 2019...

And brand new app for it, so I'd presume a new backend - gotta be better than the current one!

Posted on
Wed Nov 08, 2017 4:32 pm
durosity offline
User avatar
Posts: 4018
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Nissan Leaf Plugin

Huh that's weird i thought they said it had the same battery as the old one and the 40kWh was coming late next year?

And also i wanted wireless carplay.. not that anything beyond the BMW 5 series and the alpine aftermarket head unit.

Computer says no.

Who is online

Users browsing this forum: No registered users and 1 guest