From 250dfea887cadf22f65fa7feba69e298f4041f6d Mon Sep 17 00:00:00 2001 From: supaklass Date: Thu, 16 Feb 2023 22:23:07 +0100 Subject: [PATCH 1/2] Sensostar storageNr fix The sensostar heatmeter has 30 storage positions for storing energy consuption values. Every semi-month a new value is written to the storageNr 2 and the following values are pushed down one position. This applies even when the meter in configured for monthly storage. In this case the telegrams contain values from every second storage position, these are (in the first half of the month) storageNr 2, 4, 6, etc. and in the second half storageNr 3, 4, 5, etc. This fix corrects the storageNr handling in the sensostar driver. --- src/driver_sensostar.cc | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/src/driver_sensostar.cc b/src/driver_sensostar.cc index 0b4b829..8e23ef5 100644 --- a/src/driver_sensostar.cc +++ b/src/driver_sensostar.cc @@ -195,11 +195,11 @@ namespace .set(StorageNr(1)) ); - for (int i=1; i<=15; ++i) + for (int i=1; i<=30; ++i) { string name, info; - strprintf(&name, "consumption_%d_months_ago", i); - strprintf(&info, "Energy consumption %d month(s) ago.", i); + strprintf(&name, "enegry_consumption_semi_monthly_%02d", i); + strprintf(&info, "Energy consumption at semi-monthly position %02d.", i); addNumericFieldWithExtractor( name, info, @@ -209,19 +209,29 @@ namespace FieldMatcher::build() .set(MeasurementType::Instantaneous) .set(VIFRange::AnyEnergyVIF) - .set(StorageNr(i))); + .set(StorageNr(i+1))); } } } // Test: Heat sensostar 20480057 NOKEY // Comment: -// telegram=|68B3B36808007257004820c51400046c100000047839803801040600000000041300000000042B00000000142B00000000043B00000000143B00000000025B1400025f15000261daff02235c00046d2c2ddc24440600000000441300000000426c000001fd171003fd0c05000084200600000000c420060000000084300600000000c430060000000084401300000000c44013000000008480401300000000c48040130000000084c0401300000000c4c0401300000000a216| -// {"media":"heat","meter":"sensostar","name":"Heat","id":"20480057","meter_timestamp":"2022-04-28 13:44","total_kwh":0,"power_kw":0,"power_max_kw":0,"flow_water_m3h":0,"flow_water_max_m3h":0,"forward_c":20,"return_c":21,"difference_c":-0.38,"total_water_m3":0,"current_status":"ERROR_FLOW_MEASUREMENT_SYSTEM_ERROR","reporting_date":"2000-00-00","energy_consumption_at_reporting_date_kwh":0,"consumption_1_months_ago_kwh":0,"timestamp":"1111-11-11T11:11:11Z"} +// telegram=|68B3B36808007257004820c51400046c100000047839803801040600000000041300000000042B00000000142B00000000043B00000000143B00000000025B1400025f15000261daff0> +// {"media":"heat","meter":"sensostar","name":"Heat","id":"20480057","meter_timestamp":"2022-04-28 13:44","total_kwh":0,"power_kw":0,"power_max_kw":0,"flow_wate> // |Heat;20480057;0;0;ERROR_FLOW_MEASUREMENT_SYSTEM_ERROR;2000-00-00;0;1111-11-11 11:11.11 // Test: WMZ sensostar 02752560 NOKEY // Comment: from "Sensostar U" -//telegram=a444c5146025750200047ac20000202f2f046d2e26c62a040643160000041310f0050001fd1700426cbf2c4406570e00008401061f160000840206f6150000840306f5150000840406f3150000840506ea150000840606bf1500008407065214000084080692120000840906c5100000840a06570e0000840b06ca0b0000840c06da090000840d06ca080000840e06c8080000840f06c608000003fd0c05010002fd0b2111 -//{"media":"heat","meter":"sensostar","name":"WMZ","id":"02752560","meter_timestamp":"2022-10-06 06:46","total_kwh":5699,"total_water_m3":389.136,"current_status":"OK","reporting_date":"2021-12-31","energy_consumption_at_reporting_date_kwh":3671,"consumption_1_months_ago_kwh":5663,"consumption_2_months_ago_kwh":5622,"consumption_3_months_ago_kwh":5621,"consumption_4_months_ago_kwh":5619,"consumption_5_months_ago_kwh":5610,"consumption_6_months_ago_kwh":5567,"consumption_7_months_ago_kwh":5202,"consumption_8_months_ago_kwh":4754,"consumption_9_months_ago_kwh":4293,"consumption_10_months_ago_kwh":3671,"consumption_11_months_ago_kwh":3018,"consumption_12_months_ago_kwh":2522,"consumption_13_months_ago_kwh":2250,"consumption_14_months_ago_kwh":2248,"consumption_15_months_ago_kwh":2246,"timestamp":"1111-11-11 11:11.11"} -//WMZ;02752560;5699;389.136000;OK;1111-11-11 11:11.11 +// telegram=a444c5146025750200047ac20000202f2f046d2e26c62a040643160000041310f0050001fd1700426cbf2c4406570e00008401061f160000840206f6150000840306f5150000840406f31> +// {"media":"heat","meter":"sensostar","name":"WMZ","id":"02752560","meter_timestamp":"2022-10-06 06:46","total_kwh":5699,"total_water_m3":389.136,"current_statu> +// WMZ;02752560;5699;389.136000;OK;1111-11-11 11:11.11 + +// Test: FBH1OG sensostar 24659380 NOKEY +// Comment: Engelmann Sensostar U, Monthly storage, logging in first semi-month +// Telegram: |BE44C5148093652400048C20BF900F002C25E51E0000AB9F24F74DB68ACA7ABF009007102F2F_046D152CEF220406970200000413FAC6000001FD1700426CDF2C44060000000084010> +// {"media":"heat","meter":"sensostar","name":"FBH1OG","id":"24659380","meter_timestamp":"2023-02-15 12:21","total_kwh":663,"total_water_m3":50.938,"current_sta> + +// Test: FBH1OG sensostar 24659380 NOKEY +// Comment: Engelmann Sensostar U, Monthly storage, logging in second semi-month +// Telegram: |BE44C5148093652400048C201E900F002C25612000002D7355D0545637677A1E009007102F2F_046D022DF0220406AA02000004134CCA000001FD1700426CDF2C440600000000C4010> +// {"media":"heat","meter":"sensostar","name":"FBH1OG","id":"24659380","meter_timestamp":"2023-02-16 13:02","total_kwh":682,"total_water_m3":51.788,"current_sta> From 02831dced64ae7fe3c199f067faf2c3387c47e3c Mon Sep 17 00:00:00 2001 From: BIBO <49994376+BIBOLV@users.noreply.github.com> Date: Sun, 2 Apr 2023 00:16:13 +0300 Subject: [PATCH 2/2] Update driver_sensostar.cc --- src/driver_sensostar.cc | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/driver_sensostar.cc b/src/driver_sensostar.cc index 8e23ef5..91d818b 100644 --- a/src/driver_sensostar.cc +++ b/src/driver_sensostar.cc @@ -216,22 +216,12 @@ namespace // Test: Heat sensostar 20480057 NOKEY // Comment: -// telegram=|68B3B36808007257004820c51400046c100000047839803801040600000000041300000000042B00000000142B00000000043B00000000143B00000000025B1400025f15000261daff0> -// {"media":"heat","meter":"sensostar","name":"Heat","id":"20480057","meter_timestamp":"2022-04-28 13:44","total_kwh":0,"power_kw":0,"power_max_kw":0,"flow_wate> +// telegram=|68B3B36808007257004820c51400046c100000047839803801040600000000041300000000042B00000000142B00000000043B00000000143B00000000025B1400025f15000261daff02235c00046d2c2ddc24440600000000441300000000426c000001fd171003fd0c05000084200600000000c420060000000084300600000000c430060000000084401300000000c44013000000008480401300000000c48040130000000084c0401300000000c4c0401300000000a216| +// {"media":"heat","meter":"sensostar","name":"Heat","id":"20480057","meter_timestamp":"2022-04-28 13:44","total_kwh":0,"power_kw":0,"power_max_kw":0,"flow_water_m3h":0,"flow_water_max_m3h":0,"forward_c":20,"return_c":21,"difference_c":-0.38,"total_water_m3":0,"current_status":"ERROR_FLOW_MEASUREMENT_SYSTEM_ERROR","reporting_date":"2000-00-00","energy_consumption_at_reporting_date_kwh":0,"timestamp":"1111-11-11T11:11:11Z"} // |Heat;20480057;0;0;ERROR_FLOW_MEASUREMENT_SYSTEM_ERROR;2000-00-00;0;1111-11-11 11:11.11 // Test: WMZ sensostar 02752560 NOKEY // Comment: from "Sensostar U" -// telegram=a444c5146025750200047ac20000202f2f046d2e26c62a040643160000041310f0050001fd1700426cbf2c4406570e00008401061f160000840206f6150000840306f5150000840406f31> -// {"media":"heat","meter":"sensostar","name":"WMZ","id":"02752560","meter_timestamp":"2022-10-06 06:46","total_kwh":5699,"total_water_m3":389.136,"current_statu> -// WMZ;02752560;5699;389.136000;OK;1111-11-11 11:11.11 - -// Test: FBH1OG sensostar 24659380 NOKEY -// Comment: Engelmann Sensostar U, Monthly storage, logging in first semi-month -// Telegram: |BE44C5148093652400048C20BF900F002C25E51E0000AB9F24F74DB68ACA7ABF009007102F2F_046D152CEF220406970200000413FAC6000001FD1700426CDF2C44060000000084010> -// {"media":"heat","meter":"sensostar","name":"FBH1OG","id":"24659380","meter_timestamp":"2023-02-15 12:21","total_kwh":663,"total_water_m3":50.938,"current_sta> - -// Test: FBH1OG sensostar 24659380 NOKEY -// Comment: Engelmann Sensostar U, Monthly storage, logging in second semi-month -// Telegram: |BE44C5148093652400048C201E900F002C25612000002D7355D0545637677A1E009007102F2F_046D022DF0220406AA02000004134CCA000001FD1700426CDF2C440600000000C4010> -// {"media":"heat","meter":"sensostar","name":"FBH1OG","id":"24659380","meter_timestamp":"2023-02-16 13:02","total_kwh":682,"total_water_m3":51.788,"current_sta> +// telegram=|a444c5146025750200047ac20000202f2f046d2e26c62a040643160000041310f0050001fd1700426cbf2c4406570e00008401061f160000840206f6150000840306f5150000840406f3150000840506ea150000840606bf1500008407065214000084080692120000840906c5100000840a06570e0000840b06ca0b0000840c06da090000840d06ca080000840e06c8080000840f06c608000003fd0c05010002fd0b2111| +// {"media":"heat","meter":"sensostar","name":"WMZ","id":"02752560","meter_timestamp":"2022-10-06 06:46","total_kwh":5699,"total_water_m3":389.136,"current_status":"OK","reporting_date":"2021-12-31","energy_consumption_at_reporting_date_kwh":3671,"enegry_consumption_semi_monthly_01_kwh":5663,"enegry_consumption_semi_monthly_03_kwh":5622,"enegry_consumption_semi_monthly_05_kwh":5621,"enegry_consumption_semi_monthly_07_kwh":5619,"enegry_consumption_semi_monthly_09_kwh":5610,"enegry_consumption_semi_monthly_11_kwh":5567,"enegry_consumption_semi_monthly_13_kwh":5202,"enegry_consumption_semi_monthly_15_kwh":4754,"enegry_consumption_semi_monthly_17_kwh":4293,"enegry_consumption_semi_monthly_19_kwh":3671,"enegry_consumption_semi_monthly_21_kwh":3018,"enegry_consumption_semi_monthly_23_kwh":2522,"enegry_consumption_semi_monthly_25_kwh":2250,"enegry_consumption_semi_monthly_27_kwh":2248,"enegry_consumption_semi_monthly_29_kwh":2246,"timestamp":"1111-11-11T11:11:11Z"} +// |WMZ;02752560;5699;389.136;OK;2021-12-31;3671;1111-11-11 11:11.11