[609] Nissan Leaf

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

BluesBro
Posts: 54
Joined: Tuesday 13 August 2013 19:55
Target OS: -
Domoticz version:
Contact:

[609] Nissan Leaf

Post by BluesBro »

Hi!

I own a Nissan Leaf and there seems to be a workaround to implement the Carwings telemetrics into Domoticz.

https://github.com/haykinson/pycarwings
http://www.electricvehiclewiki.com/Carwings_protocol

Only need tho change the servers for the appropriate region.
Example of result from the python Script:

logged in, vin: ***censored***, nickname: ***Censored***
requesting status...
sleeping for 20 seconds...
getting latest...
done!
!!python/object:response.LatestBatteryStatus
latest_battery_status: !!python/object:response.SmartphoneLatestBatteryStatusResponse
battery_capacity: !!python/unicode '12'
battery_charging_status: !!python/unicode 'NOT_CHARGING'
battery_remaining_amount: !!python/unicode '10'
cruising_range_ac_off: !!python/unicode '127296'
cruising_range_ac_on: !!python/unicode '125664'
last_battery_status_check_execution_time: 2015-09-16 08:13:11+00:00
notification_date_and_time: 2015-09-16 08:13:11+00:00
operation_date_and_time: 2015-09-16 08:12:55+00:00
operation_result: !!python/unicode 'START'
plugin_state: !!python/unicode 'NOT_CONNECTED'
time_required_to_full: !!python/object/apply:datetime.timedelta [0, 19800, 0]
time_required_to_full_L2: !!python/object/apply:datetime.timedelta [0, 12600, 0]

I also lack the ability to turn AC On/Off, but it seems to be a command hidden within the carwings protocol link.
Anybody wanna give it a go?
Last edited by BluesBro on Tuesday 22 September 2015 9:05, edited 1 time in total.
hansrune
Posts: 49
Joined: Monday 07 October 2013 10:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Nissan Leaf

Post by hansrune »

Absolutely.... Over the weekend sometime
hansrune
Posts: 49
Joined: Monday 07 October 2013 10:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [609] Nissan Leaf

Post by hansrune »

Can´t make it log in... The pycarwings code seems some 4 years old, and the README states:
- doesn't appear to work out of the box outside the United States

Connects to 66.77.196.207, ssl initiation OK, but not further than that . Some 20 packets exchanged

What is your location ?
BluesBro
Posts: 54
Joined: Tuesday 13 August 2013 19:55
Target OS: -
Domoticz version:
Contact:

Re: [609] Nissan Leaf

Post by BluesBro »

Different url in europe.


Switch
BASE_URL = 'https://nissan-na-smartphone-biz.viaaq. ... phoneProxy'

to

BASE_URL = 'https://nissan-eu-smartphone-biz.viaaq. ... phoneProxy'

And in userService.py


SERVICE_PATH = '/userService'

To

SERVICE_PATH = '/userService/ne'
hansrune
Posts: 49
Joined: Monday 07 October 2013 10:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [609] Nissan Leaf

Post by hansrune »

Thanks, but login still does not succeed.
BluesBro
Posts: 54
Joined: Tuesday 13 August 2013 19:55
Target OS: -
Domoticz version:
Contact:

Re: [609] Nissan Leaf

Post by BluesBro »

Are you logging in with username or e-mail?
Strange... It works for me. Im from Norway.
hansrune
Posts: 49
Joined: Monday 07 October 2013 10:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

[609] Nissan Leaf

Post by hansrune »

Changed to username. That got me logged in, or at least apparently further, but ended in internal server error (500).

My iOS Leaf Link also has a 'unknown communication error' message. Could be just another bad car wings day....

Norway as well ... Will dig deeper some other time
BluesBro
Posts: 54
Joined: Tuesday 13 August 2013 19:55
Target OS: -
Domoticz version:
Contact:

Re: [609] Nissan Leaf

Post by BluesBro »

Looks like the EU URL isdown. I think they have re-routed the official app through Asia-URL, but thirdparty apps are now struggling.
I will see if I can find the Asia URL
BluesBro
Posts: 54
Joined: Tuesday 13 August 2013 19:55
Target OS: -
Domoticz version:
Contact:

Re: [609] Nissan Leaf

Post by BluesBro »

Corrected BASE_URL in connection.py

Code: Select all

BASE_URL = 'https://nissan-asia-smartphone-biz.viaaq.com/aqPortal/smartphoneProxy'
Corrected SERVICE_PATH in userservice.py

Code: Select all

SERVICE_PATH = '/userService/nml'
Just tested it and it works for me at least.
hansrune
Posts: 49
Joined: Monday 07 October 2013 10:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [609] Nissan Leaf

Post by hansrune »

For me as well. Thanks!
BluesBro
Posts: 54
Joined: Tuesday 13 August 2013 19:55
Target OS: -
Domoticz version:
Contact:

Re: [609] Nissan Leaf

Post by BluesBro »

Any luck on this..? :-)
hansrune
Posts: 49
Joined: Monday 07 October 2013 10:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [609] Nissan Leaf

Post by hansrune »

Well. It is more a question of what is useful to integrate into Domoticz. Not a lot, IMO. I already monitor kWh used for charging + charge times by other means (Owl meter) .
Things may change as they now revamp the Carwings services
BluesBro
Posts: 54
Joined: Tuesday 13 August 2013 19:55
Target OS: -
Domoticz version:
Contact:

Re: [609] Nissan Leaf

Post by BluesBro »

AC-controll is the pinnacle imo. This will be giving us the option to sett more than one timer via LUA or Blockly.
And also posting current battery level in a Dummyswitch would be useful.
vlegros
Posts: 1
Joined: Saturday 03 October 2015 10:02
Target OS: Linux
Domoticz version:
Contact:

Re: [609] Nissan Leaf

Post by vlegros »

Hello
I'm having a Nissan Leaf (Europe) since 1 week and fan of Domoticz as I've setup it @home. (temperature sensors, lights, ...)
I would like to know how to interface with Carwings as it looks like it is possible ?
Thanks in advance

Vincent
alfredo
Posts: 21
Joined: Thursday 04 June 2015 21:32
Target OS: Linux
Domoticz version:
Contact:

Re: [609] Nissan Leaf

Post by alfredo »

Did any of you norwegians do anything with this?
I hacked it up and post the number to a dummy Counter-switch, but its not optimal.
Any better dummy-switches to use?
BluesBro
Posts: 54
Joined: Tuesday 13 August 2013 19:55
Target OS: -
Domoticz version:
Contact:

Re: [609] Nissan Leaf

Post by BluesBro »

I became a father in the midst of all this so all my spare time goes to lullabyes and diaperchange :-)
Sure would appreciate if someone got it to work thou, and especially the AC-part!
BluesBro
Posts: 54
Joined: Tuesday 13 August 2013 19:55
Target OS: -
Domoticz version:
Contact:

Re: [609] Nissan Leaf

Post by BluesBro »

BTW Alfredo! Could you give me a How-To? With the complete scripts and all?
alfredo
Posts: 21
Joined: Thursday 04 June 2015 21:32
Target OS: Linux
Domoticz version:
Contact:

Re: [609] Nissan Leaf

Post by alfredo »

Congratulations! :)

I git cloned the pycarwings-repo, and made the adjustments needed above.
I then used the following script: http://pastebin.com/gPnPLz8B
I used that against a dummy Counter/Counter in Domoticz. (no, I use a percentage-counter now - see edit2 below)

I copied it together during the night, so it's not really that well tested yet.

Don't want to type up more now, because this is a temporary solution.

Edit:
I already found some errors, changed the pastebin above.

Edit2:
Well, what do you know - I found a better way to do this I think.
Now using a percentage-counter - still need some testing though.
BluesBro
Posts: 54
Joined: Tuesday 13 August 2013 19:55
Target OS: -
Domoticz version:
Contact:

Re: [609] Nissan Leaf

Post by BluesBro »

Actually the old one worked better althou it sent the 100% value of the battery.
The new one got me this error:

LEAF.sh: line 8: unexpected EOF while looking for matching ``'
LEAF.sh: line 23: syntax error: unexpected end of file
BluesBro
Posts: 54
Joined: Tuesday 13 August 2013 19:55
Target OS: -
Domoticz version:
Contact:

Re: [609] Nissan Leaf

Post by BluesBro »

The new one with % gives me:

LEAF.sh: line 14: bc: command not found
Error: Value variable empty
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest