garo_wallbox icon indicating copy to clipboard operation
garo_wallbox copied to clipboard

Add support for secondary chargebox

Open martinstenrose opened this issue 4 years ago • 10 comments

It's possible to connect a secondary wallbox to a master, but accEnergy only shows the total energy usage for the master.

However, one can get the energy for the slaves through http://[ip-address]:2222/rest/chargebox/slaves/status. The slaves and total energy usage is also listed through http://[ip-address]:2222/rest/chargebox/config in an array called slaveList .

Here's an example:

$ curl --silent http://192.168.0.100:2222/rest/chargebox/slaves/status | jq
[
  {
    "reference": "My primary wallbox",
    "serialNumber": 12345,
    "lastContact": 1613501860157,
    "online": false,
    "loadBalanced": false,
    "phase": 0,
    "productId": 105,
    "meterStatus": 0,
    "meterSerial": "12345",
    "chargeStatus": 0,
    "pilotLevel": 25,
    "accEnergy": 1134100,
    "firmwareVersion": 6,
    "firmwareRevision": 9,
    "wifiCardStatus": 0
  },
  {
    "reference": "My secondary wallbox",
    "serialNumber": 12345,
    "lastContact": 1613501860157,
    "online": false,
    "loadBalanced": false,
    "phase": 0,
    "productId": 65,
    "meterStatus": 0,
    "meterSerial": "12345",
    "chargeStatus": 0,
    "pilotLevel": 8,
    "accEnergy": 60500,
    "firmwareVersion": 6,
    "firmwareRevision": 9,
    "wifiCardStatus": 1
  }
]

It getting the accEnergy from the slaves something that you might want to implement?

martinstenrose avatar Feb 16 '21 19:02 martinstenrose

FYI, the accEnergy on the first wallbox (i.e. the master) listed in the slaves array , is the same data that is listed as latestReading at http://[ip-address]:2222/rest/chargebox/status

martinstenrose avatar Feb 16 '21 19:02 martinstenrose

@stenrose Sure I can have a look at adding it. I don't have access to a setup like that, so could you provide a reading when you have something charging as well?

sockless-coding avatar Feb 16 '21 21:02 sockless-coding

Can post the full JSON tomorrow, but the chargeStatus changed to 64 when charging. When charging was complete it changed to 80.

Were unable to find any details on those IDs though.

martinstenrose avatar Feb 16 '21 21:02 martinstenrose

Forgot about this issue, but here comes a reading when charging.

$ curl --silent http://1.3.3.7:8080/servlet/rest/chargebox/slaves/false | jq
[
  {
    "reference": "Laddbox höger",
    "serialNumber": 123456,
    "lastContact": 1655028779556,
    "online": false,
    "loadBalanced": true,
    "phase": 4,
    "productId": 121,
    "meterStatus": 0,
    "meterSerial": "123456",
    "chargeStatus": 0,
    "pilotLevel": 6,
    "accEnergy": 3533500,
    "firmwareVersion": 7,
    "firmwareRevision": 9,
    "wifiCardStatus": 2,
    "connector": "NOT_CONNECTED",
    "accSessionEnergy": 0,
    "sessionStartValue": -1,
    "accSessionMillis": 0,
    "sessionStartTime": null,
    "currentChargingCurrent": 0,
    "currentChargingPower": 0,
    "nrOfPhases": 1,
    "twinSerial": -1,
    "cableLockMode": 0,
    "minCurrentLimit": 6,
    "dipSwitchSettings": 8155
  },
  {
    "reference": "Laddbox vänster",
    "serialNumber": 123456,
    "lastContact": 1655028768425,
    "online": false,
    "loadBalanced": true,
    "phase": 4,
    "productId": 65,
    "meterStatus": 0,
    "meterSerial": "123456",
    "chargeStatus": 64,
    "pilotLevel": 9,
    "accEnergy": 3045700,
    "firmwareVersion": 7,
    "firmwareRevision": 8,
    "wifiCardStatus": 1,
    "connector": "INITIALIZATION",
    "accSessionEnergy": 0,
    "sessionStartValue": -1,
    "accSessionMillis": 0,
    "sessionStartTime": null,
    "currentChargingCurrent": -1,
    "currentChargingPower": 0,
    "nrOfPhases": 1,
    "twinSerial": -1,
    "cableLockMode": 0,
    "minCurrentLimit": 6,
    "dipSwitchSettings": 8139
  }
]

It's now charging on "Laddbox vänster" which "chargeStatus": 64, indicates. The other box, "Laddbox höger", is not plugged in to a vehicle right now indicated by "chargeStatus": 0,.

When "Laddbox vänster" had vehicle plugged in waiting for schedule set by vehicle it had "chargeStatus": 48. It changes to 80 when completed.

FYI, it is not possible to change mode on the secondary charger, using /servlet/rest/chargebox/mode/{ALWAYS_{ON,OFF},SCHEMA}. So slave chargers are only available for monitoring status, energy etcetera.

I hope you are still interesting in implementing this, and just let me know if you need any further readings.

martinstenrose avatar Jun 12 '22 11:06 martinstenrose

Any updates on this? Is there a version or an addition to the integration that makes us able to handle two boxes where the Master holds the RPi and the Slave is connected to the Masters RPi. Would be great to be able to see and handle both boxes

CBxGBG avatar Jul 08 '23 16:07 CBxGBG

If I can get some more logs I can try to add support for it. What I need is: http://<ip>:8080/servlet/rest/chargebox/config http://<ip>:8080/servlet/rest/chargebox/status http://<ip>:8080/servlet/rest/chargebox/slaves/false

How does it look in the web UI?

sockless-coding avatar Sep 14 '24 20:09 sockless-coding

Sure thing, here's the output:

  • http://<ip>:8080/servlet/rest/chargebox/config
{
  "ocppConnected": false,
  "maxChargeCurrent": 25,
  "productId": "65",
  "programVersion": "7.13",
  "firmwareVersion": 7,
  "firmwareRevision": 13,
  "lbVersion2": true,
  "serialNumber": 996532,
  "meterSerialNumber": "091083U",
  "meterType": 341,
  "factoryChargeLimit": 32,
  "switchChargeLimit": 25,
  "rfidReaderPresent": false,
  "rfidMode": "RFID_DISABLED",
  "powerbackupStatus": 2,
  "lastTemperature": 18,
  "warningTemperature": 59,
  "cutoffTemperature": 64,
  "reducedIntervalsEnabled": true,
  "reducedCurrentIntervals": [],
  "softwareVersion": 189,
  "availableVersion": 189,
  "updateUrl": "http%3A%2F%2F194.18.235.146%2Fchargebox_189.tgz",
  "networkMode": 1,
  "networkType": 0,
  "networkSSID": "foobar",
  "webNetworkPassword": "",
  "networkAPChannel": 6,
  "ethNetworkMode": 0,
  "gcConfigTimestamp": null,
  "gcloudActivated": false,
  "gcActivatedFrom": null,
  "ethGateway": "",
  "ethDNS": "",
  "ethIP": "",
  "ethMask": 24,
  "localLoadBalanced": false,
  "groupLoadBalanced": true,
  "groupLoadBalanced101": true,
  "energyReportEnabled": false,
  "master": true,
  "timezone": null,
  "slaveList": [
    {
      "reference": "Laddbox höger",
      "serialNumber": 996532,
      "lastContact": 1726379096148,
      "online": false,
      "loadBalanced": true,
      "phase": 4,
      "productId": 125,
      "meterStatus": 0,
      "meterSerial": "091083U",
      "chargeStatus": 144,
      "pilotLevel": 6,
      "accEnergy": 14570000,
      "firmwareVersion": 7,
      "firmwareRevision": 13,
      "wifiCardStatus": 2,
      "connector": "UNAVAILABLE",
      "accSessionEnergy": 19200,
      "sessionStartValue": 14550800,
      "accSessionMillis": 7687345,
      "sessionStartTime": 1726321810946,
      "currentChargingCurrent": 0,
      "currentChargingPower": 0,
      "nrOfPhases": 1,
      "twinSerial": -1,
      "cableLockMode": 0,
      "minCurrentLimit": 6,
      "dipSwitchSettings": 8155,
      "cpuType": 2004739,
      "updateable": false
    },
    {
      "reference": "Laddbox vänster",
      "serialNumber": 1052674,
      "lastContact": 1726379078917,
      "online": false,
      "loadBalanced": true,
      "phase": 4,
      "productId": 65,
      "meterStatus": 0,
      "meterSerial": "188246U",
      "chargeStatus": 0,
      "pilotLevel": 6,
      "accEnergy": 10084200,
      "firmwareVersion": 7,
      "firmwareRevision": 13,
      "wifiCardStatus": 1,
      "connector": "INITIALIZATION",
      "accSessionEnergy": 0,
      "sessionStartValue": -1,
      "accSessionMillis": 0,
      "sessionStartTime": null,
      "currentChargingCurrent": -1,
      "currentChargingPower": 0,
      "nrOfPhases": 1,
      "twinSerial": -1,
      "cableLockMode": 0,
      "minCurrentLimit": 6,
      "dipSwitchSettings": 8139,
      "cpuType": 2004739,
      "updateable": false
    }
  ],
  "gridNetType": "TN",
  "slaveControlAvailable": true,
  "currentMultiplier": 100,
  "rfPower": 31,
  "twinSerial": -1,
  "twinSwitchLimit": 0,
  "energySerials": [
    "996532",
    "1052674"
  ],
  "packageVersion": "1.3.7",
  "cableAutoUnlocked": false,
  "internetSharingEnabled": false,
  "webAPPassword": null,
  "standalone": false,
  "castra": false,
  "cpuType": 2004739
}
  • http://<ip>:8080/servlet/rest/chargebox/status
{
  "serialNumber": 996532,
  "ocppState": null,
  "connectedToInternet": true,
  "freeCharging": false,
  "ocppConnectionState": null,
  "connector": "UNAVAILABLE",
  "mode": "ALWAYS_OFF",
  "currentLimit": 25,
  "factoryCurrentLimit": 32,
  "switchCurrentLimit": 25,
  "powerMode": "UNAVAILABLE",
  "currentChargingCurrent": 0,
  "currentChargingPower": 0,
  "accSessionEnergy": 19200,
  "sessionStartTime": 1726321810946,
  "chargeboxTime": "07:47",
  "accSessionMillis": 7687345,
  "latestReading": 14570000,
  "chargeStatus": 144,
  "updateStatus": {
    "serialsToUpdate": [],
    "serialsUpdated": [],
    "currentlyUpdating": -1,
    "currentProgress": -1,
    "failedUpdate": "NO_ERROR"
  },
  "currentTemperature": 18,
  "sessionStartValue": 14550800,
  "nrOfPhases": 1,
  "slaveControlWarning": false,
  "supportConnectionEnabled": false,
  "datetimeConfigured": true,
  "pilotLevel": 6,
  "mainCharger": {
    "reference": "Laddbox höger",
    "serialNumber": 996532,
    "lastContact": 1726379221853,
    "online": false,
    "loadBalanced": true,
    "phase": 4,
    "productId": 125,
    "meterStatus": 0,
    "meterSerial": "091083U",
    "chargeStatus": 144,
    "pilotLevel": 6,
    "accEnergy": 14570000,
    "firmwareVersion": 7,
    "firmwareRevision": 13,
    "wifiCardStatus": 2,
    "connector": "UNAVAILABLE",
    "accSessionEnergy": 19200,
    "sessionStartValue": 14550800,
    "accSessionMillis": 7687345,
    "sessionStartTime": 1726321810946,
    "currentChargingCurrent": 0,
    "currentChargingPower": 0,
    "nrOfPhases": 1,
    "twinSerial": -1,
    "cableLockMode": 0,
    "minCurrentLimit": 6,
    "dipSwitchSettings": 8155,
    "cpuType": 2004739,
    "updateable": false
  },
  "twinCharger": null
}
  • http://<ip>:8080/servlet/rest/chargebox/slaves/false
[
  {
    "reference": "Laddbox höger",
    "serialNumber": 996532,
    "lastContact": 1726379249890,
    "online": false,
    "loadBalanced": true,
    "phase": 4,
    "productId": 125,
    "meterStatus": 0,
    "meterSerial": "091083U",
    "chargeStatus": 144,
    "pilotLevel": 6,
    "accEnergy": 14570000,
    "firmwareVersion": 7,
    "firmwareRevision": 13,
    "wifiCardStatus": 2,
    "connector": "UNAVAILABLE",
    "accSessionEnergy": 19200,
    "sessionStartValue": 14550800,
    "accSessionMillis": 7687345,
    "sessionStartTime": 1726321810946,
    "currentChargingCurrent": 0,
    "currentChargingPower": 0,
    "nrOfPhases": 1,
    "twinSerial": -1,
    "cableLockMode": 0,
    "minCurrentLimit": 6,
    "dipSwitchSettings": 8155,
    "cpuType": 2004739,
    "updateable": false
  },
  {
    "reference": "Laddbox vänster",
    "serialNumber": 1052674,
    "lastContact": 1726379237247,
    "online": false,
    "loadBalanced": true,
    "phase": 4,
    "productId": 65,
    "meterStatus": 0,
    "meterSerial": "188246U",
    "chargeStatus": 0,
    "pilotLevel": 6,
    "accEnergy": 10084200,
    "firmwareVersion": 7,
    "firmwareRevision": 13,
    "wifiCardStatus": 1,
    "connector": "INITIALIZATION",
    "accSessionEnergy": 0,
    "sessionStartValue": -1,
    "accSessionMillis": 0,
    "sessionStartTime": null,
    "currentChargingCurrent": -1,
    "currentChargingPower": 0,
    "nrOfPhases": 1,
    "twinSerial": -1,
    "cableLockMode": 0,
    "minCurrentLimit": 6,
    "dipSwitchSettings": 8139,
    "cpuType": 2004739,
    "updateable": false
  }
]

And here is how it look in the web UI:

bild

You can ignore the load balancing meters listed in the UI, they are not part of the secondary charger setup.

martinstenrose avatar Sep 15 '24 05:09 martinstenrose

That should be enough info, are they both GLBDCM-T222FC? The product reporting is a bit strange. Also, if you don't mind supplying the load balancing info I can try to add that as well while I'm at it. It should be in one of the following: http://<ip>:8080/servlet/rest/chargebox/lbconfig/false http://<ip>:8080/servlet/rest/chargebox/meterinfo/EXTERNAL

sockless-coding avatar Sep 15 '24 08:09 sockless-coding

2024.9.1 has Slave support, the slaves show up as devices in HA. Doesn't seem to that much you can control on a slave.

sockless-coding avatar Sep 15 '24 15:09 sockless-coding

Looks like the endpoints for your load balancing are: http://<ip>:8080/servlet/rest/chargebox/meterinfo/CENTRAL100 http://<ip>:8080/servlet/rest/chargebox/meterinfo/CENTRAL101

sockless-coding avatar Sep 15 '24 18:09 sockless-coding