Merge pull request #400 from DenysFrasinich/master

Add new fields for kamstrup multical302 in mega joule
pull/418/head
Fredrik Öhrström 2021-12-07 12:26:35 +01:00 zatwierdzone przez GitHub
commit 3354d29354
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
5 zmienionych plików z 28 dodań i 0 usunięć

Wyświetl plik

@ -29,6 +29,14 @@ telegram=|2E442D2C6767676730048D2039D1684020|BCDB7803062C00004306000000031463000
telegram=|25442D2C6767676730048D203AD2684020|D81579E7F1D5902C00000000006300007F2A130000|
{"media":"heat","meter":"multical302","name":"MyHeater","id":"67676767","total_energy_consumption_kwh":44,"current_power_consumption_kw":1.9,"total_volume_m3":0.99,"at_date":"2019-10-31 00:00","total_energy_consumption_at_date_kwh":0,"current_status":"","timestamp":"1111-11-11T11:11:11Z"}
# Mj full telegram
telegram=|2E442D2C46464646300C8D207A70EA6021B1C178|030FC51000430F9210000314072B05426CBE2B022D0C0001FF2100|
{"media":"heat volume at inlet","meter":"multical302","name":"MyHeaterMj","id":"46464646","total_energy_consumption_kwh":11925,"current_power_consumption_kw":1.2,"total_volume_m3":3386.95,"at_date":"2021-11-30 00:00","total_energy_consumption_at_date_kwh":11783.333333,"current_status":"","timestamp":"1111-11-11T11:11:11Z"}
# Mj compressed telegram
telegram=|25442D2C46464646300C8D20D3E2EB60212B6D79E26DCD65|C51000921000152B05BE2B0C0000|
{"media":"heat volume at inlet","meter":"multical302","name":"MyHeaterMj","id":"46464646","total_energy_consumption_kwh":11925,"current_power_consumption_kw":1.2,"total_volume_m3":3387.09,"at_date":"2021-11-30 00:00","total_energy_consumption_at_date_kwh":11783.333333,"current_status":"","timestamp":"1111-11-11T11:11:11Z"}
# Test QCaloric C1 telegrams
telegram=|314493441234567835087a740000200b6e2701004b6e450100426c5f2ccb086e790000c2086c7f21326cffff046d200b7422|

Wyświetl plik

@ -152,6 +152,11 @@ void MeterMultical302::processContent(Telegram *t)
if(findKey(MeasurementType::Instantaneous, ValueInformation::EnergyWh, 0, 0, &key, &t->values)) {
extractDVdouble(&t->values, key, &offset, &total_energy_kwh_);
t->addMoreExplanation(offset, " total energy consumption (%f kWh)", total_energy_kwh_);
} else if (findKey(MeasurementType::Instantaneous, ValueInformation::EnergyMJ, 0, 0, &key, &t->values)) {
double mj;
extractDVdouble(&t->values, key, &offset, &mj);
total_energy_kwh_ = convert(mj, Unit::MJ, Unit::KWH);
t->addMoreExplanation(offset, " total energy consumption (%f kWh)", total_energy_kwh_);
}
if(findKey(MeasurementType::Instantaneous, ValueInformation::Volume, 0, 0, &key, &t->values)) {
@ -162,6 +167,11 @@ void MeterMultical302::processContent(Telegram *t)
if(findKey(MeasurementType::Instantaneous, ValueInformation::EnergyWh, 1, 0, &key, &t->values)) {
extractDVdouble(&t->values, key, &offset, &target_energy_kwh_);
t->addMoreExplanation(offset, " target energy consumption (%f kWh)", target_energy_kwh_);
} else if(findKey(MeasurementType::Instantaneous, ValueInformation::EnergyMJ, 1, 0, &key, &t->values)){
double mj;
extractDVdouble(&t->values, key, &offset, &mj);
target_energy_kwh_ = convert(mj, Unit::MJ, Unit::KWH);
t->addMoreExplanation(offset, " target energy consumption (%f kWh)", target_energy_kwh_);
}
if(findKey(MeasurementType::Instantaneous, ValueInformation::PowerW, 0, 0, &key, &t->values)) {

Wyświetl plik

@ -0,0 +1,5 @@
name=MyHeaterMj
type=multical302
id=46464646
#key=testing comment
key=

Wyświetl plik

@ -0,0 +1,4 @@
name=MyHeaterMj
type=multical302
id=46464646
key=

Wyświetl plik

@ -12,6 +12,7 @@ TESTRESULT="ERROR"
cat simulations/simulation_c1.txt | grep '^{' > $TEST/test_expected.txt
$PROG --format=json simulations/simulation_c1.txt \
MyHeater multical302 67676767 NOKEY \
MyHeaterMj multical302 46464646 NOKEY \
MyTapWater multical21 76348799 NOKEY \
MyWater flowiq2200 52525252 NOKEY \
Vadden multical21 44556677 NOKEY \