[609] Nissan Leaf
Moderators: leecollings, remb0
[609] Nissan Leaf
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?
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.
-
- Posts: 49
- Joined: Monday 07 October 2013 10:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Nissan Leaf
Absolutely.... Over the weekend sometime
-
- Posts: 49
- Joined: Monday 07 October 2013 10:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: [609] Nissan Leaf
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 ?
- 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 ?
Re: [609] Nissan Leaf
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'
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'
-
- Posts: 49
- Joined: Monday 07 October 2013 10:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: [609] Nissan Leaf
Thanks, but login still does not succeed.
Re: [609] Nissan Leaf
Are you logging in with username or e-mail?
Strange... It works for me. Im from Norway.
Strange... It works for me. Im from Norway.
-
- Posts: 49
- Joined: Monday 07 October 2013 10:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
[609] Nissan Leaf
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
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
Re: [609] Nissan Leaf
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
I will see if I can find the Asia URL
Re: [609] Nissan Leaf
Corrected BASE_URL in connection.py
Corrected SERVICE_PATH in userservice.py
Just tested it and it works for me at least.
Code: Select all
BASE_URL = 'https://nissan-asia-smartphone-biz.viaaq.com/aqPortal/smartphoneProxy'
Code: Select all
SERVICE_PATH = '/userService/nml'
-
- Posts: 49
- Joined: Monday 07 October 2013 10:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: [609] Nissan Leaf
For me as well. Thanks!
Re: [609] Nissan Leaf
Any luck on this..? 

-
- Posts: 49
- Joined: Monday 07 October 2013 10:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: [609] Nissan Leaf
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
Things may change as they now revamp the Carwings services
Re: [609] Nissan Leaf
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.
And also posting current battery level in a Dummyswitch would be useful.
Re: [609] Nissan Leaf
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
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
Re: [609] Nissan Leaf
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?
I hacked it up and post the number to a dummy Counter-switch, but its not optimal.
Any better dummy-switches to use?
Re: [609] Nissan Leaf
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!

Sure would appreciate if someone got it to work thou, and especially the AC-part!
Re: [609] Nissan Leaf
BTW Alfredo! Could you give me a How-To? With the complete scripts and all?
Re: [609] Nissan Leaf
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.

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.
Re: [609] Nissan Leaf
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
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
Re: [609] Nissan Leaf
The new one with % gives me:
LEAF.sh: line 14: bc: command not found
Error: Value variable empty
LEAF.sh: line 14: bc: command not found
Error: Value variable empty
Who is online
Users browsing this forum: No registered users and 1 guest