Fix bug where some Joule difvif entries were not found. Improve qheat driver.

pull/651/head
Fredrik Öhrström 2022-10-24 15:01:09 +02:00
rodzic 3691bbde04
commit e684eeb438
2 zmienionych plików z 48 dodań i 3 usunięć

Wyświetl plik

@ -27,15 +27,54 @@ namespace
static bool ok = registerDriver([](DriverInfo&di)
{
di.setName("qheat");
di.setDefaultFields("name,id,total_energy_consumption_kwh,last_month_date,last_month_energy_consumption_kwh,timestamp");
di.setMeterType(MeterType::HeatMeter);
di.addLinkMode(LinkMode::C1);
di.addDetection(MANUFACTURER_QDS, 0x04, 0x23);
di.addDetection(MANUFACTURER_QDS, 0x04, 0x46);
// MANUFACTURER_QDS, 0x37, 0x23 waiting for telegram for test-suite.
di.setConstructor([](MeterInfo& mi, DriverInfo& di){ return shared_ptr<Meter>(new Driver(mi, di)); });
});
Driver::Driver(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementation(mi, di)
{
addStringFieldWithExtractorAndLookup(
"status",
"Meter status.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS,
FieldMatcher::build()
.set(MeasurementType::Instantaneous)
.set(VIFRange::ErrorFlags),
{
{
{
"ERROR_FLAGS",
Translate::Type::BitToString,
0xffff,
"OK",
{
// !!! Uncertain !!!
// The documentation links to some intranet site, Qundis Error Codes Specification v1.7
// at https://base/svn/sys/Meter/Gen/G5-5/PUBL/Gen55_SysSpec_Error-Codes_EN_v1.6_any.pdf
// Here is a table that might apply:
// https://www.manualslib.com/manual/2046543/Qundis-Q-Heat-5-5-Us.html?page=5
{ 0x01, "NO_FLOW" }, // F0
{ 0x02, "SUPPLY_SENSOR_INTERRUPTED" }, // F1
{ 0x04, "RETURN_SENSOR_INTERRUPTED" }, // F2
{ 0x08, "TEMPERATURE_ELECTRONICS_ERROR" }, // F3
{ 0x10, "BATTERY_VOLTAGE_ERROR" }, // F4
{ 0x20, "SHORT_CIRCUIT_SUPPLY_SENSOR" }, // F5
{ 0x40, "SHORT_CIRCUIT_RETURN_SENSOR" }, // F6
{ 0x80, "MEMORY_ERROR" }, // F7
{ 0x100, "SABOTAGE" }, // F8 - F1,2,3,5,6 longer than 8 hours, latching error, no more measurements performed.
{ 0x200, "ELECTRONICS_ERROR" }, // F9
}
},
},
});
addNumericFieldWithExtractor(
"total_energy_consumption",
"The total energy consumption recorded by this meter.",
@ -113,5 +152,11 @@ namespace
// Test: QHeato qheat 67228058 NOKEY
// telegram=|3C449344957002372337725880226793442304DC0000200C05043900004C0500000000426C9F2CCC080551070000C2086CBE29326CFFFF046D280DB62A|
// {"media":"heat","meter":"qheat","name":"QHeato","id":"67228058","total_energy_consumption_kwh":390.4,"last_month_date":"2021-09-30","last_month_energy_consumption_kwh":75.1,"last_year_date":"2020-12-31","last_year_energy_consumption_kwh":0,"device_date_time":"2021-10-22 13:40","device_error_date":"2127-15-31","timestamp":"1111-11-11T11:11:11Z"}
// |QHeato;67228058;390.400000;2021-09-30;75.100000;1111-11-11 11:11.11
// {"media":"heat","meter":"qheat","name":"QHeato","id":"67228058","status":"OK","total_energy_consumption_kwh":390.4,"last_month_date":"2021-09-30","last_month_energy_consumption_kwh":75.1,"last_year_date":"2020-12-31","last_year_energy_consumption_kwh":0,"device_date_time":"2021-10-22 13:40","device_error_date":"2127-15-31","timestamp":"1111-11-11T11:11:11Z"}
// |QHeato;67228058;390.4;2021-09-30;75.1;1111-11-11 11:11.11
// Test: Qheatoo qheat 67506579 NOKEY
// telegram=|41449344796550674637727965506793444604dc0000200c0d000000004c0d00000000426cffffcc080d00000000c2086cdf2802fd170000326cffff046d3a0ddb29|
// {"media":"heat","meter":"qheat","name":"Qheatoo","id":"67506579","status":"OK","total_energy_consumption_kwh":0,"last_month_date":"2022-08-31","last_month_energy_consumption_kwh":0,"last_year_date":"2127-15-31","last_year_energy_consumption_kwh":0,"device_date_time":"2022-09-27 13:58","device_error_date":"2127-15-31","timestamp":"1111-11-11T11:11:11Z"}
// |Qheatoo;67506579;0;2022-08-31;0;1111-11-11 11:11.11

Wyświetl plik

@ -41,7 +41,7 @@
X(HeatCostAllocation,0x6E,0x6E, Quantity::HCA, Unit::HCA) \
X(Date,0x6C,0x6C, Quantity::PointInTime, Unit::DateTimeLT) \
X(DateTime,0x6D,0x6D, Quantity::PointInTime, Unit::DateTimeLT) \
X(EnergyMJ,0x0E,0x0F, Quantity::Energy, Unit::MJ) \
X(EnergyMJ,0x08,0x0F, Quantity::Energy, Unit::MJ) \
X(EnergyWh,0x00,0x07, Quantity::Energy, Unit::KWH) \
X(PowerW,0x28,0x2f, Quantity::Power, Unit::KW) \
X(ActualityDuration,0x74,0x77, Quantity::Time, Unit::Hour) \