kopia lustrzana https://github.com/weetmuts/wmbusmeters
Porównaj commity
27 Commity
7912352431
...
5879a2d432
Autor | SHA1 | Data |
---|---|---|
Andi252 | 5879a2d432 | |
Fredrik Öhrström | d90dbb196e | |
Fredrik Öhrström | 14d021426a | |
Michał Morański | f32179a939 | |
Andreas Horrer | 25108bd290 | |
Andreas Horrer | ac70a7808b | |
Fredrik Öhrström | a32fcfdf9a | |
Fredrik Öhrström | efcc41d107 | |
Andreas Horrer | b556cc1b02 | |
Andreas Horrer | c5ab867acd | |
Andreas Horrer | ac0f0d8243 | |
Andreas Horrer | 879127ac8f | |
Andreas Horrer | ad3c9df8b3 | |
Andreas Horrer | 07b78b205e | |
Andreas Horrer | 086532373c | |
Andreas Horrer | 0cd75bec8e | |
Andreas Horrer | f9c3fa4d64 | |
Andreas Horrer | a009f672db | |
Andreas Horrer | 7d4eda9623 | |
Andreas Horrer | 97715d7501 | |
Andreas Horrer | 86ba3bb304 | |
Andreas Horrer | 29b04f3365 | |
Andreas Horrer | 176a8b0c4a | |
Andreas Horrer | ba19a1c6ea | |
Andreas Horrer | 00039bbdb8 | |
Andreas Horrer | 752fd2f1c6 | |
Andreas Horrer | 8fd98c2562 |
2
Makefile
2
Makefile
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2017-2023 Fredrik Öhrström (gpl-3.0-or-later)
|
||||
# Copyright (C) 2017-2024 Fredrik Öhrström (gpl-3.0-or-later)
|
||||
#
|
||||
# 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
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace
|
|||
di.setDefaultFields("name,id,total_m3,timestamp");
|
||||
di.setMeterType(MeterType::WaterMeter);
|
||||
di.addLinkMode(LinkMode::T1);
|
||||
di.addDetection(0x8614/*APT?*/, 0x03, 0x03);
|
||||
di.addDetection(MANUFACTURER_APT, 0x03, 0x03);
|
||||
di.usesProcessContent();
|
||||
di.setConstructor([](MeterInfo& mi, DriverInfo& di){ return shared_ptr<Meter>(new Driver(mi, di)); });
|
||||
});
|
||||
|
|
|
@ -0,0 +1,122 @@
|
|||
/*
|
||||
Copyright (C) 2022 Fredrik Öhrström (gpl-3.0-or-later)
|
||||
2023 Andreas Horrer (gpl-3.0-or-later)
|
||||
|
||||
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"meters_common_implementation.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
struct Driver : public virtual MeterCommonImplementation
|
||||
{
|
||||
Driver(MeterInfo &mi, DriverInfo &di);
|
||||
};
|
||||
|
||||
static bool ok = registerDriver([](DriverInfo&di)
|
||||
{
|
||||
di.setName("itronheat");
|
||||
di.addNameAlias("ultramaxx");
|
||||
di.setDefaultFields("name,id,status,total_energy_consumption_kwh,total_volume_m3,timestamp");
|
||||
di.setMeterType(MeterType::HeatMeter);
|
||||
di.addLinkMode(LinkMode::C1);
|
||||
di.addDetection(MANUFACTURER_ITW, 0x04, 0x00);
|
||||
di.setConstructor([](MeterInfo& mi, DriverInfo& di){ return shared_ptr<Meter>(new Driver(mi, di)); });
|
||||
});
|
||||
|
||||
Driver::Driver(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementation(mi, di)
|
||||
{
|
||||
addOptionalLibraryFields("meter_datetime");
|
||||
|
||||
addStringFieldWithExtractorAndLookup(
|
||||
"status",
|
||||
"Meter status from error flags and tpl status field.",
|
||||
DEFAULT_PRINT_PROPERTIES |
|
||||
PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS,
|
||||
FieldMatcher::build()
|
||||
.set(MeasurementType::Instantaneous)
|
||||
.set(VIFRange::ErrorFlags),
|
||||
Translate::Lookup(
|
||||
{
|
||||
{
|
||||
{
|
||||
"ERROR_FLAGS",
|
||||
Translate::MapType::BitToString,
|
||||
AlwaysTrigger, MaskBits(0xffff),
|
||||
"OK",
|
||||
{
|
||||
}
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
||||
addNumericFieldWithExtractor(
|
||||
"total_energy_consumption",
|
||||
"The total heat energy consumption recorded by this meter.",
|
||||
DEFAULT_PRINT_PROPERTIES,
|
||||
Quantity::Energy,
|
||||
VifScaling::Auto, DifSignedness::Signed,
|
||||
FieldMatcher::build()
|
||||
.set(MeasurementType::Instantaneous)
|
||||
.set(VIFRange::AnyEnergyVIF)
|
||||
);
|
||||
|
||||
addNumericFieldWithExtractor(
|
||||
"total_volume",
|
||||
"The total heating media volume recorded by this meter.",
|
||||
DEFAULT_PRINT_PROPERTIES,
|
||||
Quantity::Volume,
|
||||
VifScaling::Auto, DifSignedness::Signed,
|
||||
FieldMatcher::build()
|
||||
.set(MeasurementType::Instantaneous)
|
||||
.set(VIFRange::Volume)
|
||||
);
|
||||
|
||||
addStringFieldWithExtractor(
|
||||
"last_year_date",
|
||||
"Last day previous year when total energy consumption was recorded.",
|
||||
DEFAULT_PRINT_PROPERTIES,
|
||||
FieldMatcher::build()
|
||||
.set(MeasurementType::Instantaneous)
|
||||
.set(StorageNr(1))
|
||||
.set(VIFRange::Date)
|
||||
);
|
||||
|
||||
addNumericFieldWithExtractor(
|
||||
"last_year_energy_consumption",
|
||||
"The total energy consumption recorded at the last day of the previous year.",
|
||||
DEFAULT_PRINT_PROPERTIES,
|
||||
Quantity::Energy,
|
||||
VifScaling::Auto, DifSignedness::Signed,
|
||||
FieldMatcher::build()
|
||||
.set(MeasurementType::Instantaneous)
|
||||
.set(StorageNr(1))
|
||||
.set(VIFRange::AnyEnergyVIF)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Test: Heat itronheat 23340485 NOKEY
|
||||
// Comment: Allmess UltraMaXX with ITRON EquaScan hMIU RF Module
|
||||
// telegram=|444497268504342300047AD00030A52F2F_04062C0100000C1429270000066D2D130AE12B007406FEFEFEFE426C1F010D7FEB0E00000006040C995500372F2F0C7951622223|
|
||||
// {"id":"23340485","media":"heat","meter":"itronheat","meter_datetime":"2023-11-01 10:19:45","name":"Heat","status":"OK","timestamp":"1111-11-11T11:11:11Z","total_energy_consumption_kwh":300,"total_volume_m3":27.29,"last_year_date":"2000-01-31"}
|
||||
// |Heat;23340485;OK;300;27.29;1111-11-11 11:11.11
|
||||
|
||||
// Test: Heat_lower_case itronheat 11755757 NOKEY
|
||||
// Comment: Itron Heatmeter with strange MFCT iTW instead of ITW
|
||||
// telegram=|_404497A65757751100047A040000A00406494C0000041348318000066D2B0ED7EE2A0044069A360000426CDF2C0D7FEB0700000006040C5C7E034E0C7942502321|
|
||||
// {"id":"11755757","media":"heat","meter":"itronheat","meter_datetime":"2023-10-14 23:14:43","name":"Heat_lower_case","status":"OK","timestamp":"1111-11-11T11:11:11Z","total_energy_consumption_kwh":19529,"total_volume_m3":8401.224,"last_year_date":"2022-12-31","last_year_energy_consumption_kwh": 13978}
|
||||
// |Heat_lower_case;11755757;OK;19529;8401.224;1111-11-11 11:11.11
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright (C) 2018-2022 Fredrik Öhrström (gpl-3.0-or-later)
|
||||
Copyright (C) 2018-2024 Fredrik Öhrström (gpl-3.0-or-later)
|
||||
Copyright (C) 2020 Eric Bus (gpl-3.0-or-later)
|
||||
Copyright (C) 2022 thecem (gpl-3.0-or-later)
|
||||
|
||||
|
@ -354,3 +354,8 @@ namespace
|
|||
// telegram=|68c9c96808e672323232322d2c35041900000004fB006083000004ff074006010004ff08299400000416984e010084401400000000848040140000000004225043000034221c0000000259c91f025d4f1102617a0e042e30020000142e65030000043c24050000143ce308000004ff2200000000046d2e2B0f3144fB00007d000044ff07Bdf9000044ff08308d00004416B73f0100c4401400000000c480401400000000542ed9020000543ce8090000426c013102ff1a011B0c783032858404ff16e5841e0004ff17c1d5B400a516|
|
||||
// {"fabrication_no": "84853230", "flow_return_temperature_difference_c": 37.06, "forward_energy_m3c": 67136, "id": "32323232", "max_flow_m3h": 22.75, "max_power_kw": 869, "media": "heat", "meter": "kamheat", "meter_datetime": "2024-01-15 11:46", "name": "Kamstrup_MC603_mbus", "on_time_at_error_h": 28, "on_time_h": 17232, "power_kw": 560, "return_energy_m3c": 37929, "status": "OK", "t1_temperature_c": 81.37, "t2_temperature_c": 44.31, "target_date": "2024-01-01", "target_energy_kwh": 3200000, "target_volume_m3": 81847, "timestamp": "1111-11-11T11:11:11Z", "total_energy_consumption_kwh": 3363200, "total_volume_m3": 85656, "volume_flow_m3h": 13.16}
|
||||
// |Kamstrup_MC603_mbus;32323232;3363200;85656;OK;1111-11-11 11:11.11
|
||||
|
||||
// Test: KMHEAT kamheat 85412440 NOKEY
|
||||
// telegram=|5e442d2c4024418535047ae10050252f2f04fB091300000004167500000004ff2200000000043ca301000002599c1d025dB00e844014000000008480401400000000042eB9000000026c0534426c013444fB0900000000543c000000002f2f|
|
||||
// {"id": "85412440","media": "heat","meter": "kamheat","meter_date": "2024-04-05","name": "KMHEAT","power_kw": 185,"status": "OK","t1_temperature_c": 75.8,"t2_temperature_c": 37.6,"target_date": "2024-04-01","target_energy_kwh": 0,"timestamp": "1111-11-11T11:11:11Z","total_energy_consumption_kwh": 5277.777778,"total_volume_m3": 117,"volume_flow_m3h": 4.19}
|
||||
// |KMHEAT;85412440;5277.777778;117;OK;1111-11-11 11:11.11
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright (C) 2021-2022 Fredrik Öhrström (gpl-3.0-or-later)
|
||||
Copyright (C) 2021-2024 Fredrik Öhrström (gpl-3.0-or-later)
|
||||
|
||||
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
|
||||
|
@ -34,6 +34,7 @@ namespace
|
|||
di.addDetection(MANUFACTURER_LSE, 0x07, 0x18);
|
||||
di.addDetection(MANUFACTURER_LSE, 0x07, 0x16);
|
||||
di.addDetection(MANUFACTURER_LSE, 0x07, 0x17);
|
||||
di.addDetection(MANUFACTURER_LSE, 0x07, 0xd8);
|
||||
di.setConstructor([](MeterInfo& mi, DriverInfo& di){ return shared_ptr<Meter>(new Driver(mi, di)); });
|
||||
});
|
||||
|
||||
|
@ -207,3 +208,8 @@ namespace
|
|||
// telegram=|2D4465329933961318067ADA000000_0C13567100004C1300000000426CFFFF02BB560000326CFFFF046D2307A12C|
|
||||
// {"media":"warm water","meter":"lse_07_17","name":"Water","id":"13963399","total_m3":7.156,"due_date_m3":0,"due_date":"2127-15-31","what_date_m3":7,"what_date":"2021-11-30","error_code":"OK","error_date":"2127-15-31","device_date_time":"2021-12-01 07:35","meter_version":"11","timestamp":"1111-11-11T11:11:11Z"}
|
||||
// |Water;13963399;7.156;0;2127-15-31;OK;2127-15-31;2021-12-01 07:35;1111-11-11 11:11.11
|
||||
|
||||
// Test: Water2 lse_07_17 09993623 NOKEY
|
||||
// telegram=|2d44653223369909d8077a80000000046d130aed2B0c13233332004c1351762700426cdf2c326cffff02BB560000|
|
||||
// {"device_date_time": "2023-11-13 10:19","due_date": "2022-12-31","due_date_m3": 277.651,"error_code": "OK","error_date": "2127-15-31","id": "09993623","media": "water","meter": "lse_07_17","name": "Water2","timestamp": "1111-11-11T11:11:11Z","total_m3": 323.323}
|
||||
// |Water2;09993623;323.323;277.651;2022-12-31;OK;2127-15-31;2023-11-13 10:19;1111-11-11 11:11.11
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright (C) 2018-2022 Fredrik Öhrström (gpl-3.0-or-later)
|
||||
Copyright (C) 2018-2024 Fredrik Öhrström (gpl-3.0-or-later)
|
||||
|
||||
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
|
||||
|
@ -135,7 +135,8 @@ bool isInsideVIFRange(Vif vif, VIFRange vif_range)
|
|||
return
|
||||
isInsideVIFRange(vif, VIFRange::EnergyWh) ||
|
||||
isInsideVIFRange(vif, VIFRange::EnergyMJ) ||
|
||||
isInsideVIFRange(vif, VIFRange::EnergyMWh);
|
||||
isInsideVIFRange(vif, VIFRange::EnergyMWh) ||
|
||||
isInsideVIFRange(vif, VIFRange::EnergyGJ);
|
||||
}
|
||||
if (vif_range == VIFRange::AnyPowerVIF)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright (C) 2018-2022 Fredrik Öhrström (gpl-3.0-or-later)
|
||||
Copyright (C) 2018-2024 Fredrik Öhrström (gpl-3.0-or-later)
|
||||
|
||||
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
|
||||
|
@ -48,6 +48,7 @@
|
|||
X(FabricationNo,0x78,0x78, Quantity::Text, Unit::TXT) \
|
||||
X(EnhancedIdentification,0x79,0x79, Quantity::Text, Unit::TXT) \
|
||||
X(EnergyMWh,0x7B00,0x7B01, Quantity::Energy, Unit::KWH) \
|
||||
X(EnergyGJ,0x7B09,0x7B0A, Quantity::Energy, Unit::MJ) \
|
||||
X(RelativeHumidity,0x7B1A,0x7B1B, Quantity::RH, Unit::RH) \
|
||||
X(AccessNumber,0x7D08,0x7D08, Quantity::Counter, Unit::COUNTER) \
|
||||
X(Medium,0x7D09,0x7D09, Quantity::Text, Unit::TXT) \
|
||||
|
|
|
@ -112,7 +112,9 @@ bool DriverInfo::detect(uint16_t mfct, uchar type, uchar version)
|
|||
for (auto &dd : detect_)
|
||||
{
|
||||
if (dd.mfct == 0 && dd.type == 0 && dd.version == 0) continue; // Ignore drivers with no detection.
|
||||
if (dd.mfct == mfct && dd.type == type && dd.version == version) return true;
|
||||
//some meters send mfct where the first character ist lower case, which results in mfct which are bigger
|
||||
//than 32767, therefore restrict mfct to correct range
|
||||
if (dd.mfct == (mfct & 0x7fff) && dd.type == type && dd.version == version) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright (C) 2017-2023 Fredrik Öhrström (gpl-3.0-or-later)
|
||||
Copyright (C) 2017-2024 Fredrik Öhrström (gpl-3.0-or-later)
|
||||
|
||||
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
|
||||
|
@ -2818,6 +2818,12 @@ double vifScale(int vif)
|
|||
case 0x7b00:
|
||||
case 0x7b01: { double exp = (vif & 0x1)+2; return pow(10.0, -exp); }
|
||||
|
||||
// Active energy 0.1 or 1 GJ normalize to 100 MJ or 1000 MJ
|
||||
// 7b09 19 -> 1.9 G -> 1 900 KWh
|
||||
// 7b0A 19 -> 19 GJ -> 19 000 MJ
|
||||
case 0x7b09:
|
||||
case 0x7b0A: { double exp = (vif & 0x1)+2; return pow(10.0, -exp); }
|
||||
|
||||
// relative humidity is a dimensionless value.
|
||||
case 0x7b1a: return 10.0; // Relative humidity 0.1 %
|
||||
case 0x7b1b: return 1.0; // Relative humidity 1 %
|
||||
|
|
|
@ -331,6 +331,7 @@ FrameStatus WMBusCUL::checkCULFrame(vector<uchar> &data,
|
|||
string s = safeString(hex_buffer);
|
||||
debug("(cul) bad hex for LQI and RSSI \"%s\"\n", s.c_str());
|
||||
warning("(cul) warning: the LQI and RSSI hex string is not properly formatted!\n");
|
||||
return ErrorInFrame;
|
||||
}
|
||||
// LQI is 7 bits unsigned number and relative - range 0-127 lower is better
|
||||
uint lqi = lqi_rssi[0]>>1;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright (C) 2018-2020 Fredrik Öhrström (gpl-3.0-or-later)
|
||||
Copyright (C) 2018-2024 Fredrik Öhrström (gpl-3.0-or-later)
|
||||
|
||||
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
|
||||
|
@ -39,7 +39,10 @@ bool decrypt_ELL_AES_CTR(Telegram *t, vector<uchar> &frame, vector<uchar>::itera
|
|||
// A-field
|
||||
for (int j=0; j<6; ++j) { iv[i++] = t->dll_a[j]; }
|
||||
// CC-field
|
||||
iv[i++] = t->ell_cc;
|
||||
// Two bits should be zeroed out:
|
||||
// 0x10 H-field Hop-count set when telegram is repeated
|
||||
// 0x02 R-field Repeated access field
|
||||
iv[i++] = t->ell_cc & ~(0x10) & ~(0x02);
|
||||
// SN-field
|
||||
for (int j=0; j<4; ++j) { iv[i++] = t->ell_sn_b[j]; }
|
||||
// FN
|
||||
|
|
|
@ -447,6 +447,7 @@ ActualityDuration
|
|||
FabricationNo
|
||||
EnhancedIdentification
|
||||
EnergyMWh
|
||||
EnergyGJ
|
||||
RelativeHumidity
|
||||
AccessNumber
|
||||
Medium
|
||||
|
|
Ładowanie…
Reference in New Issue