joshperry
Posts: 9
Joined: Fri Aug 28, 2015 10:33 am
Delivery Date: 28 Aug 2015
Leaf Number: 335349

Re: Carwings API?

Sun Feb 07, 2016 9:02 pm

irwinr wrote:
joshperry wrote:For those with any interest: https://github.com/joshperry/carwings/b ... l.markdown
This is awesome, thanks!

Quick question: DCMID: Does that expire after a set amount of time? If so, any idea how long?

-Jeremy
Not sure actually. I think this is actually an ID number from the DCM in the car (I'm still trying to figure out what the DCM is (one of the car's computers). So I think it may be static, or maybe only static until the car is registered with another owner. It's going to take some more testing to figure out some of the more esoteric stuff.

For my particular use case I'm going to just cache the DCMID for now and assume that it won't ever expire.

Josh

irwinr
Posts: 20
Joined: Thu Mar 26, 2015 8:20 am
Delivery Date: 26 Mar 2015

Re: Carwings API?

Sun Feb 07, 2016 11:29 pm

joshperry wrote:
irwinr wrote:
joshperry wrote:For those with any interest: https://github.com/joshperry/carwings/b ... l.markdown
This is awesome, thanks!

Quick question: DCMID: Does that expire after a set amount of time? If so, any idea how long?

-Jeremy
Not sure actually. I think this is actually an ID number from the DCM in the car (I'm still trying to figure out what the DCM is (one of the car's computers). So I think it may be static, or maybe only static until the car is registered with another owner. It's going to take some more testing to figure out some of the more esoteric stuff.

For my particular use case I'm going to just cache the DCMID for now and assume that it won't ever expire.

Josh
Interesting. It seems to be used essentially as a session ID. If anyone ever figured out your DCMID it's basically as good as your password (And can't be changed like a password if it's discovered).

That seems like a pretty large security hole there, especially since it's also passed in the URL.

That aside: Have you looked at any of the endpoints for the driving history stats? That was going to be my next project, pulling that data down into a local database where I can do more interesting analysis on it.

-Jeremy

BluesBro
Posts: 6
Joined: Thu Sep 17, 2015 12:58 am
Delivery Date: 12 Aug 2015

Re: Carwings API?

Mon Feb 08, 2016 3:54 am

Regioncode for Europe is "NE" and language seems to follow normal "keyboard standards"
Example: Norway is: no-NO

Can't get your pythonexample to work thou..?

Edit:

And the username for me was the old one that i used with Carwings and not my e-mail-adress...

flagrantfowl
Posts: 8
Joined: Mon Feb 01, 2016 8:58 pm
Delivery Date: 16 Nov 2015

Re: Carwings API?

Mon Feb 08, 2016 7:48 am

Blues: can you give me more information as to how it's not working? It could be that the URL for the EU server is different, as it was for the XML API. You said your 'old' ID worked, though, so maybe you were able to log in.

If you can send me some output I'll take a look. It might help to turn logging up:

Code: Select all

logging.getLogger("pycarwings2").setLevel(logging.DEBUG)

jfiveash
Posts: 7
Joined: Sat Aug 14, 2010 9:54 am
Delivery Date: 02 Jan 2012
Location: Birmingham, AL

Re: Carwings API?

Mon Feb 08, 2016 8:23 am

joshperry wrote:For those with any interest: https://github.com/joshperry/carwings/b ... l.markdown

Thanks for the documentation! I now have something better than the Leaf Link (or Nissan) app to activate the climate control. Obtain DCMID and VIN. Enter that info in the URL string and turn on the climate control from a web browser.

Using a Flic button URL command can be automated to a simple hardware button.
https://flic.io

irwinr
Posts: 20
Joined: Thu Mar 26, 2015 8:20 am
Delivery Date: 26 Mar 2015

Re: Carwings API?

Tue Feb 09, 2016 9:24 am

One more question:

I noticed your doc refers to this:

"long-poll operation Use the HVAC Remote Activate Result operation to poll for results."

But I don't see a URL operation for the HVAC Remote Activate Result?

-Jeremy

User avatar
aqn
Gold Member
Posts: 819
Joined: Fri Oct 01, 2010 12:59 pm
Delivery Date: 30 Apr 2011
Leaf Number: 1333
Location: Austin, TX

Re: Carwings API?

Tue Feb 09, 2016 9:49 am

joshperry wrote:For those with any interest: https://github.com/joshperry/carwings/b ... l.markdown
flagrantfowl wrote:I've got a minimal but working Python API here:

https://github.com/jdhorne/pycarwings2

I don't think it will work outside of North America, given the "region" parameter, but I don't know any other values.
Great work, guys! Very very cool! Thanks for sharing.

I think I'll stand up something on my home server so I can turn the climate control on/off with just one click instead of doing it via several clicks in the ConnectEV app... Or maybe I'll do it in Javascript in the browser so anybody else interested can have the same functionality as well...
Anna Nguyen

flagrantfowl
Posts: 8
Joined: Mon Feb 01, 2016 8:58 pm
Delivery Date: 16 Nov 2015

Re: Carwings API?

Tue Feb 09, 2016 11:04 am

irwinr: the final portion of the endpoint for the remote "start HVAC" result is ACRemoteResult.php. Note that there are separate endpoints for stopping the HVAC; those are at ACRemoteOffRequest.php and ACRemoteOffResult.php.

There are more details in my Python implementation: https://github.com/jdhorne/pycarwings2/ ... rwings2.py
(It's obviously in Python, but I think it's pretty readable even if you're not a Python person.)

flagrantfowl
Posts: 8
Joined: Mon Feb 01, 2016 8:58 pm
Delivery Date: 16 Nov 2015

Re: Carwings API?

Tue Feb 09, 2016 11:09 am

aqn: In case you happen to be a user of the Indigo home automation software, I've written a plugin that lets you do exactly this kind of thing: https://github.com/jdhorne/indigo-leaf- ... e/rest_api

I created a control page in Indigo with a big button that says "start climate control". Works great.

windsorsean
Posts: 30
Joined: Thu Mar 21, 2013 6:51 pm
Delivery Date: 13 Apr 2013
Leaf Number: 018797
Location: Windsor, Ontario

Re: Carwings API?

Wed Feb 17, 2016 1:42 pm

For anyone needing the region code for Canada, it's "NCI" (NNA won't work).
2012 LEAF SL QC (#18797)
2014 LEAF SL
L2: Flo Home X5
Delivery: 2013-04-13 (1st Canadian LEAF south of London, ON
)

Return to “Range / Efficiency / Carwings”