Skip to content

Commit

Permalink
Fix the parsing of total consumption channel (#17726)
Browse files Browse the repository at this point in the history
Signed-off-by: Konstantin Polihronov <[email protected]>
  • Loading branch information
theater authored Nov 10, 2024
1 parent 987b894 commit 288b80f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public double getTotalFeedInEnergy() {

@Override
public double getTotalConsumption() {
return ((double) ByteUtil.read32BitSigned(getFromRawData(88), getFromRawData(89))) / 10;
return ((double) ByteUtil.read32BitSigned(getFromRawData(88), getFromRawData(89))) / 100;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,6 @@ public class TestX3HybridG4Parser extends AbstractParserTest {
Information:[12.000,14,XY,8,1.23,0.00,1.24,1.09,0.00,1]
}
""";
private static final String RAW_DATA_X3_RUEPERT = """
{
"sn":"SRABCDEFGH",
"ver":"3.009.03",
"type":14,
"Data":[
2367,2360,2375,10,10,10,48,48,58,154,
6077,5297,19,19,1177,1058,5003,5003,5003,2,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,32310,
600,1971,3213,61,1959,1,46,154,256,10528,
3083,6154,100,0,34,0,0,0,0,0,
0,0,0,0,0,0,0,0,2380,1,
52,77,0,0,6253,0,7500,0,37,46,
6854,1,64,4,0,0,2662,8,10050,0,
30,0,518,0,0,0,0,0,0,0,
0,0,1,51,1,23,47,256,3504,2400,300,300,249,227,34,33,74,1620,1024,16448,16448,16448,0,0,0,3352,3344,57729,21,20564,12339,18753,12354,16694,13124,12848,20564,12339,19010,12857,16690,13124,13368,20564,12339,19010,12601,16691,12356,12597,20564,12339,19010,12601,16691,12356,14387,0,0,0,0,0,0,0,515,257,1281,1027,0,32310,0,0,0,0,0,0,0,0,0,0,0,0,0,161,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"Information":[10.000,14,"H34A10IA999999",8,1.41,0.00,1.40,1.09,0.00,1]}
""";

@Override
protected InverterType getInverterType() {
Expand Down Expand Up @@ -120,7 +102,7 @@ protected void assertParserSpecific(LocalData data) {
assertEquals(14.2, data.getTotalBatteryChargeEnergy()); // [76][77]
assertEquals(57, data.getTotalPVEnergy()); // [80][81]
assertEquals(19.25, data.getTotalFeedInEnergy()); // [86][87]
assertEquals(36.9, data.getTotalConsumption()); // [88]
assertEquals(3.69, data.getTotalConsumption()); // [88]
assertEquals(39.6, data.getTodayEnergy()); // [82] / 10
assertEquals(1261573.06, data.getTodayFeedInEnergy()); // [90][91] / 100
assertEquals(202509.28, data.getTodayConsumption()); // [92][93] / 100
Expand Down

0 comments on commit 288b80f

Please sign in to comment.