joeshaw / carwings

Go package and CLI tool for the Nissan Leaf Carwings API
MIT License
31 stars 11 forks source link

additional parameters to battery status #26

Closed gr0mit1 closed 3 years ago

gr0mit1 commented 4 years ago

Hi Joe I've managed to get carwings running and the debug gives me the following info from the Leaf: 20a {"status":200,"VoltLabel":{"HighVolt":"240","LowVolt":"120"},"BatteryStatusRecords":{"OperationResult":"START","OperationDateAndTime":"2019\/11\/07 09:41","BatteryStatus":{"BatteryChargingStatus":"NOT_CHARGING","BatteryCapacity":"240","BatteryRemainingAmount":"240","BatteryRemainingAmountWH":"38480","BatteryRemainingAmountkWH":"","SOC":{"Value":"100"}},"PluginState":"CONNECTED","CruisingRangeAcOn":"223000","CruisingRangeAcOff":"246000","NotificationDateAndTime":"2019\/11\/07 09:41","TargetDate":"2019\/11\/07 09:41"}}

I'd love to get "BatteryRemainingAmountWH":"38480" parameter reported in the battery status query. Is this an easy fix? I looked at the code but to be honest it's left me a bit confused! I'm not a great programmer!

Cheers Tim

nigelm commented 4 years ago

Just out of interest, what type of Leaf do you have, and which country are you in (or more correctly, which API region are you using)?

gr0mit1 commented 4 years ago

Hi Nigel I have a Nissan Leaf 40kWh 2018 and am in the UK.

My commandline is:

pi@emonpi:~/go/bin $ ./carwings -username username -password topsecret -region NE -debug server

Iwonder if the odometer reading is buried somewhere as well. That would be quite cool to extract...

nigelm commented 4 years ago

OK, thats the same as I am working with. I'll attempt to have a look when I get a chance (not that that should stop anyone else with an interest to go digging).

joeshaw commented 3 years ago

this was fixed by #28, not sure why github didn't autoclose it.