Added water meter Diehl IZAR RC I G4.

pull/278/head
Fredrik Öhrström 2021-04-10 17:58:32 +02:00
rodzic da690f2afd
commit f753449750
9 zmienionych plików z 114 dodań i 1 usunięć

Wyświetl plik

@ -1,3 +1,6 @@
Support added for the water meter Diehl IZAR RC I G4.
Version 1.3.0: 2021-04-09
You can now use "auto" as a meter driver.

Wyświetl plik

@ -146,6 +146,7 @@ METER_OBJS:=\
$(BUILD)/meter_apator162.o \
$(BUILD)/meter_cma12w.o \
$(BUILD)/meter_compact5.o \
$(BUILD)/meter_dme_07.o \
$(BUILD)/meter_ebzwmbe.o \
$(BUILD)/meter_ehzp.o \
$(BUILD)/meter_esyswm.o \

Wyświetl plik

@ -286,6 +286,7 @@ 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)
Diehl IZAR RC I G4 (dme_07)
Elster Merlin 868 (emerlin868)
Elster V200H (ev200)
Maddalena EVO 868 (evo868)

Wyświetl plik

@ -235,3 +235,8 @@ telegram=|534424232004256092687A370045752235854DEEEA5939FAD81C25FEEF5A23C38FB916
telegram=|51440186010905001837721956880101064004DA000020026CA9220E017799241103000C13641320000A2D00000A5A90060A5E800544050E77000001FD0C010A6564370AFD4731030A274907047F00000002|
{"media":"heat","meter":"elf","name":"Hetta","id":"01885619","meter_date":"2021-02-09","total_energy_consumption_kwh":3112.49977,"current_power_consumption_kw":0,"total_volume_m3":201.364,"total_energy_consumption_at_date_kwh":3047.8,"flow_temperature_c":69,"return_temperature_c":58,"external_temperature_c":37.64,"status":"200000","operating_time_h":44760,"version":"1","battery_v":0,"timestamp":"1111-11-11T11:11:11Z"}
|Hetta;01885619;3112.499770;0.000000;201.364000;69.000000;58.000000;37.640000;200000;1111-11-11 11:11.11
# Test Diehl IZAR RC I G4 water meter
telegram=|1E44A511909192937B077A9F0010052F2F|04130347030002FD1700002F2F2F|
{"media":"water","meter":"dme_07","name":"DigiWasser","id":"93929190","total_m3":214.787,"status":"OK","timestamp":"1111-11-11T11:11:11Z"}
|DigiWasser;93929190;214.787000;OK;1111-11-11 11:11.11

Wyświetl plik

@ -33,6 +33,7 @@
X(COMPACT5, MANUFACTURER_TCH, 0xc3, 0x45) \
X(COMPACT5, MANUFACTURER_TCH, 0x43, 0x22) \
X(COMPACT5, MANUFACTURER_TCH, 0x43, 0x45) \
X(DME_07, MANUFACTURER_DME, 0x07, 0x7b) \
X(EBZWMBE, MANUFACTURER_EBZ, 0x37, 0x02) \
X(EURISII, MANUFACTURER_INE, 0x08, 0x55) \
X(EHZP, MANUFACTURER_EMH, 0x02, 0x02) \

Wyświetl plik

@ -0,0 +1,95 @@
/*
Copyright (C) 2021 Fredrik Öhrström
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 <http://www.gnu.org/licenses/>.
*/
#include"dvparser.h"
#include"meters.h"
#include"meters_common_implementation.h"
#include"wmbus.h"
#include"wmbus_utils.h"
#include"util.h"
using namespace std;
struct MeterDME_07 : public virtual WaterMeter, public virtual MeterCommonImplementation {
MeterDME_07(MeterInfo &mi);
// Total water counted through the meter
double totalWaterConsumption(Unit u);
bool hasTotalWaterConsumption();
private:
void processContent(Telegram *t);
string status();
double total_water_consumption_m3_ {};
uint16_t error_codes_ {};
};
shared_ptr<WaterMeter> createDME_07(MeterInfo &mi)
{
return shared_ptr<WaterMeter>(new MeterDME_07(mi));
}
MeterDME_07::MeterDME_07(MeterInfo &mi) :
MeterCommonImplementation(mi, MeterDriver::DME_07)
{
setExpectedTPLSecurityMode(TPLSecurityMode::AES_CBC_IV);
addLinkMode(LinkMode::T1);
addPrint("total", Quantity::Volume,
[&](Unit u){ return totalWaterConsumption(u); },
"The total water consumption recorded by this meter.",
true, true);
addPrint("status", Quantity::Text,
[&](){ return status(); },
"Status of meter.",
true, true);
}
void MeterDME_07::processContent(Telegram *t)
{
int offset;
string key;
if(findKey(MeasurementType::Instantaneous, ValueInformation::Volume, 0, 0, &key, &t->values)) {
extractDVdouble(&t->values, key, &offset, &total_water_consumption_m3_);
t->addMoreExplanation(offset, " total consumption (%f m3)", total_water_consumption_m3_);
}
extractDVuint16(&t->values, "02FD17", &offset, &error_codes_);
t->addMoreExplanation(offset, " error codes (%s)", status().c_str());
}
double MeterDME_07::totalWaterConsumption(Unit u)
{
assertQuantity(u, Quantity::Volume);
return convert(total_water_consumption_m3_, Unit::M3, u);
}
bool MeterDME_07::hasTotalWaterConsumption()
{
return true;
}
string MeterDME_07::status()
{
if (error_codes_ == 0) return "OK";
// Can we decode the error bits more?
return tostrprintf("ERR %04x", error_codes_);
}

Wyświetl plik

@ -35,6 +35,7 @@
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(dme_07, T1_bit, WaterMeter, DME_07, DME_07) \
X(ebzwmbe, T1_bit, ElectricityMeter, EBZWMBE, EBZWMBE) \
X(eurisii, T1_bit, HeatCostAllocationMeter, EURISII, EurisII) \
X(ehzp, T1_bit, ElectricityMeter, EHZP, EHZP) \

Wyświetl plik

@ -264,6 +264,11 @@ Received telegram from: 00050901
type: Heat meter (0x04)
ver: 0x40
driver: elf
Received telegram from: 93929190
manufacturer: (DME) DIEHL Metering, Germany (0x11a5)
type: Water meter (0x07)
ver: 0x7b
driver: dme_07
EOF
RES=$($PROG --logfile=$LOGFILE --t1 simulations/simulation_t1.txt 2>&1)

Wyświetl plik

@ -51,7 +51,8 @@ METERS="MyWarmWater supercom587 12345678 NOKEY
Smokey tsd2 91633569 NOKEY
Sharky775 sharky 68926025 NOKEY
Heating compact5 62626262 NOKEY
Hetta elf 01885619 NOKEY"
Hetta elf 01885619 NOKEY
DigiWasser dme_07 93929190 NOKEY"
cat simulations/simulation_t1.txt | grep '^{' > $TEST/test_expected.txt