From 9b1a138f8e36f553a1326714d0bc1802c1bcb8b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20=C3=96hrstr=C3=B6m?= Date: Tue, 18 Apr 2023 11:17:41 +0200 Subject: [PATCH] Add more fields to sharky driver. --- src/driver_sharky.cc | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/driver_sharky.cc b/src/driver_sharky.cc index 8305380..24c63bb 100644 --- a/src/driver_sharky.cc +++ b/src/driver_sharky.cc @@ -41,6 +41,8 @@ namespace Driver::Driver(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementation(mi, di) { + addOptionalCommonFields("operating_time_h"); + addStringFieldWithExtractorAndLookup( "status", "Status of meter.", @@ -154,6 +156,42 @@ namespace .set(MeasurementType::Instantaneous) .set(VIFRange::TemperatureDifference) ); + + addNumericFieldWithExtractor( + "target_energy_consumption", + "The total heat energy consumption recorded by this meter at the end of the previous billing period.", + DEFAULT_PRINT_PROPERTIES, + Quantity::Energy, + VifScaling::Auto, + FieldMatcher::build() + .set(MeasurementType::Instantaneous) + .set(VIFRange::AnyEnergyVIF) + .set(StorageNr(5)) + ); + + addNumericFieldWithExtractor( + "target_volume", + "The total heating media volume recorded by this meter at the end of the previous billing period.", + DEFAULT_PRINT_PROPERTIES, + Quantity::Volume, + VifScaling::Auto, + FieldMatcher::build() + .set(MeasurementType::Instantaneous) + .set(VIFRange::Volume) + .set(StorageNr(5)) + ); + + addNumericFieldWithExtractor( + "target", + "The last billing period end date.", + DEFAULT_PRINT_PROPERTIES, + Quantity::PointInTime, + VifScaling::Auto, + FieldMatcher::build() + .set(MeasurementType::Instantaneous) + .set(VIFRange::Date) + .set(StorageNr(5)), + Unit::DateLT); } } @@ -166,3 +204,8 @@ namespace // telegram=|5e44a5115376916140047a0B0050052f2f0c0e829311008c100e000000000c14014938000c2B751400000B3B2902000a5a52070a5e95060a6256000a279015cc020e92831100cc021478113800c2026cdf2c2f2f2f2f2f2f2f2f2f2f2f2f2f| // {"flow_temperature_c": 42.3,"id": "68926025","media": "heat","meter": "sharky","name": "Heat","power_kw": 0,"return_temperature_c": 28.1,"status": "OK","temperature_difference_c": 14.1,"timestamp": "1111-11-11T11:11:11Z","total_energy_consumption_kwh": 2651,"total_energy_consumption_tariff1_kwh": 0,"total_volume_m3": 150.347,"total_volume_tariff2_m3": 0.018,"volume_flow_m3h": 0} // |Heat;68926025;2651;0;150.347;0.018;0;0;42.3;28.1;14.1;1111-11-11 11:11.11 + +// Test: Heato sharky 69696969 NOKEY +// telegram=|5e44a5116969696940047aBe0050052f2f0c06975100008c1006000000000c13849345000c2B000000000B3B0000000a5a06020a5e08020a6202f00B26110201cc020623500000cc021329554400c2026cdf2c2f2f2f2f2f2f2f2f2f2f2f2f| +// {"flow_temperature_c": 20.6,"id": "69696969","media": "heat","meter": "sharky","name": "Heato","operating_time_h": 10211,"power_kw": 0,"return_temperature_c": 20.8,"target_date": "2022-12-31","target_energy_consumption_kwh": 5023,"target_volume_m3": 445.529,"temperature_difference_c": -0.2,"timestamp": "1111-11-11T11:11:11Z","total_energy_consumption_kwh": 5197,"total_energy_consumption_tariff1_kwh": 0,"total_volume_m3": 459.384, "volume_flow_m3h": 0} +// |Heato;69696969;5197;0;459.384;null;0;0;20.6;20.8;-0.2;1111-11-11 11:11.11