From 3e64ba587cded45604d9074a62bcfda05ae4fc24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20=C3=96hrstr=C3=B6m?= Date: Sat, 25 Sep 2021 11:01:51 +0200 Subject: [PATCH] Added test case for unismart gas meter. --- CHANGES | 2 ++ README.md | 4 +++ simulations/simulation_t1.txt | 5 +++ src/meter_unismart.cc | 57 ++++++++++++++++++++++++++++++++++- tests/test_listen_to_all.sh | 5 +++ tests/test_t1_meters.sh | 3 +- 6 files changed, 74 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index d3ddf12..48d8398 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,6 @@ +Added support for the Apator uniSMART gas meter. + You can now decode a telegram just by supplying hex on the command line: wmbusmeters --format=json MyMeter auto 12345678 NOKEY or just diff --git a/README.md b/README.md index e4ef2a5..17a8a2f 100644 --- a/README.md +++ b/README.md @@ -388,6 +388,10 @@ Tauron Amiplus (amiplus) (includes vendor apator and echelon) Gavazzi EM24 (em24) Gransystems 301 and 303 (gransystems) Kamstrup Omnipower (omnipower) + +Support gas meters: +uniSMART (unismart) + ``` The wmbus dongle im871a can listen to either s1, c1 or t1. diff --git a/simulations/simulation_t1.txt b/simulations/simulation_t1.txt index 2a58c21..a0e3e9b 100644 --- a/simulations/simulation_t1.txt +++ b/simulations/simulation_t1.txt @@ -270,3 +270,8 @@ telegram=|19442423850798160018A2410100133EBBD44081053F243A82A3| telegram=76442104710007612507727100076121042507B5006005E2E95A3C2A1279A5415E6732679B43369FD5FDDDD783EEEBB48236D34E7C94AF0A18A5FDA5F7D64111EB42D4D891622139F2952F9D12A20088DFA4CF8123871123EE1F6C1DCEA414879DDB4E05E508F1826D7EFBA6964DF804C9261EA23BBF03 {"media":"water","meter":"aventieswm","name":"Votten","id":"61070071","total_m3":466.472,"consumption_at_set_date_1_m3":465.96,"consumption_at_set_date_2_m3":458.88,"consumption_at_set_date_3_m3":449.65,"consumption_at_set_date_4_m3":442.35,"consumption_at_set_date_5_m3":431.07,"consumption_at_set_date_6_m3":423.98,"consumption_at_set_date_7_m3":415.23,"consumption_at_set_date_8_m3":409.03,"consumption_at_set_date_9_m3":400.79,"consumption_at_set_date_10_m3":393.2,"consumption_at_set_date_11_m3":388.63,"consumption_at_set_date_12_m3":379.26,"consumption_at_set_date_13_m3":371.26,"consumption_at_set_date_14_m3":357.84,"error_flags":"","timestamp":"1111-11-11T11:11:11Z"} |Votten;61070071;466.472000;;1111-11-11 11:11.11 + +# Test Unismart Gas Meter +telegram=|6044B8059430040001037A1D005085E2B670BCF1A5C87E0C1A51DA18924EF984613DA2A9CD39D8F4C7208326C76D42DBEADF80D574192B71BD7C4F56A7F1513151768A9DB804883B28CB085CA2D0F7438C361CB9E2734712ED9BFBB2A14EF55208| +{"media":"gas","meter":"unismart","name":"GasMeter","id":"00043094","total_m3":917,"timestamp":"1111-11-11T11:11:11Z"} +|GasMeter;00043094;917.000000;1111-11-11 11:11.11 diff --git a/src/meter_unismart.cc b/src/meter_unismart.cc index 848a30b..17560f8 100644 --- a/src/meter_unismart.cc +++ b/src/meter_unismart.cc @@ -58,7 +58,62 @@ MeterUnismart::MeterUnismart(MeterInfo &mi) : void MeterUnismart::processContent(Telegram *t) { - int offset; + /* + (unismart) 11: 0C dif (8 digit BCD Instantaneous value) +(unismart) 12: 78 vif (Fabrication no) +(unismart) 13: 96221603 +(unismart) 17: 04 dif (32 Bit Integer/Binary Instantaneous value) +(unismart) 18: 6D vif (Date and time type) +(unismart) 19: 122DAF29 +(unismart) 1d: 0C dif (8 digit BCD Instantaneous value) +(unismart) 1e: 94 vif (Volume 10⁻² m³) +(unismart) 1f: 3A vife (uncorrected meter unit) +(unismart) 20: * 00170900 total consumption (917.000000 m3) +(unismart) 24: 44 dif (32 Bit Integer/Binary Instantaneous value storagenr=1) +(unismart) 25: 6D vif (Date and time type) +(unismart) 26: 0026A129 +(unismart) 2a: 4C dif (8 digit BCD Instantaneous value storagenr=1) +(unismart) 2b: 94 vif (Volume 10⁻² m³) +(unismart) 2c: 3A vife (uncorrected meter unit) +(unismart) 2d: 32110900 +(unismart) 31: 01 dif (8 Bit Integer/Binary Instantaneous value) +(unismart) 32: FD vif (Second extension FD of VIF-codes) +(unismart) 33: 67 vife (Special supplier information) +(unismart) 34: 00 +(unismart) 35: 02 dif (16 Bit Integer/Binary Instantaneous value) +(unismart) 36: FD vif (Second extension FD of VIF-codes) +(unismart) 37: 74 vife (Reserved) +(unismart) 38: F00C +(unismart) 3a: 0D dif (variable length Instantaneous value) +(unismart) 3b: FD vif (Second extension FD of VIF-codes) +(unismart) 3c: 0C vife (Model/Version) +(unismart) 3d: 06 varlen=6 +(unismart) 3e: 554747342020 +(unismart) 44: 01 dif (8 Bit Integer/Binary Instantaneous value) +(unismart) 45: FD vif (Second extension FD of VIF-codes) +(unismart) 46: 0B vife (Parameter set identification) +(unismart) 47: 02 +(unismart) 48: 01 dif (8 Bit Integer/Binary Instantaneous value) +(unismart) 49: 7F vif (Manufacturer specific) +(unismart) 4a: 14 +(unismart) 4b: 06 dif (48 Bit Integer/Binary Instantaneous value) +(unismart) 4c: 6D vif (Date and time type) +(unismart) 4d: 1E120DAF296D +(unismart) 53: 2F skip +(unismart) 54: 2F skip +(unismart) 55: 2F skip +(unismart) 56: 2F skip +(unismart) 57: 2F skip +(unismart) 58: 2F skip +(unismart) 59: 2F skip +(unismart) 5a: 2F skip +(unismart) 5b: 2F skip +(unismart) 5c: 2F skip +(unismart) 5d: 2F skip +(unismart) 5e: 2F skip + +*/ + int offset; string key; if(findKey(MeasurementType::Unknown, ValueInformation::Volume, 0, 0, &key, &t->values)) { diff --git a/tests/test_listen_to_all.sh b/tests/test_listen_to_all.sh index 6933aa6..decddf1 100755 --- a/tests/test_listen_to_all.sh +++ b/tests/test_listen_to_all.sh @@ -303,6 +303,11 @@ Received telegram from: 61070071 type: Water meter (0x07) ver: 0x25 driver: aventieswm aventieswm +Received telegram from: 00043094 + manufacturer: (AMX) APATOR METRIX, Poland (0x5b8) + type: Gas meter (0x03) + ver: 0x01 + driver: unismart 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 01f0642..bc77746 100755 --- a/tests/test_t1_meters.sh +++ b/tests/test_t1_meters.sh @@ -58,7 +58,8 @@ METERS="MyWarmWater supercom587 12345678 NOKEY Heating compact5 62626262 NOKEY Hetta elf 01885619 NOKEY DigiWasser dme_07 93929190 NOKEY - Votten aventieswm 61070071 A004EB23329A477F1DD2D7820B56EB3D" + Votten aventieswm 61070071 A004EB23329A477F1DD2D7820B56EB3D + GasMeter unismart 00043094 00000000000000000000000000000000" cat simulations/simulation_t1.txt | grep '^{' > $TEST/test_expected.txt