Fix the parsing of total consumption channel (#17726)

Signed-off-by: Konstantin Polihronov <polychronov@gmail.com>
This commit is contained in:
Konstantin Polihronov 2024-11-10 20:34:12 +02:00 committed by GitHub
parent 987b894458
commit 288b80fba8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 20 deletions

View File

@ -194,7 +194,7 @@ public class X3HybridG4Data extends CommonLocalDeviceData {
@Override @Override
public double getTotalConsumption() { public double getTotalConsumption() {
return ((double) ByteUtil.read32BitSigned(getFromRawData(88), getFromRawData(89))) / 10; return ((double) ByteUtil.read32BitSigned(getFromRawData(88), getFromRawData(89))) / 100;
} }
@Override @Override

View File

@ -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] 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 @Override
protected InverterType getInverterType() { protected InverterType getInverterType() {
@ -120,7 +102,7 @@ public class TestX3HybridG4Parser extends AbstractParserTest {
assertEquals(14.2, data.getTotalBatteryChargeEnergy()); // [76][77] assertEquals(14.2, data.getTotalBatteryChargeEnergy()); // [76][77]
assertEquals(57, data.getTotalPVEnergy()); // [80][81] assertEquals(57, data.getTotalPVEnergy()); // [80][81]
assertEquals(19.25, data.getTotalFeedInEnergy()); // [86][87] 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(39.6, data.getTodayEnergy()); // [82] / 10
assertEquals(1261573.06, data.getTodayFeedInEnergy()); // [90][91] / 100 assertEquals(1261573.06, data.getTodayFeedInEnergy()); // [90][91] / 100
assertEquals(202509.28, data.getTodayConsumption()); // [92][93] / 100 assertEquals(202509.28, data.getTodayConsumption()); // [92][93] / 100