Skip to content

Commit bf2e0d7

Browse files
author
dingo35
committed
main.cpp: only correct BatteryCurrent on first phase when EnableC2 is set to <Always Off>
1 parent afbc4fc commit bf2e0d7

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

SmartEVSE-3/src/main.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3568,7 +3568,11 @@ void CalcIsum(void) {
35683568
MainsMeter.Irms[x] = MainsMeter.Irms[x] - temp[x];
35693569
#endif
35703570
IrmsOriginal[x] = MainsMeter.Irms[x];
3571-
MainsMeter.Irms[x] -= batteryPerPhase;
3571+
if (EnableC2 != ALWAYS_OFF) { // so single phase users can signal to only correct battery current on first phase
3572+
MainsMeter.Irms[x] -= batteryPerPhase;
3573+
} else
3574+
if (x == 0)
3575+
MainsMeter.Irms[0] -= getBatteryCurrent();
35723576
Isum = Isum + MainsMeter.Irms[x];
35733577
}
35743578
MainsMeter.CalcImeasured();

docs/REST_API.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,13 @@ to your curl POST command. -d ''
201201
&emsp;&emsp;Actual home battery current multiplied by 10
202202
<br>&emsp;&emsp;A positive number means the home battery is charging
203203
<br>&emsp;&emsp;A negative number means the home battery is discharging
204+
```
205+
curl -X POST "http://ipaddress/currents?battery_current=300" -d ''
206+
```
207+
...means your battery is charging at 10A per phase (3 * 10A = 30A = 300dA).
208+
209+
NOTE: By default the current fed here is divided by three and corrected on every phase.
210+
If C2 is set to "Always Off", you are signalling a single phase system; in that case the correction is put fully on the L1 phase.
204211

205212
* L1, L2, L3
206213

0 commit comments

Comments
 (0)