From 3735c9fa70293d975105b1d529c620dc7ea9c137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20=C3=96hrstr=C3=B6m?= Date: Sat, 14 Nov 2020 10:48:49 +0100 Subject: [PATCH] Added ev200 and emerlin868. --- CHANGES | 3 + Makefile | 2 + README.md | 2 + simulations/simulation_t1.txt | 10 +++ src/meter_emerlin868.cc | 107 ++++++++++++++++++++++++++++ src/meter_eurisii.cc | 6 +- src/meter_ev200.cc | 107 ++++++++++++++++++++++++++++ src/meter_fhkvdataiii.cc | 6 +- src/meter_qcaloric.cc | 6 +- src/meter_sontex868.cc | 6 +- src/meters.cc | 6 +- src/meters.h | 130 +++++++++++++--------------------- tests/test_listen_to_all.sh | 10 +++ tests/test_t1_meters.sh | 4 +- 14 files changed, 308 insertions(+), 97 deletions(-) create mode 100644 src/meter_emerlin868.cc create mode 100644 src/meter_ev200.cc diff --git a/CHANGES b/CHANGES index e0b7ab8..99b3e0e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,7 @@ +Mira added support for Elster V200H water meter and the Elster Merlin 868 addon. +Thanks Mira! + Version 1.0.3: 2020-11-11 Add missing files and update man page for --nodeviceexit diff --git a/Makefile b/Makefile index 9e15533..26693f3 100644 --- a/Makefile +++ b/Makefile @@ -120,6 +120,8 @@ METER_OBJS:=\ $(BUILD)/meter_ehzp.o \ $(BUILD)/meter_esyswm.o \ $(BUILD)/meter_em24.o \ + $(BUILD)/meter_emerlin868.o \ + $(BUILD)/meter_ev200.o \ $(BUILD)/meter_eurisii.o \ $(BUILD)/meter_fhkvdataiii.o \ $(BUILD)/meter_flowiq2200.o \ diff --git a/README.md b/README.md index cd640d2..c064d52 100644 --- a/README.md +++ b/README.md @@ -267,6 +267,8 @@ Aquametro/Integra Topas Es Kr (topaseskr) Bmeters Hydrodigit (hydrodigit) (partly non-standard protocol) Diehl/Sappel IZAR RC 868 I R4 PL (izar) (non-standard protocol) Diehl HYDRUS (hydrus) +Elster Merlin 868 (emerlin868) +Elster V200H (ev200) Honeywell Q400 (q400) Kamstrup Multical 21 (multical21) Kamstrup flowIQ 2200 (flowiq2200) diff --git a/simulations/simulation_t1.txt b/simulations/simulation_t1.txt index 1a5333b..b595c02 100644 --- a/simulations/simulation_t1.txt +++ b/simulations/simulation_t1.txt @@ -180,3 +180,13 @@ telegram=|2E4401069897969501167A4B0320052F2F|0413320C000003FD1700000044132109000 telegram=|9E44C5147956341200047A7B0090052F2F|046D25248A2B04063D1F000001FD17000415265F00004406131F0000840106901E0000C40106841E0000840206841E0000C402067A1E0000840306541E0000C40306021E00008404069E1D0000C40406D71C0000840506F21B0000C40506681A00008406061E190000C40606EB1700008407061C170000C40706EE1600002F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F| {"media":"heat","meter":"sensostar","name":"Heater","id":"12345679","meter_timestamp":"2020-11-10 04:37","total_kwh":7997,"total_water_m3":2435.8,"current_status":"OK","timestamp":"1111-11-11T11:11:11Z"} |Heater;12345679;7997.000000;2435.800000;OK;1111-11-11 11:11.11 + +# Test Elster V200H water meter +telegram=|2E449215303099990D077AB50820452F2F|0C12495849004C12557545000FB10445007022C50BFFFFFFFF0000FFF000| +{"media":"water","meter":"ev200","name":"Voda","id":"99993030","total_m3":49.5849,"target_m3":45.7555,"timestamp":"1111-11-11T11:11:11Z"} +|Voda;99993030;49.584900;45.755500;1111-11-11 11:11.11 + +# Test Elster Merlin 868 radio attachement +telegram=|2E4492159293949511377ABE0020252F2F|04135515000004FD971D80800000441300000000426C000002FDFD02B300| +{"media":"radio converter (meter side)","meter":"emerlin868","name":"Vodda","id":"95949392","total_m3":5.461,"target_m3":0,"timestamp":"1111-11-11T11:11:11Z"} +|Vodda;95949392;5.461000;0.000000;1111-11-11 11:11.11 diff --git a/src/meter_emerlin868.cc b/src/meter_emerlin868.cc new file mode 100644 index 0000000..d775a98 --- /dev/null +++ b/src/meter_emerlin868.cc @@ -0,0 +1,107 @@ +/* + Copyright (C) 2017-2020 Fredrik Öhrström + Copyright (C) 2018 David Mallon + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include"dvparser.h" +#include"meters.h" +#include"meters_common_implementation.h" +#include"wmbus.h" +#include"wmbus_utils.h" + +using namespace std; + +struct MeterEMerlin868 : public virtual WaterMeter, public virtual MeterCommonImplementation { + MeterEMerlin868(MeterInfo &mi); + + // Total water counted through the meter + double totalWaterConsumption(Unit u); + bool hasTotalWaterConsumption(); + double targetWaterConsumption(Unit u); + bool hasTargetWaterConsumption(); + +private: + void processContent(Telegram *t); + + double actual_total_water_consumption_m3_ {}; + double last_total_water_consumption_m3h_ {}; +}; + +MeterEMerlin868::MeterEMerlin868(MeterInfo &mi) : + MeterCommonImplementation(mi, MeterType::EMERLIN868) +{ + setExpectedTPLSecurityMode(TPLSecurityMode::AES_CBC_IV); + + addLinkMode(LinkMode::T1); + + // version 0x68 + // version 0x7c Sensus 640 + + addPrint("total", Quantity::Volume, + [&](Unit u){ return totalWaterConsumption(u); }, + "The total water consumption recorded by this meter.", + true, true); + + addPrint("target", Quantity::Volume, + [&](Unit u){ return targetWaterConsumption(u); }, + "The target water consumption recorded at previous period.", + true, true); +} + +shared_ptr createEMerlin868(MeterInfo &mi) +{ + return shared_ptr(new MeterEMerlin868(mi)); +} + +void MeterEMerlin868::processContent(Telegram *t) +{ + int offset; + string key; + + if(findKey(MeasurementType::Unknown, ValueInformation::Volume, 0, 0, &key, &t->values)) { + extractDVdouble(&t->values, key, &offset, &actual_total_water_consumption_m3_); + t->addMoreExplanation(offset, " actual total consumption (%f m3)", actual_total_water_consumption_m3_); + } + + if(findKey(MeasurementType::Unknown, ValueInformation::Volume, 1, 0, &key, &t->values)) { + extractDVdouble(&t->values, key, &offset, &last_total_water_consumption_m3h_); + t->addMoreExplanation(offset, " last total consumption (%f m3)", last_total_water_consumption_m3h_); + } + + +} + +double MeterEMerlin868::totalWaterConsumption(Unit u) +{ + assertQuantity(u, Quantity::Volume); + return convert(actual_total_water_consumption_m3_, Unit::M3, u); +} + +bool MeterEMerlin868::hasTotalWaterConsumption() +{ + return true; +} + +double MeterEMerlin868::targetWaterConsumption(Unit u) +{ + assertQuantity(u, Quantity::Volume); + return convert(last_total_water_consumption_m3h_, Unit::M3, u); +} + +bool MeterEMerlin868::hasTargetWaterConsumption() +{ + return true; +} diff --git a/src/meter_eurisii.cc b/src/meter_eurisii.cc index ad4bcf4..a1a423e 100644 --- a/src/meter_eurisii.cc +++ b/src/meter_eurisii.cc @@ -21,7 +21,7 @@ #include"wmbus.h" #include"wmbus_utils.h" -struct MeterEurisII : public virtual HeatCostMeter, public virtual MeterCommonImplementation { +struct MeterEurisII : public virtual HeatCostAllocationMeter, public virtual MeterCommonImplementation { MeterEurisII(MeterInfo &mi); double currentConsumption(Unit u); @@ -80,9 +80,9 @@ MeterEurisII::MeterEurisII(MeterInfo &mi) : true, true); } -shared_ptr createEurisII(MeterInfo &mi) +shared_ptr createEurisII(MeterInfo &mi) { - return shared_ptr(new MeterEurisII(mi)); + return shared_ptr(new MeterEurisII(mi)); } double MeterEurisII::currentConsumption(Unit u) diff --git a/src/meter_ev200.cc b/src/meter_ev200.cc new file mode 100644 index 0000000..3995efb --- /dev/null +++ b/src/meter_ev200.cc @@ -0,0 +1,107 @@ +/* + Copyright (C) 2017-2020 Fredrik Öhrström + Copyright (C) 2018 David Mallon + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include"dvparser.h" +#include"meters.h" +#include"meters_common_implementation.h" +#include"wmbus.h" +#include"wmbus_utils.h" + +using namespace std; + +struct MeterEV200 : public virtual WaterMeter, public virtual MeterCommonImplementation { + MeterEV200(MeterInfo &mi); + + // Total water counted through the meter + double totalWaterConsumption(Unit u); + bool hasTotalWaterConsumption(); + double targetWaterConsumption(Unit u); + bool hasTargetWaterConsumption(); + +private: + void processContent(Telegram *t); + + double actual_total_water_consumption_m3_ {}; + double last_total_water_consumption_m3h_ {}; +}; + +MeterEV200::MeterEV200(MeterInfo &mi) : + MeterCommonImplementation(mi, MeterType::EV200) +{ + setExpectedTPLSecurityMode(TPLSecurityMode::AES_CBC_IV); + + addLinkMode(LinkMode::T1); + + // version 0x68 + // version 0x7c Sensus 640 + + addPrint("total", Quantity::Volume, + [&](Unit u){ return totalWaterConsumption(u); }, + "The total water consumption recorded by this meter.", + true, true); + + addPrint("target", Quantity::Volume, + [&](Unit u){ return targetWaterConsumption(u); }, + "The target water consumption recorded at previous period.", + true, true); +} + +shared_ptr createEV200(MeterInfo &mi) +{ + return shared_ptr(new MeterEV200(mi)); +} + +void MeterEV200::processContent(Telegram *t) +{ + int offset; + string key; + + if(findKey(MeasurementType::Unknown, ValueInformation::Volume, 0, 0, &key, &t->values)) { + extractDVdouble(&t->values, key, &offset, &actual_total_water_consumption_m3_); + t->addMoreExplanation(offset, " actual total consumption (%f m3)", actual_total_water_consumption_m3_); + } + + if(findKey(MeasurementType::Unknown, ValueInformation::Volume, 1, 0, &key, &t->values)) { + extractDVdouble(&t->values, key, &offset, &last_total_water_consumption_m3h_); + t->addMoreExplanation(offset, " last total consumption (%f m3)", last_total_water_consumption_m3h_); + } + + +} + +double MeterEV200::totalWaterConsumption(Unit u) +{ + assertQuantity(u, Quantity::Volume); + return convert(actual_total_water_consumption_m3_, Unit::M3, u); +} + +bool MeterEV200::hasTotalWaterConsumption() +{ + return true; +} + +double MeterEV200::targetWaterConsumption(Unit u) +{ + assertQuantity(u, Quantity::Volume); + return convert(last_total_water_consumption_m3h_, Unit::M3, u); +} + +bool MeterEV200::hasTargetWaterConsumption() +{ + return true; +} diff --git a/src/meter_fhkvdataiii.cc b/src/meter_fhkvdataiii.cc index 07c7c52..2e63860 100644 --- a/src/meter_fhkvdataiii.cc +++ b/src/meter_fhkvdataiii.cc @@ -24,7 +24,7 @@ #include"util.h" #include -struct MeterFHKVDataIII : public virtual HeatCostMeter, public virtual MeterCommonImplementation +struct MeterFHKVDataIII : public virtual HeatCostAllocationMeter, public virtual MeterCommonImplementation { MeterFHKVDataIII(MeterInfo &mi); @@ -49,9 +49,9 @@ struct MeterFHKVDataIII : public virtual HeatCostMeter, public virtual MeterComm double temp_radiator_ {}; }; -shared_ptr createFHKVDataIII(MeterInfo &mi) +shared_ptr createFHKVDataIII(MeterInfo &mi) { - return shared_ptr(new MeterFHKVDataIII(mi)); + return shared_ptr(new MeterFHKVDataIII(mi)); } diff --git a/src/meter_qcaloric.cc b/src/meter_qcaloric.cc index 1ad4567..648b428 100644 --- a/src/meter_qcaloric.cc +++ b/src/meter_qcaloric.cc @@ -21,7 +21,7 @@ #include"wmbus.h" #include"wmbus_utils.h" -struct MeterQCaloric : public virtual HeatCostMeter, public virtual MeterCommonImplementation { +struct MeterQCaloric : public virtual HeatCostAllocationMeter, public virtual MeterCommonImplementation { MeterQCaloric(MeterInfo &mi); double currentConsumption(Unit u); @@ -98,9 +98,9 @@ MeterQCaloric::MeterQCaloric(MeterInfo &mi) : false, true); } -shared_ptr createQCaloric(MeterInfo &mi) +shared_ptr createQCaloric(MeterInfo &mi) { - return shared_ptr(new MeterQCaloric(mi)); + return shared_ptr(new MeterQCaloric(mi)); } double MeterQCaloric::currentConsumption(Unit u) diff --git a/src/meter_sontex868.cc b/src/meter_sontex868.cc index 4a486d8..4a6d003 100644 --- a/src/meter_sontex868.cc +++ b/src/meter_sontex868.cc @@ -21,7 +21,7 @@ #include"wmbus.h" #include"wmbus_utils.h" -struct MeterSontex868 : public virtual HeatCostMeter, public virtual MeterCommonImplementation { +struct MeterSontex868 : public virtual HeatCostAllocationMeter, public virtual MeterCommonImplementation { MeterSontex868(MeterInfo &mi); double currentConsumption(Unit u); @@ -101,9 +101,9 @@ MeterSontex868::MeterSontex868(MeterInfo &mi) : false, true); } -shared_ptr createSontex868(MeterInfo &mi) +shared_ptr createSontex868(MeterInfo &mi) { - return shared_ptr(new MeterSontex868(mi)); + return shared_ptr(new MeterSontex868(mi)); } double MeterSontex868::currentConsumption(Unit u) diff --git a/src/meters.cc b/src/meters.cc index bf8b527..fae1481 100644 --- a/src/meters.cc +++ b/src/meters.cc @@ -630,9 +630,9 @@ double ElectricityMeter::totalApparentEnergyProduction(Unit u) { return -NAN; } double ElectricityMeter::currentPowerConsumption(Unit u) { return -NAN; } double ElectricityMeter::currentPowerProduction(Unit u) { return -NAN; } -double HeatCostMeter::currentConsumption(Unit u) { return -NAN; } -string HeatCostMeter::setDate() { return "NAN"; } -double HeatCostMeter::consumptionAtSetDate(Unit u) { return -NAN; } +double HeatCostAllocationMeter::currentConsumption(Unit u) { return -NAN; } +string HeatCostAllocationMeter::setDate() { return "NAN"; } +double HeatCostAllocationMeter::consumptionAtSetDate(Unit u) { return -NAN; } void MeterCommonImplementation::setExpectedTPLSecurityMode(TPLSecurityMode tsm) { diff --git a/src/meters.h b/src/meters.h index 5c4db73..4c4a3fa 100644 --- a/src/meters.h +++ b/src/meters.h @@ -27,45 +27,47 @@ #include #define LIST_OF_METERS \ - X(amiplus, T1_bit, Electricity, AMIPLUS, Amiplus) \ - X(apator08, T1_bit, Water, APATOR08, Apator08) \ - X(apator162, C1_bit|T1_bit, Water, APATOR162, Apator162) \ - X(cma12w, C1_bit|T1_bit, TempHygro, CMA12W, CMa12w) \ - X(compact5, T1_bit, Heat, COMPACT5, Compact5) \ - X(ebzwmbe, T1_bit, Electricity, EBZWMBE, EBZWMBE) \ - X(eurisii, T1_bit, HeatCostAllocation, EURISII, EurisII) \ - X(ehzp, T1_bit, Electricity, EHZP, EHZP) \ - X(esyswm, T1_bit, Electricity, ESYSWM, ESYSWM) \ - X(flowiq2200, C1_bit, Water, FLOWIQ2200, FlowIQ2200) \ - X(flowiq3100, C1_bit, Water, FLOWIQ3100, FlowIQ3100) \ - X(em24, C1_bit, Electricity, EM24, EM24) \ - X(fhkvdataiii, T1_bit, HeatCostAllocation, FHKVDATAIII, FHKVDataIII) \ - X(hydrus, T1_bit, Water, HYDRUS, Hydrus) \ - X(hydrodigit, T1_bit, Water, HYDRODIGIT, Hydrodigit) \ - X(iperl, T1_bit, Water, IPERL, Iperl) \ - X(izar, T1_bit, Water, IZAR, Izar) \ - X(izar3, T1_bit, Water, IZAR3, Izar3) \ - X(lansensm, T1_bit, Smoke, LANSENSM, LansenSM) \ - X(lansenth, T1_bit, TempHygro, LANSENTH, LansenTH) \ - X(lansendw, T1_bit, DoorWindow, LANSENDW, LansenDW) \ - X(lansenpu, T1_bit, Pulse, LANSENPU, LansenPU) \ - X(mkradio3, T1_bit, Water, MKRADIO3, MKRadio3) \ - X(multical21, C1_bit|T1_bit, Water, MULTICAL21, Multical21) \ - X(multical302,C1_bit, Heat, MULTICAL302, Multical302) \ - X(multical403,C1_bit, Heat, MULTICAL403, Multical403) \ - X(multical603,C1_bit, Heat, MULTICAL603, Multical603) \ - X(omnipower, C1_bit, Electricity, OMNIPOWER, Omnipower) \ - X(rfmamb, T1_bit, TempHygro, RFMAMB, RfmAmb) \ - X(rfmtx1, T1_bit, Water, RFMTX1, RfmTX1) \ - X(q400, T1_bit, Water, Q400, Q400) \ - X(qcaloric, C1_bit, HeatCostAllocation, QCALORIC, QCaloric) \ - X(sontex868, T1_bit, HeatCostAllocation, SONTEX868, Sontex868) \ - X(supercom587,T1_bit, Water, SUPERCOM587, Supercom587) \ - X(ultrimis, T1_bit, Water, ULTRIMIS, Ultrimis) \ - X(vario451, T1_bit, Heat, VARIO451, Vario451) \ - X(waterstarm, C1_bit|T1_bit, Water,WATERSTARM, WaterstarM) \ - X(topaseskr, T1_bit, Water, TOPASESKR, TopasEsKr) \ - X(sensostar, C1_bit|T1_bit, Heat,SENSOSTAR, Sensostar) \ + X(amiplus, T1_bit, ElectricityMeter, AMIPLUS, Amiplus) \ + X(apator08, T1_bit, WaterMeter, APATOR08, Apator08) \ + X(apator162, C1_bit|T1_bit, WaterMeter, APATOR162, Apator162) \ + X(cma12w, C1_bit|T1_bit, TempHygroMeter, CMA12W, CMa12w) \ + X(compact5, T1_bit, HeatMeter, COMPACT5, Compact5) \ + X(ebzwmbe, T1_bit, ElectricityMeter, EBZWMBE, EBZWMBE) \ + X(eurisii, T1_bit, HeatCostAllocationMeter, EURISII, EurisII) \ + X(ehzp, T1_bit, ElectricityMeter, EHZP, EHZP) \ + X(esyswm, T1_bit, ElectricityMeter, ESYSWM, ESYSWM) \ + X(flowiq2200, C1_bit, WaterMeter, FLOWIQ2200, FlowIQ2200) \ + X(flowiq3100, C1_bit, WaterMeter, FLOWIQ3100, FlowIQ3100) \ + X(em24, C1_bit, ElectricityMeter, EM24, EM24) \ + X(emerlin868, T1_bit, WaterMeter, EMERLIN868, EMerlin868) \ + X(ev200, T1_bit, WaterMeter, EV200, EV200) \ + X(fhkvdataiii, T1_bit, HeatCostAllocationMeter, FHKVDATAIII, FHKVDataIII) \ + X(hydrus, T1_bit, WaterMeter, HYDRUS, Hydrus) \ + X(hydrodigit, T1_bit, WaterMeter, HYDRODIGIT, Hydrodigit) \ + X(iperl, T1_bit, WaterMeter, IPERL, Iperl) \ + X(izar, T1_bit, WaterMeter, IZAR, Izar) \ + X(izar3, T1_bit, WaterMeter, IZAR3, Izar3) \ + X(lansensm, T1_bit, SmokeDetector, LANSENSM, LansenSM) \ + X(lansenth, T1_bit, TempHygroMeter, LANSENTH, LansenTH) \ + X(lansendw, T1_bit, DoorWindowDetector, LANSENDW, LansenDW) \ + X(lansenpu, T1_bit, PulseCounter, LANSENPU, LansenPU) \ + X(mkradio3, T1_bit, WaterMeter, MKRADIO3, MKRadio3) \ + X(multical21, C1_bit|T1_bit, WaterMeter, MULTICAL21, Multical21) \ + X(multical302,C1_bit, HeatMeter, MULTICAL302, Multical302) \ + X(multical403,C1_bit, HeatMeter, MULTICAL403, Multical403) \ + X(multical603,C1_bit, HeatMeter, MULTICAL603, Multical603) \ + X(omnipower, C1_bit, ElectricityMeter, OMNIPOWER, Omnipower) \ + X(rfmamb, T1_bit, TempHygroMeter, RFMAMB, RfmAmb) \ + X(rfmtx1, T1_bit, WaterMeter, RFMTX1, RfmTX1) \ + X(q400, T1_bit, WaterMeter, Q400, Q400) \ + X(qcaloric, C1_bit, HeatCostAllocationMeter, QCALORIC, QCaloric) \ + X(sontex868, T1_bit, HeatCostAllocationMeter, SONTEX868, Sontex868) \ + X(supercom587,T1_bit, WaterMeter, SUPERCOM587, Supercom587) \ + X(ultrimis, T1_bit, WaterMeter, ULTRIMIS, Ultrimis) \ + X(vario451, T1_bit, HeatMeter, VARIO451, Vario451) \ + X(waterstarm, C1_bit|T1_bit, WaterMeter,WATERSTARM, WaterstarM) \ + X(topaseskr, T1_bit, WaterMeter, TOPASESKR, TopasEsKr) \ + X(sensostar, C1_bit|T1_bit, HeatMeter,SENSOSTAR, Sensostar) \ // List of numbers that can be used to detect the meter driver @@ -98,6 +100,8 @@ X(FLOWIQ2200,MANUFACTURER_KAW, 0x16, 0x3a) \ X(FLOWIQ3100,MANUFACTURER_KAM, 0x16, 0x1d) \ X(EM24, MANUFACTURER_KAM, 0x02, 0x33) \ + X(EMERLIN868,MANUFACTURER_ELR, 0x37, 0x11) \ + X(EV200, MANUFACTURER_ELR, 0x07, 0x0d) \ X(FHKVDATAIII,MANUFACTURER_TCH, 0x80, 0x69) \ X(HYDRUS, MANUFACTURER_DME, 0x07, 0x70) \ X(HYDRUS, MANUFACTURER_HYD, 0x07, 0x24) \ @@ -313,7 +317,7 @@ struct ElectricityMeter : public virtual Meter virtual double currentPowerProduction(Unit u); // kw }; -struct HeatCostMeter : public virtual Meter +struct HeatCostAllocationMeter : public virtual Meter { virtual double currentConsumption(Unit u); virtual string setDate(); @@ -356,53 +360,17 @@ struct PulseCounter : public virtual Meter virtual ~PulseCounter() = default; }; -struct GenericMeter : public virtual Meter { +struct Generic : public virtual Meter { }; string toMeterName(MeterType mt); MeterType toMeterType(string& type); LinkModeSet toMeterLinkModeSet(string& type); -shared_ptr createMultical21(MeterInfo &m); -shared_ptr createFlowIQ2200(MeterInfo &m); -shared_ptr createFlowIQ3100(MeterInfo &m); -shared_ptr createMultical302(MeterInfo &m); -shared_ptr createMultical403(MeterInfo &m); -shared_ptr createMultical603(MeterInfo &m); -shared_ptr createVario451(MeterInfo &m); -shared_ptr createWaterstarM(MeterInfo &m); -shared_ptr createCompact5(MeterInfo &m); -shared_ptr createOmnipower(MeterInfo &m); -shared_ptr createAmiplus(MeterInfo &m); -shared_ptr createEM24(MeterInfo &m); -shared_ptr createSupercom587(MeterInfo &m); -shared_ptr createMKRadio3(MeterInfo &m); -shared_ptr createApator08(MeterInfo &m); -shared_ptr createApator162(MeterInfo &m); -shared_ptr createIperl(MeterInfo &m); -shared_ptr createHydrus(MeterInfo &m); -shared_ptr createHydrodigit(MeterInfo &m); -shared_ptr createIzar(MeterInfo &m); -shared_ptr createIzar3(MeterInfo &m); -shared_ptr createQ400(MeterInfo &m); -shared_ptr createQCaloric(MeterInfo &m); -shared_ptr createEurisII(MeterInfo &m); -shared_ptr createFHKVDataIII(MeterInfo &m); -shared_ptr createSontex868(MeterInfo &m); -shared_ptr createLansenTH(MeterInfo &m); -shared_ptr createLansenSM(MeterInfo &m); -shared_ptr createLansenPU(MeterInfo &m); -shared_ptr createLansenDW(MeterInfo &m); -shared_ptr createCMa12w(MeterInfo &m); -shared_ptr createRfmAmb(MeterInfo &m); -shared_ptr createRfmTX1(MeterInfo &m); -shared_ptr createEHZP(MeterInfo &m); -shared_ptr createESYSWM(MeterInfo &m); -shared_ptr createEBZWMBE(MeterInfo &m); -shared_ptr createTopasEsKr(MeterInfo &m); -shared_ptr createUltrimis(MeterInfo &m); -shared_ptr createSensostar(MeterInfo &m); +#define X(mname,linkmode,info,type,cname) shared_ptr create##cname(MeterInfo &m); +LIST_OF_METERS +#undef X -GenericMeter *createGeneric(WMBus *bus, MeterInfo &m); +Generic *createGeneric(WMBus *bus, MeterInfo &m); #endif diff --git a/tests/test_listen_to_all.sh b/tests/test_listen_to_all.sh index 280cc89..6812bcb 100755 --- a/tests/test_listen_to_all.sh +++ b/tests/test_listen_to_all.sh @@ -185,6 +185,16 @@ Received telegram from: 12345679 type: Heat meter (0x04) ver: 0x00 driver: sensostar +Received telegram from: 99993030 + manufacturer: (ELR) Elster Metering, United Kingdom (0x1592) + type: Water meter (0x07) + ver: 0x0d + driver: ev200 +Received telegram from: 95949392 + manufacturer: (ELR) Elster Metering, United Kingdom (0x1592) + type: Radio converter (meter side) (0x37) + ver: 0x11 + driver: emerlin868 EOF RES=$($PROG --logfile=$LOGFILE --t1 simulations/simulation_t1.txt 2>&1) diff --git a/tests/test_t1_meters.sh b/tests/test_t1_meters.sh index 87727a1..307f5cf 100755 --- a/tests/test_t1_meters.sh +++ b/tests/test_t1_meters.sh @@ -37,7 +37,9 @@ METERS="MyWarmWater supercom587 12345678 NOKEY Wasser rfmtx1 74737271 NOKEY Woter waterstarm 20096221 BEDB81B52C29B5C143388CBB0D15A051 Witer topaseskr 78563412 NOKEY - Heater sensostar 12345679 NOKEY" + Heater sensostar 12345679 NOKEY + Voda ev200 99993030 NOKEY + Vodda emerlin868 95949392 NOKEY" cat simulations/simulation_t1.txt | grep '^{' > $TEST/test_expected.txt