Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What does the value in batteryCapacity represent? #26

Open
francos opened this issue Dec 18, 2017 · 8 comments
Open

What does the value in batteryCapacity represent? #26

francos opened this issue Dec 18, 2017 · 8 comments

Comments

@francos
Copy link

francos commented Dec 18, 2017

I'm trying to get the battery size from the APIs and the closest thing I found is the batteryCapacity, however, from what I saw, the value returned for that parameter is always 12, do you know what that number represents exactly?

Thanks in advance for the response and for the great work documenting these APIs!!

@francos francos changed the title What does the number in batteryCapacity represent? What does the value in batteryCapacity represent? Dec 18, 2017
@francos francos changed the title What does the value in batteryCapacity represent? What does the value in batteryCapacity represent? Dec 18, 2017
@BenWoodford
Copy link

I would assume this is the 12 bars, and then the degradation value is the number of bars left.

@francos
Copy link
Author

francos commented Jan 10, 2018

That would make sense @BenWoodford, thanks for the answer!

Any idea if there is a way to get the actual battery size or at least the range that can be traveled?

@BenWoodford
Copy link

Isn’t most of that in the response?

@francos
Copy link
Author

francos commented Jan 11, 2018

Not really, I am talking about the actual battery capacity in watt-hs, "12 bars" doesn't really tell me anything regarding that, right? Unless I'm missing something.

@BenWoodford
Copy link

BenWoodford commented Jan 11, 2018

If you talk irectly to the Nissan servers, and request BatteryStatusRecordsRequest.php, you'll get a slightly different payload it seems. But pycarwings2 doesn't map it. Look here for what I mean.

What does BatteryRemainingAmountWH show for you? I don't have my Leaf yet so can't check, but you may be able to extrapolate the full capacity from that.

@francos
Copy link
Author

francos commented Jan 12, 2018

Thanks for all the help @BenWoodford!! :)

I haven't been able to try it on a real car yet, just developing based on the APIs documented in different open source projects. I will try it out once I get to play around with a real car and will let you know if it works as you described.

@karora
Copy link

karora commented Aug 11, 2018

FWIW, here are some actual responses I get to the two endpoints here:

BatteryStatusCheckResultRequest.php

{
  "status": 200,
  "responseFlag": "1",
  "operationResult": "START",
  "timeStamp": "2018-08-11 19:06:46",
  "cruisingRangeAcOn": "98496.0",
  "cruisingRangeAcOff": "102600.0",
  "currentChargeLevel": "0",
  "chargeMode": "220V",
  "pluginState": "CONNECTED",
  "charging": "YES",
  "chargeStatus": "CT",
  "batteryDegradation": "7",
  "batteryCapacity": "12",
  "timeRequiredToFull": {
    "hours": "",
    "minutes": ""
  },
  "timeRequiredToFull200": {
    "hours": "",
    "minutes": ""
  },
  "timeRequiredToFull200_6kW": {
    "hours": "",
    "minutes": ""
  }
}

BatteryStatusRecordsRequest.php

{
  "status": 200,
  "BatteryStatusRecords": {
    "OperationResult": "START",
    "OperationDateAndTime": "2018/08/11 20:06",
    "BatteryStatus": {
      "BatteryChargingStatus": "NORMAL_CHARGING",
      "BatteryCapacity": "12",
      "BatteryRemainingAmount": "7",
      "BatteryRemainingAmountWH": "",
      "BatteryRemainingAmountkWH": ""
    },
    "PluginState": "CONNECTED",
    "CruisingRangeAcOn": "98496.0",
    "CruisingRangeAcOff": "102600.0",
    "TimeRequiredToFull200": {
      "HourRequiredToFull": "6",
      "MinutesRequiredToFull": "0"
    },
    "NotificationDateAndTime": "2018/08/11 19:06",
    "TargetDate": "2018/08/11 19:06"
  }
}

This is using regionCode "NE" from Ireland for a late 2015 Tekna

@filcole
Copy link

filcole commented Jan 4, 2019

It might be possible to determine the BatteryCapacity by looking at BatteryRemainingAmountWH.

Perhaps a 24kWh doesn't return a BatteryRemainingAmountWH
Perhaps a 30kWh does return a BatteryRemainingAmount and a SOC
Unknown for 40kWh leafs.

Later cars, I think after the initial 2016 24kWh Leaf, output the state-of-charge (SOC). SOC gives the battery and so that can be used to get an accurate battery calculation.

Here's the output from my 30kWh Tekna (circa Nov 2017).

BatteryStatusRecordsRequest.php

{
  "status": 200,
  "BatteryStatusRecords": {
    "OperationResult": "START",
    "OperationDateAndTime": "04-Jan-2019 17:06",
    "BatteryStatus": {
      "BatteryChargingStatus": "NOT_CHARGING",
      "BatteryCapacity": "240",
      "BatteryRemainingAmount": "220",
      "BatteryRemainingAmountWH": "23440",
      "BatteryRemainingAmountkWH": "",
      "SOC": {
        "Value": "87"
      }
    },
    "PluginState": "NOT_CONNECTED",
    "CruisingRangeAcOn": "152000",
    "CruisingRangeAcOff": "170000",
    "TimeRequiredToFull": {
      "HourRequiredToFull": "5",
      "MinutesRequiredToFull": "30"
    },
    "TimeRequiredToFull200": {
      "HourRequiredToFull": "3",
      "MinutesRequiredToFull": "30"
    },
    "TimeRequiredToFull200_6kW": {
      "HourRequiredToFull": "2",
      "MinutesRequiredToFull": "0"
    },
    "NotificationDateAndTime": "2019/01/04 17:06",
    "TargetDate": "2019/01/04 17:06"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants