Added techem/wehrle water meter combo.

pull/267/head
Fredrik Öhrström 2021-03-07 14:39:52 +01:00
rodzic 365b38a535
commit c90ca18b1b
6 zmienionych plików z 95 dodań i 4 usunięć

Wyświetl plik

@ -187,6 +187,7 @@ METER_OBJS:=\
$(BUILD)/meter_ultrimis.o \
$(BUILD)/meter_vario451.o \
$(BUILD)/meter_waterstarm.o \
$(BUILD)/meter_weh_07.o \
$(BUILD)/meter_whe46x.o \
$(BUILD)/meter_whe5x.o \
$(BUILD)/meter_sensostar.o \

Wyświetl plik

@ -69,3 +69,7 @@ telegram=|27442D2C5768663230028D20E900C91C2011BA79138CCCFB|1A0300000000000003000
# Test EI Electronics smoke detector
telegram=|5E462515112801000C1A7A370050252F2F|0BFD0F060101046D300CAB2202FD17000082206CAB22426C01018440FF2C000F11008250FD61000082506C01018260FD6100008360FD3100000082606C01018270FD61010082706CAB222F2F2F2F|
{"media":"smoke detector","meter":"ei6500","name":"Smokey","id":"00012811","software_version":"1.1.6","message_datetime":"2021-02-11 12:48","last_alarm_date":"2000-01-01","smoke_alarm_counter":"0","total_remove_duration":"0 minutes","last_remove_date":"2000-01-01","removed_counter":"0","test_button_last_date":"2021-02-11","test_button_counter":"1","status":"NOT_INSTALLED","timestamp":"1111-11-11T11:11:11Z"}
# Test Techem radio convert + Wehrle water meter combo.
telegram=|494468509494949495377286868686A85CFE07A90030052F2F|0413100000000F52FCF6A52A90A8D83CA8F7FEAE86990502323D0C70EFF49833C7C1696F75BCABC1E52E6305308D0F31FB|
{"media":"water","meter":"weh_07","name":"Vatten","id":"86868686","total_m3":0.016,"timestamp":"1111-11-11T11:11:11Z"}

Wyświetl plik

@ -0,0 +1,79 @@
/*
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 MeterWEH_07 : public virtual WaterMeter, public virtual MeterCommonImplementation {
MeterWEH_07(MeterInfo &mi);
// Total water counted through the meter
double totalWaterConsumption(Unit u);
bool hasTotalWaterConsumption();
private:
void processContent(Telegram *t);
double total_water_consumption_m3_ {};
};
shared_ptr<WaterMeter> createWEH_07(MeterInfo &mi)
{
return shared_ptr<WaterMeter>(new MeterWEH_07(mi));
}
MeterWEH_07::MeterWEH_07(MeterInfo &mi) :
MeterCommonImplementation(mi, MeterType::WEH_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);
}
void MeterWEH_07::processContent(Telegram *t)
{
int offset;
string key;
if(findKey(MeasurementType::Unknown, 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_);
}
}
double MeterWEH_07::totalWaterConsumption(Unit u)
{
assertQuantity(u, Quantity::Volume);
return convert(total_water_consumption_m3_, Unit::M3, u);
}
bool MeterWEH_07::hasTotalWaterConsumption()
{
return true;
}

Wyświetl plik

@ -39,6 +39,7 @@
X(esyswm, T1_bit, ElectricityMeter, ESYSWM, ESYSWM) \
X(flowiq2200, C1_bit, WaterMeter, FLOWIQ2200, FlowIQ2200) \
X(flowiq3100, C1_bit, WaterMeter, FLOWIQ3100, FlowIQ3100) \
X(ei6500, C1_bit, SmokeDetector, EI6500, EI6500) \
X(elf, T1_bit, HeatMeter, ELF, Elf) \
X(em24, C1_bit, ElectricityMeter, EM24, EM24) \
X(emerlin868, T1_bit, WaterMeter, EMERLIN868, EMerlin868) \
@ -46,6 +47,7 @@
X(evo868, T1_bit, WaterMeter, EVO868, EVO868) \
X(fhkvdataiii,T1_bit, HeatCostAllocationMeter, FHKVDATAIII, FHKVDataIII) \
X(fhkvdataiv, T1_bit, HeatCostAllocationMeter, FHKVDATAIV, FHKVDataIV) \
X(gransystems,T1_bit, ElectricityMeter, CCx01, CCx01) \
X(hydrus, T1_bit, WaterMeter, HYDRUS, Hydrus) \
X(hydrocalm3, T1_bit, HeatMeter, HYDROCALM3, HydrocalM3) \
X(hydrodigit, T1_bit, WaterMeter, HYDRODIGIT, Hydrodigit) \
@ -70,18 +72,17 @@
X(tsd2, T1_bit, SmokeDetector, TSD2, TSD2) \
X(q400, T1_bit, WaterMeter, Q400, Q400) \
X(qcaloric, C1_bit, HeatCostAllocationMeter, QCALORIC, QCaloric) \
X(sensostar, C1_bit|T1_bit, HeatMeter,SENSOSTAR, Sensostar) \
X(sharky, T1_bit, HeatMeter, SHARKY, Sharky) \
X(sontex868, T1_bit, HeatCostAllocationMeter, SONTEX868, Sontex868) \
X(supercom587,T1_bit, WaterMeter, SUPERCOM587, Supercom587) \
X(topaseskr, T1_bit, WaterMeter, TOPASESKR, TopasEsKr) \
X(ultrimis, T1_bit, WaterMeter, ULTRIMIS, Ultrimis) \
X(vario451, T1_bit, HeatMeter, VARIO451, Vario451) \
X(waterstarm, C1_bit|T1_bit, WaterMeter,WATERSTARM, WaterstarM) \
X(whe46x, S1_bit, HeatCostAllocationMeter, WHE46X, Whe46x) \
X(whe5x, S1_bit, HeatCostAllocationMeter, WHE5X, Whe5x) \
X(topaseskr, T1_bit, WaterMeter, TOPASESKR, TopasEsKr) \
X(sensostar, C1_bit|T1_bit, HeatMeter,SENSOSTAR, Sensostar) \
X(gransystems,T1_bit, ElectricityMeter, CCx01, CCx01) \
X(ei6500, C1_bit, SmokeDetector, EI6500, EI6500)
X(weh_07, C1_bit, WaterMeter, WEH_07, WEH_07) \
// List of numbers that can be used to detect the meter driver from a telegram.
@ -169,6 +170,7 @@
X(WATERSTARM, MANUFACTURER_DWZ, 0x06, 0x02) \
X(WATERSTARM, MANUFACTURER_DWZ, 0x07, 0x02) \
X(WATERSTARM, MANUFACTURER_EFE, 0x07, 0x03) \
X(WEH_07, MANUFACTURER_WEH, 0x07, 0xfe) \
X(WHE46X, MANUFACTURER_LSE, 0x08, 0x18) \
X(WHE5X, MANUFACTURER_LSE, 0x08, 0x34) \
X(SENSOSTAR, MANUFACTURER_EFE, 0x04, 0x00) \

Wyświetl plik

@ -0,0 +1,4 @@
id=86868686
type=weh_07
name=Vatten
key=

Wyświetl plik

@ -22,6 +22,7 @@ $PROG --format=json simulations/simulation_c1.txt \
Heater multical803 80808081 NOKEY \
myomnipower omnipower 32666857 NOKEY \
Smokey ei6500 00012811 NOKEY \
Vatten weh_07 86868686 NOKEY \
> $TEST/test_output.txt 2> $TEST/test_stderr.txt
if [ "$?" = "0" ]