Page 5 of 7

Re: Nissan Leaf Plugin

PostPosted: Thu Feb 23, 2017 11:17 am
by eriass
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)

Re: Nissan Leaf Plugin

PostPosted: Thu Feb 23, 2017 11:42 am
by dustysparkle
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.

Re: Nissan Leaf Plugin

PostPosted: Thu Feb 23, 2017 3:26 pm
by eriass
Thank you! It works great so far!
Any updates to the plugin besides the fix?

Thank you for my most important plugin :D

Re: Nissan Leaf Plugin

PostPosted: Thu Feb 23, 2017 9:56 pm
by dustysparkle
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!

Re: Nissan Leaf Plugin

PostPosted: Fri Feb 24, 2017 2:02 am
by howartp
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

Re: Nissan Leaf Plugin

PostPosted: Tue Jun 13, 2017 1:37 am
by eriass
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)

Re: Nissan Leaf Plugin

PostPosted: Tue Jun 13, 2017 8:00 am
by dustysparkle
I had this issue, too, and I've worked on a fix. I'll try to put it into a point release today.

Re: Nissan Leaf Plugin

PostPosted: Tue Jun 13, 2017 10:17 am
by howartp
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

Re: Nissan Leaf Plugin

PostPosted: Tue Jun 13, 2017 10:46 am
by dustysparkle
OK, I just posted version 0.2.1 on GitHub. Give it a shot and let me know.

Re: Nissan Leaf Plugin

PostPosted: Wed Jun 28, 2017 9:37 am
by eriass
I will try it out, thanks!

Re: Nissan Leaf Plugin

PostPosted: Fri Jun 30, 2017 12:25 pm
by eriass
Seems to work fine so far! Thanks again

Re: Nissan Leaf Plugin

PostPosted: Wed Nov 08, 2017 3:30 pm
by howartp
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)

Re: Nissan Leaf Plugin

PostPosted: Wed Nov 08, 2017 3:45 pm
by durosity
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.

Re: Nissan Leaf Plugin

PostPosted: Wed Nov 08, 2017 4:07 pm
by howartp
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!

Re: Nissan Leaf Plugin

PostPosted: Wed Nov 08, 2017 4:32 pm
by durosity
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.