All fields are by default OPTIONAL. Remove other unnecessary PrintProperty fields.

pull/783/head
Fredrik Öhrström 2023-01-01 20:51:20 +01:00
rodzic c6bf8a114e
commit d7d1cda149
88 zmienionych plików z 802 dodań i 854 usunięć

Wyświetl plik

@ -11,6 +11,8 @@ ATTENTION! The sharky774 driver had a bug that triggered when the meter used Jou
Also the calculated temperature difference had to be removed. You can re-add the temperature difference Also the calculated temperature difference had to be removed. You can re-add the temperature difference
by using --calculate_temperature_difference_c=flow_temperature_c-return_temperature_c by using --calculate_temperature_difference_c=flow_temperature_c-return_temperature_c
ATTENTION! The third hydrus driver field has changed from max_flow_m3h to total_at_date_m3.
Since a field disappeared the default fields were disrupted and a shorter list of fields Since a field disappeared the default fields were disrupted and a shorter list of fields
have now been picked for the default fields. Please use --selectedfields=... to recreate have now been picked for the default fields. Please use --selectedfields=... to recreate
your previous fields. your previous fields.

Wyświetl plik

@ -10,9 +10,9 @@ telegram=|23442D2C998734761B168D2087D19EAD217F1779EDA86AB6_710008190000081900007
# Tets Multical21 C1 telegrams with maximum flow configuration # Tets Multical21 C1 telegrams with maximum flow configuration
telegram=|2D442D2C776655441B168D2083B48D3A20_46887802FF20000004132F4E000092013B3D01A1015B028101E7FF0F03| telegram=|2D442D2C776655441B168D2083B48D3A20_46887802FF20000004132F4E000092013B3D01A1015B028101E7FF0F03|
{"media":"cold water","meter":"multical21","name":"Vadden","id":"44556677","status":"OK","total_m3":20.015,"target_m3":null,"flow_temperature_c":2,"external_temperature_c":3,"max_flow_m3h":0.317,"current_status":"","time_dry":"","time_reversed":"","time_leaking":"","time_bursting":"","timestamp":"1111-11-11T11:11:11Z"} {"media":"cold water","meter":"multical21","name":"Vadden","id":"44556677","status":"OK","total_m3":20.015,"flow_temperature_c":2,"external_temperature_c":3,"max_flow_m3h":0.317,"current_status":"","time_dry":"","time_reversed":"","time_leaking":"","time_bursting":"","timestamp":"1111-11-11T11:11:11Z"}
telegram=|21442D2C776655441B168D2079CC8C3A20_F4307912C40DFF00002F4E00003D010203| telegram=|21442D2C776655441B168D2079CC8C3A20_F4307912C40DFF00002F4E00003D010203|
{"media":"cold water","meter":"multical21","name":"Vadden","id":"44556677","status":"OK","total_m3":20.015,"target_m3":null,"flow_temperature_c":2,"external_temperature_c":3,"max_flow_m3h":0.317,"current_status":"","time_dry":"","time_reversed":"","time_leaking":"","time_bursting":"","timestamp":"1111-11-11T11:11:11Z"} {"media":"cold water","meter":"multical21","name":"Vadden","id":"44556677","status":"OK","total_m3":20.015,"flow_temperature_c":2,"external_temperature_c":3,"max_flow_m3h":0.317,"current_status":"","time_dry":"","time_reversed":"","time_leaking":"","time_bursting":"","timestamp":"1111-11-11T11:11:11Z"}
# Test FlowIQ2200 C1 telegrams # Test FlowIQ2200 C1 telegrams
@ -26,7 +26,7 @@ telegram=|314493441234567835087a740000200b6e2701004b6e450100426c5f2ccb086e790000
# Test another pair of QCalric C1 telegrams # Test another pair of QCalric C1 telegrams
telegram=|49449344939291903408780DFF5F350082180000800007B06EFFFF970000009F2C70020000BE26970000000000010018002E001F002E0023FF210008000500020000002F046D220FA227| telegram=|49449344939291903408780DFF5F350082180000800007B06EFFFF970000009F2C70020000BE26970000000000010018002E001F002E0023FF210008000500020000002F046D220FA227|
{"media":"heat cost allocation","meter":"qcaloric","name":"MyElement2","id":"90919293","status":"OK","current_consumption_hca":null,"set_date":null,"consumption_at_set_date_hca":null,"set_date_1":null,"consumption_at_set_date_1_hca":null,"device_date_time":"2021-07-02 15:34","timestamp":"1111-11-11T11:11:11Z"} {"media":"heat cost allocation","meter":"qcaloric","name":"MyElement2","id":"90919293","status":"OK","device_date_time":"2021-07-02 15:34","timestamp":"1111-11-11T11:11:11Z"}
telegram=|314493449392919034087a520000200b6e9700004b6e700200426c9f2ccb086e970000c2086cbe26326cffff046d2d16a227| telegram=|314493449392919034087a520000200b6e9700004b6e700200426c9f2ccb086e970000c2086cbe26326cffff046d2d16a227|
{"media":"heat cost allocation","meter":"qcaloric","name":"MyElement2","id":"90919293","status":"OK","current_consumption_hca":97,"set_date":"2020-12-31","consumption_at_set_date_hca":270,"set_date_1":"2020-12-31","consumption_at_set_date_1_hca":270,"set_date_17":"2021-06-30","consumption_at_set_date_17_hca":97,"error_date":"2127-15-31","device_date_time":"2021-07-02 22:45","timestamp":"1111-11-11T11:11:11Z"} {"media":"heat cost allocation","meter":"qcaloric","name":"MyElement2","id":"90919293","status":"OK","current_consumption_hca":97,"set_date":"2020-12-31","consumption_at_set_date_hca":270,"set_date_1":"2020-12-31","consumption_at_set_date_1_hca":270,"set_date_17":"2021-06-30","consumption_at_set_date_17_hca":97,"error_date":"2127-15-31","device_date_time":"2021-07-02 22:45","timestamp":"1111-11-11T11:11:11Z"}

Wyświetl plik

@ -1,7 +1,7 @@
# Test vario451 T1 telegrams with --calculate_total_gj=total_kwh etc # Test vario451 T1 telegrams with --calculate_total_gj=total_kwh etc
telegram=|374468506549235827C3A2|129F25383300A8622600008200800A2AF862115175552877A36F26C9AB1CB24400000004000000000004908002| telegram=|374468506549235827C3A2_129F25383300A8622600008200800A2AF862115175552877A36F26C9AB1CB24400000004000000000004908002|
{"media":"heat","meter":"vario451","name":"Hettan","id":"58234965","total_kwh":6371.666667,"total_gj":22.938,"current_kwh":2729.444444,"current_gj":9.826,"previous_kwh":3642.222222,"previous_gj":13.112,"timestamp":"1111-11-11T11:11:11Z"} {"media":"heat","meter":"vario451","name":"Hettan","id":"58234965","total_kwh":6371.666667,"total_gj":22.938,"current_kwh":2729.444444,"current_gj":9.826,"previous_kwh":3642.222222,"previous_gj":13.112,"timestamp":"1111-11-11T11:11:11Z"}
# Test Multical21 C1 telegrams with --calculate_total_l=total_m3 etc # Test Multical21 C1 telegrams with --calculate_total_l=total_m3 etc
telegram=|23442D2C998734761B168D2087D19EAD217F1779EDA86AB6|710008190000081900007F13| telegram=|23442D2C998734761B168D2087D19EAD217F1779EDA86AB6_710008190000081900007F13|
{"media":"cold water","meter":"multical21","name":"MyTapWater","id":"76348799","status":"DRY","total_m3":6.408,"total_l":6408,"target_m3":6.408,"target_l":6408,"flow_temperature_c":127,"flow_temperature_f":260.6,"external_temperature_c":19,"external_temperature_f":66.2,"current_status":"DRY","time_dry":"22-31 days","time_reversed":"","time_leaking":"","time_bursting":"","timestamp":"1111-11-11T11:11:11Z"} {"media":"cold water","meter":"multical21","name":"MyTapWater","id":"76348799","status":"DRY","total_m3":6.408,"total_l":6408,"target_m3":6.408,"target_l":6408,"flow_temperature_c":127,"flow_temperature_f":260.6,"external_temperature_c":19,"external_temperature_f":66.2,"current_status":"DRY","time_dry":"22-31 days","time_reversed":"","time_leaking":"","time_bursting":"","timestamp":"1111-11-11T11:11:11Z"}

Wyświetl plik

@ -15,16 +15,16 @@ telegram=|294465324185990401087a0080000082046c7f018b046e210300046d1a0e6f0202fdac
telegram=|2D4465327663341317077AAA0000000C13044001004C1340620000426C9F2C02BB560000326CFFFF046D180DA924| telegram=|2D4465327663341317077AAA0000000C13044001004C1340620000426C9F2C02BB560000326CFFFF046D180DA924|
{"media":"water","meter":"lse_07_17","name":"QW","id":"13346376","total_m3":14.004,"due_date_m3":6.24,"due_date":"2020-12-31","error_code":"OK","error_date":"2127-15-31","device_date_time":"2021-04-09 13:24","timestamp":"1111-11-11T11:11:11Z"} {"media":"water","meter":"lse_07_17","name":"QW","id":"13346376","total_m3":14.004,"due_date_m3":6.24,"due_date":"2020-12-31","error_code":"OK","error_date":"2127-15-31","device_date_time":"2021-04-09 13:24","timestamp":"1111-11-11T11:11:11Z"}
|QW;13346376;14.004000;6.240000;2020-12-31;OK;2127-15-31;2021-04-09 13:24;1111-11-11 11:11.11 |QW;13346376;14.004;6.24;2020-12-31;OK;2127-15-31;2021-04-09 13:24;1111-11-11 11:11.11
# Test another Qundis QWater5.5 meter. # Test another Qundis QWater5.5 meter.
telegram=|2D4465321413121116077A900000000C13565906004C1336400600426C9F2C02BB560000326CFFFF046D3405BA25| telegram=|2D4465321413121116077A900000000C13565906004C1336400600426C9F2C02BB560000326CFFFF046D3405BA25|
{"media":"water","meter":"lse_07_17","name":"QWW","id":"11121314","total_m3":65.956,"due_date_m3":64.036,"due_date":"2020-12-31","error_code":"OK","error_date":"2127-15-31","device_date_time":"2021-05-26 05:52","timestamp":"1111-11-11T11:11:11Z"} {"media":"water","meter":"lse_07_17","name":"QWW","id":"11121314","total_m3":65.956,"due_date_m3":64.036,"due_date":"2020-12-31","error_code":"OK","error_date":"2127-15-31","device_date_time":"2021-05-26 05:52","timestamp":"1111-11-11T11:11:11Z"}
|QWW;11121314;65.956000;64.036000;2020-12-31;OK;2127-15-31;2021-05-26 05:52;1111-11-11 11:11.11 |QWW;11121314;65.956;64.036;2020-12-31;OK;2127-15-31;2021-05-26 05:52;1111-11-11 11:11.11
# Test yet another Qundis QWater5.5 meter. # Test yet another Qundis QWater5.5 meter.
telegram=|2D4465320877411218067A8C0000000C13122100004C1300000000426CFFFF02BB560000326CFFFF046D2104BC2B| telegram=|2D4465320877411218067A8C0000000C13122100004C1300000000426CFFFF02BB560000326CFFFF046D2104BC2B|
{"media":"warm water","meter":"lse_07_17","name":"QWWW","id":"12417708","total_m3":2.112,"due_date_m3":0,"due_date":"2127-15-31","error_code":"OK","error_date":"2127-15-31","device_date_time":"2021-11-28 04:33","timestamp":"1111-11-11T11:11:11Z"} {"media":"warm water","meter":"lse_07_17","name":"QWWW","id":"12417708","total_m3":2.112,"due_date_m3":0,"due_date":"2127-15-31","error_code":"OK","error_date":"2127-15-31","device_date_time":"2021-11-28 04:33","timestamp":"1111-11-11T11:11:11Z"}
|QWWW;12417708;2.112000;0.000000;2127-15-31;OK;2127-15-31;2021-11-28 04:33;1111-11-11 11:11.11 |QWWW;12417708;2.112;0;2127-15-31;OK;2127-15-31;2021-11-28 04:33;1111-11-11 11:11.11

Wyświetl plik

@ -18,24 +18,24 @@ telegram=|AF46EE4D2827282716087A80000000_046D040A9F2A036E000000426CE1F7436E00000
telegram=|1E44AE4C9956341268077A36001000_2F2F0413181E0000023B00002F2F2F2F| telegram=|1E44AE4C9956341268077A36001000_2F2F0413181E0000023B00002F2F2F2F|
{"media":"water","meter":"iperl","name":"MoreWater","id":"12345699","total_m3":7.704,"max_flow_m3h":0,"timestamp":"1111-11-11T11:11:11Z"} {"media":"water","meter":"iperl","name":"MoreWater","id":"12345699","total_m3":7.704,"max_flow_m3h":0,"timestamp":"1111-11-11T11:11:11Z"}
|MoreWater;12345699;7.704000;0.000000;1111-11-11 11:11.11 |MoreWater;12345699;7.704;0;1111-11-11 11:11.11
# Test iPerl T1 telegram not encrypted, no 2f2f markers. # Test iPerl T1 telegram not encrypted, no 2f2f markers.
telegram=|1844AE4C4455223368077A55000000_041389E20100023B0000| telegram=|1844AE4C4455223368077A55000000_041389E20100023B0000|
{"media":"water","meter":"iperl","name":"WaterWater","id":"33225544","total_m3":123.529,"max_flow_m3h":0,"timestamp":"1111-11-11T11:11:11Z"} {"media":"water","meter":"iperl","name":"WaterWater","id":"33225544","total_m3":123.529,"max_flow_m3h":0,"timestamp":"1111-11-11T11:11:11Z"}
|WaterWater;33225544;123.529000;0.000000;1111-11-11 11:11.11 |WaterWater;33225544;123.529;0;1111-11-11 11:11.11
# Test amiplus/apator electricity meter # Test amiplus/apator electricity meter
telegram=|4E4401061010101002027A00004005_2F2F0E035040691500000B2B300300066D00790C7423400C78371204860BABC8FC100000000E833C8074000000000BAB3C0000000AFDC9FC0136022F2F2F2F2F| telegram=|4E4401061010101002027A00004005_2F2F0E035040691500000B2B300300066D00790C7423400C78371204860BABC8FC100000000E833C8074000000000BAB3C0000000AFDC9FC0136022F2F2F2F2F|
{"media":"electricity","meter":"amiplus","name":"MyElectricity1","id":"10101010","total_energy_consumption_kwh":15694.05,"current_power_consumption_kw":0.33,"total_energy_production_kwh":7.48,"current_power_production_kw":0,"voltage_at_phase_1_v":236,"voltage_at_phase_2_v":null,"voltage_at_phase_3_v":null,"device_date_time":"2019-03-20 12:57:00","total_energy_consumption_tariff_1_kwh":null,"total_energy_consumption_tariff_2_kwh":null,"total_energy_consumption_tariff_3_kwh":null,"total_energy_production_tariff_1_kwh":null,"total_energy_production_tariff_2_kwh":null,"total_energy_production_tariff_3_kwh":null,"timestamp":"1111-11-11T11:11:11Z"} {"media":"electricity","meter":"amiplus","name":"MyElectricity1","id":"10101010","total_energy_consumption_kwh":15694.05,"current_power_consumption_kw":0.33,"total_energy_production_kwh":7.48,"current_power_production_kw":0,"voltage_at_phase_1_v":236,"device_date_time":"2019-03-20 12:57:00","timestamp":"1111-11-11T11:11:11Z"}
|MyElectricity1;10101010;15694.05;0.33;7.48;0;236;null;null;null;null;null;null;null;null;1111-11-11 11:11.11 |MyElectricity1;10101010;15694.05;0.33;7.48;0;236;null;null;null;null;null;null;null;null;1111-11-11 11:11.11
# Test amiplus/apator electricity meter with three phase voltages # Test amiplus/apator electricity meter with three phase voltages
telegram=|5E44B6105843250000027A2A005005_2F2F0C7835221400066D404708AC2A400E032022650900000E833C0000000000001B2B9647000B2B5510000BAB3C0000000AFDC9FC0135020AFDC9FC0245020AFDC9FC0339020BABC8FC100000002F2F| telegram=|5E44B6105843250000027A2A005005_2F2F0C7835221400066D404708AC2A400E032022650900000E833C0000000000001B2B9647000B2B5510000BAB3C0000000AFDC9FC0135020AFDC9FC0245020AFDC9FC0339020BABC8FC100000002F2F|
{"media":"electricity","meter":"amiplus","name":"MyElectricity2","id":"00254358","total_energy_consumption_kwh":9652.22,"current_power_consumption_kw":1.055,"total_energy_production_kwh":0,"current_power_production_kw":0,"voltage_at_phase_1_v":235,"voltage_at_phase_2_v":245,"voltage_at_phase_3_v":239,"device_date_time":"2021-10-12 08:07:00","total_energy_consumption_tariff_1_kwh":null,"total_energy_consumption_tariff_2_kwh":null,"total_energy_consumption_tariff_3_kwh":null,"total_energy_production_tariff_1_kwh":null,"total_energy_production_tariff_2_kwh":null,"total_energy_production_tariff_3_kwh":null,"timestamp":"1111-11-11T11:11:11Z"} {"media":"electricity","meter":"amiplus","name":"MyElectricity2","id":"00254358","total_energy_consumption_kwh":9652.22,"current_power_consumption_kw":1.055,"total_energy_production_kwh":0,"current_power_production_kw":0,"voltage_at_phase_1_v":235,"voltage_at_phase_2_v":245,"voltage_at_phase_3_v":239,"device_date_time":"2021-10-12 08:07:00","timestamp":"1111-11-11T11:11:11Z"}
|MyElectricity2;00254358;9652.22;1.055;0;0;235;245;239;null;null;null;null;null;null;1111-11-11 11:11.11 |MyElectricity2;00254358;9652.22;1.055;0;0;235;245;239;null;null;null;null;null;null;1111-11-11 11:11.11
@ -43,14 +43,14 @@ telegram=|5E44B6105843250000027A2A005005_2F2F0C7835221400066D404708AC2A400E03202
# There is a problem in the decoding here, the data stored inside the telegram does not seem to properly encode/decode the year.... # There is a problem in the decoding here, the data stored inside the telegram does not seem to properly encode/decode the year....
# We should not report a current_date with a full year, if the year is actually not part of the telegram. # We should not report a current_date with a full year, if the year is actually not part of the telegram.
telegram=|2F446850313233347462A2_069F255900B029310000000306060906030609070606050509050505050407040605070500| telegram=|2F446850313233347462A2_069F255900B029310000000306060906030609070606050509050505050407040605070500|
{"media":"warm water","meter":"mkradio3","name":"Duschen","id":"34333231","total_m3":13.8,"target_m3":8.9,"current_date":"2022-04-27T02:00:00Z","prev_date":"2018-12-31T02:00:00Z","timestamp":"1111-11-11T11:11:11Z"} {"media":"warm water","meter":"mkradio3","name":"Duschen","id":"34333231","total_m3":13.8,"target_m3":8.9,"current_date":"2023-04-27T02:00:00Z","prev_date":"2018-12-31T02:00:00Z","timestamp":"1111-11-11T11:11:11Z"}
|Duschen;34333231;13.800000;8.900000;2022-04-27T02:00:00Z;2018-12-31T02:00:00Z;1111-11-11 11:11.11 |Duschen;34333231;13.8;8.9;2023-04-27T02:00:00Z;2018-12-31T02:00:00Z;1111-11-11 11:11.11
# Test MKRadio4 T1 telegrams # Test MKRadio4 T1 telegrams
telegram=|2F446850200141029562A2_06702901006017030004000300000000000000000000000000000000000000000000000000| telegram=|2F446850200141029562A2_06702901006017030004000300000000000000000000000000000000000000000000000000|
{"media":"warm water","meter":"mkradio4","name":"Duschagain","id":"02410120","total_m3":0.4,"target_m3":0.1,"timestamp":"1111-11-11T11:11:11Z"} {"media":"warm water","meter":"mkradio4","name":"Duschagain","id":"02410120","total_m3":0.4,"target_m3":0.1,"timestamp":"1111-11-11T11:11:11Z"}
|Duschagain;02410120;0.400000;0.100000;1111-11-11 11:11.11 |Duschagain;02410120;0.4;0.1;1111-11-11 11:11.11
# Test vario451 T1 telegrams # Test vario451 T1 telegrams
telegram=|374468506549235827C3A2_129F25383300A8622600008200800A2AF862115175552877A36F26C9AB1CB24400000004000000000004908002| telegram=|374468506549235827C3A2_129F25383300A8622600008200800A2AF862115175552877A36F26C9AB1CB24400000004000000000004908002|
@ -61,15 +61,15 @@ telegram=|374468506549235827C3A2_129F25383300A8622600008200800A2AF86211517555287
# There is a problem in the decoding here, the data stored inside the telegram does not seem to properly encode/decode the year.... # There is a problem in the decoding here, the data stored inside the telegram does not seem to properly encode/decode the year....
# We should not report a current_date with a full year, if the year is actually not part of the telegram. # We should not report a current_date with a full year, if the year is actually not part of the telegram.
telegram=|31446850226677116980A0119F27020480048300C408F709143C003D341A2B0B2A0707000000000000062D114457563D71A1850000| telegram=|31446850226677116980A0119F27020480048300C408F709143C003D341A2B0B2A0707000000000000062D114457563D71A1850000|
{"media":"heat cost allocator","meter":"fhkvdataiii","name":"Room","id":"11776622","current_hca":131,"current_date":"2022-02-08T02:00:00Z","previous_hca":1026,"previous_date":"2019-12-31T02:00:00Z","temp_room_c":22.44,"temp_radiator_c":25.51,"timestamp":"1111-11-11T11:11:11Z"} {"media":"heat cost allocator","meter":"fhkvdataiii","name":"Room","id":"11776622","current_hca":131,"current_date":"2023-02-08T02:00:00Z","previous_hca":1026,"previous_date":"2019-12-31T02:00:00Z","temp_room_c":22.44,"temp_radiator_c":25.51,"timestamp":"1111-11-11T11:11:11Z"}
|Room;11776622;131.000000;2022-02-08T02:00:00Z;1026.000000;2019-12-31T02:00:00Z;22.440000;25.510000;1111-11-11 11:11.11 |Room;11776622;131;2023-02-08T02:00:00Z;1026;2019-12-31T02:00:00Z;22.44;25.51;1111-11-11 11:11.11
# FHKV radio 4 / EHKV vario 4 # FHKV radio 4 / EHKV vario 4
# There is a problem in the decoding here, the data stored inside the telegram does not seem to properly encode/decode the year.... # There is a problem in the decoding here, the data stored inside the telegram does not seem to properly encode/decode the year....
# We should not report a current_date with a full year, if the year is actually not part of the telegram. # We should not report a current_date with a full year, if the year is actually not part of the telegram.
telegram=|33446850341211119480A2_0F9F292D005024040011BD08380904000000070000000000000000000000000001000000000003140E| telegram=|33446850341211119480A2_0F9F292D005024040011BD08380904000000070000000000000000000000000001000000000003140E|
{"media":"heat cost allocator","meter":"fhkvdataiii","name":"Room","id":"11111234","current_hca":4,"current_date":"2022-02-05T02:00:00Z","previous_hca":45,"previous_date":"2020-12-31T02:00:00Z","temp_room_c":22.37,"temp_radiator_c":23.6,"timestamp":"1111-11-11T11:11:11Z"} {"media":"heat cost allocator","meter":"fhkvdataiii","name":"Room","id":"11111234","current_hca":4,"current_date":"2023-02-05T02:00:00Z","previous_hca":45,"previous_date":"2020-12-31T02:00:00Z","temp_room_c":22.37,"temp_radiator_c":23.6,"timestamp":"1111-11-11T11:11:11Z"}
|Room;11111234;4.000000;2022-02-05T02:00:00Z;45.000000;2020-12-31T02:00:00Z;22.370000;23.600000;1111-11-11 11:11.11 |Room;11111234;4;2023-02-05T02:00:00Z;45;2020-12-31T02:00:00Z;22.37;23.6;1111-11-11 11:11.11
# Test FHKV data IV # Test FHKV data IV
telegram=|4E4468507620541494087AAD004005089D86B62A329B3439873999738F82461ABDE3C7AC78692B363F3B41EB68607F9C9160F550769B065B6EA00A2E44346E29FF5DC5CB86283C69324AD33D137F6F| telegram=|4E4468507620541494087AAD004005089D86B62A329B3439873999738F82461ABDE3C7AC78692B363F3B41EB68607F9C9160F550769B065B6EA00A2E44346E29FF5DC5CB86283C69324AD33D137F6F|
@ -123,17 +123,17 @@ telegram=|5744b40988227711101b7ab20800000265a00842658f088201659f08226589081265a0
# Test Hydrus water meter telegram # Test Hydrus water meter telegram
telegram=|4E44A5116464646470077AED004005_2F2F01FD08300C13741100007C1300000000FC101300000000FC201300000000726C00000B3B00000002FD748713025A6800C4016D3B177F2ACC011300020000| telegram=|4E44A5116464646470077AED004005_2F2F01FD08300C13741100007C1300000000FC101300000000FC201300000000726C00000B3B00000002FD748713025A6800C4016D3B177F2ACC011300020000|
{"media":"water","meter":"hydrus","name":"HydrusWater","id":"64646464","total_m3":1.174,"total_tariff1_m3":0,"total_tariff2_m3":0,"max_flow_m3h":0,"flow_temperature_c":10.4,"external_temperature_c":0,"current_date":"","total_at_date_m3":0,"total_tariff1_at_date_m3":0,"total_tariff2_at_date_m3":0,"at_date":"2000-00-00 00:00","actuality_duration_s":0,"operating_time_h":0,"remaining_battery_life_y":13.686516,"status":"OK","timestamp":"1111-11-11T11:11:11Z"} {"media":"water","meter":"hydrus","name":"HydrusWater","id":"64646464","total_m3":1.174,"total_tariff1_m3":0,"total_tariff2_m3":0,"max_flow_m3h":0,"flow_temperature_c":10.4,"external_temperature_c":0,"current_date":"","total_at_date_m3":0,"total_tariff1_at_date_m3":0,"total_tariff2_at_date_m3":0,"at_date":"2000-00-00 00:00","actuality_duration_s":0,"operating_time_h":0,"remaining_battery_life_y":13.686516,"status":"OK","timestamp":"1111-11-11T11:11:11Z"}
|HydrusWater;64646464;1.174000;0.000000;OK;1111-11-11 11:11.11 |HydrusWater;64646464;1.174;0;OK;1111-11-11 11:11.11
# Test Hydrus new version water meter telegram # Test Hydrus new version water meter telegram
telegram=|3E44A5116565656570067AFB0030052F2F_0C13503400000DFD110A383731303134423032410B3B00000002FD74DC15C4016D3B178D29CC0113313400002F2F| telegram=|3E44A5116565656570067AFB0030052F2F_0C13503400000DFD110A383731303134423032410B3B00000002FD74DC15C4016D3B178D29CC0113313400002F2F|
{"media":"warm water","meter":"hydrus","name":"HydrusVater","id":"65656565","total_m3":3.45,"total_tariff1_m3":0,"total_tariff2_m3":0,"max_flow_m3h":0,"flow_temperature_c":127,"external_temperature_c":0,"current_date":"","total_at_date_m3":3.431,"total_tariff1_at_date_m3":0,"total_tariff2_at_date_m3":0,"at_date":"2020-09-13 23:59","actuality_duration_s":0,"operating_time_h":0,"remaining_battery_life_y":15.321013,"status":"OK","timestamp":"1111-11-11T11:11:11Z"} {"media":"warm water","meter":"hydrus","name":"HydrusVater","id":"65656565","total_m3":3.45,"total_tariff1_m3":0,"total_tariff2_m3":0,"max_flow_m3h":0,"flow_temperature_c":127,"external_temperature_c":0,"current_date":"","total_at_date_m3":3.431,"total_tariff1_at_date_m3":0,"total_tariff2_at_date_m3":0,"at_date":"2020-09-13 23:59","actuality_duration_s":0,"operating_time_h":0,"remaining_battery_life_y":15.321013,"status":"OK","timestamp":"1111-11-11T11:11:11Z"}
|HydrusVater;65656565;3.450000;0.000000;OK;1111-11-11 11:11.11 |HydrusVater;65656565;3.45;3.431;OK;1111-11-11 11:11.11
# Test Hydrus with default AES encryption # Test Hydrus with default AES encryption
telegram=||6644242328001081640E7266567464A51170071F0050052C411A08674048DD6BA82A0DF79FFD401309179A893A1BE3CE8EDC50C2A45CD7AFEC3B4CE765820BE8056C124A17416C3722985FFFF7FCEB7094901AB3A16294B511B9A740C9F9911352B42A72FB3B0C| telegram=||6644242328001081640E7266567464A51170071F0050052C411A08674048DD6BA82A0DF79FFD401309179A893A1BE3CE8EDC50C2A45CD7AFEC3B4CE765820BE8056C124A17416C3722985FFFF7FCEB7094901AB3A16294B511B9A740C9F9911352B42A72FB3B0C|
{"media":"water","meter":"hydrus","name":"HydrusAES","id":"64745666","total_m3":137.291,"total_tariff1_m3":0,"total_tariff2_m3":137.291,"max_flow_m3h":0,"flow_temperature_c":24.5,"external_temperature_c":23.9,"current_date":"2021-01-23 08:27","total_at_date_m3":128.638,"total_tariff1_at_date_m3":0,"total_tariff2_at_date_m3":128.638,"at_date":"2020-12-31 00:00","actuality_duration_s":6673,"operating_time_h":14678,"remaining_battery_life_y":0,"status":"OK","timestamp":"1111-11-11T11:11:11Z"} {"media":"water","meter":"hydrus","name":"HydrusAES","id":"64745666","total_m3":137.291,"total_tariff1_m3":0,"total_tariff2_m3":137.291,"max_flow_m3h":0,"flow_temperature_c":24.5,"external_temperature_c":23.9,"current_date":"2021-01-23 08:27","total_at_date_m3":128.638,"total_tariff1_at_date_m3":0,"total_tariff2_at_date_m3":128.638,"at_date":"2020-12-31 00:00","actuality_duration_s":6673,"operating_time_h":14678,"remaining_battery_life_y":0,"status":"OK","timestamp":"1111-11-11T11:11:11Z"}
|HydrusAES;64745666;137.291000;0.000000;OK;1111-11-11 11:11.11 |HydrusAES;64745666;137.291;128.638;OK;1111-11-11 11:11.11
# Test BMeters HydroDigit water telegram # Test BMeters HydroDigit water telegram
telegram=|4E44B4098686868613077AF0004005_2F2F0C1366380000046D27287E2A0F150E00000000C10000D10000E60000FD00000C01002F0100410100540100680100890000A00000B30000002F2F2F2F2F2F| telegram=|4E44B4098686868613077AF0004005_2F2F0C1366380000046D27287E2A0F150E00000000C10000D10000E60000FD00000C01002F0100410100540100680100890000A00000B30000002F2F2F2F2F2F|
@ -164,7 +164,7 @@ telegram=|5B445A149922992202378C20F6900F002C25BC9E0000BF48954821BC508D7299229922
# static telegram # static telegram
telegram=|7B4479169977997730378C208B900F002C25E4EF0A002EA98E7D58B3ADC57299779977991611028B005087102F2F#0DFD090F34302e3030562030303030303030300D790E31323334353637383839595345310DFD100AAAAAAAAAAAAAAAAAAAAA0D780E31323334353637383930594553312F2F2F2F2F2F2F2F2F2F2F| telegram=|7B4479169977997730378C208B900F002C25E4EF0A002EA98E7D58B3ADC57299779977991611028B005087102F2F#0DFD090F34302e3030562030303030303030300D790E31323334353637383839595345310DFD100AAAAAAAAAAAAAAAAAAAAA0D780E31323334353637383930594553312F2F2F2F2F2F2F2F2F2F2F|
{"media":"electricity","meter":"esyswm","name":"Elen2","id":"77997799","fabrication_no":"1SEY0987654321","enhanced_id":"1ESY9887654321","location":"AAAAAAAAAAAAAAAAAAAA","location_hex":"AAAAAAAAAAAAAAAAAAAA","total_energy_consumption_kwh":null,"current_power_consumption_kw":null,"total_energy_production_kwh":null,"total_energy_consumption_tariff1_kwh":null,"total_energy_consumption_tariff2_kwh":null,"current_power_consumption_phase1_kw":null,"current_power_consumption_phase2_kw":null,"current_power_consumption_phase3_kw":null,"version":"00000000 V00.04","timestamp":"1111-11-11T11:11:11Z"} {"media":"electricity","meter":"esyswm","name":"Elen2","id":"77997799","fabrication_no":"1SEY0987654321","enhanced_id":"1ESY9887654321","location":"AAAAAAAAAAAAAAAAAAAA","location_hex":"AAAAAAAAAAAAAAAAAAAA","version":"00000000 V00.04","timestamp":"1111-11-11T11:11:11Z"}
|Elen2;77997799;null;null;null;null;null;null;null;null;1ESY9887654321;1111-11-11 11:11.11 |Elen2;77997799;null;null;null;null;null;null;null;null;1ESY9887654321;1111-11-11 11:11.11
# dynamic telegram # dynamic telegram
@ -182,7 +182,7 @@ telegram=|5344A8159955995502028C201D900F002C250C390000ED176BBBB1591ADB7A1D003007
telegram=|73441486DD4444000303A0_B9E527004C4034B31CED0106FF01D093270065F022009661230054D02300EC49240018B424005F012500936D2500FFD525000E3D26001EAC26000B2027000300000000371D0B2000000000000024000000000000280000000000002C0033150C010D2F000000000000| telegram=|73441486DD4444000303A0_B9E527004C4034B31CED0106FF01D093270065F022009661230054D02300EC49240018B424005F012500936D2500FFD525000E3D26001EAC26000B2027000300000000371D0B2000000000000024000000000000280000000000002C0033150C010D2F000000000000|
{"media":"water","meter":"apator08","name":"Vatten","id":"004444dd","total_m3":871.571,"timestamp":"1111-11-11T11:11:11Z"} {"media":"water","meter":"apator08","name":"Vatten","id":"004444dd","total_m3":871.571,"timestamp":"1111-11-11T11:11:11Z"}
|Vatten;004444dd;871.571000;1111-11-11 11:11.11 |Vatten;004444dd;871.571;1111-11-11 11:11.11
# Test older version of water meter rfmtx1 # Test older version of water meter rfmtx1
@ -205,12 +205,12 @@ telegram=|4E44B40512345678F1077A310040052F2F_01FD08040C13991848004C1359423500CC1
# Test Ultrimis water meter # Test Ultrimis water meter
telegram=|2E4401069897969501167A4B0320052F2F_0413320C000003FD1700000044132109000004933C000000002F2F2F2F2F|+0 telegram=|2E4401069897969501167A4B0320052F2F_0413320C000003FD1700000044132109000004933C000000002F2F2F2F2F|+0
{"media":"cold water","meter":"ultrimis","name":"Uater","id":"95969798","total_m3":3.122,"target_m3":2.337,"current_status":"OK","total_backward_flow_m3":0,"timestamp":"1111-11-11T11:11:11Z"} {"media":"cold water","meter":"ultrimis","name":"Uater","id":"95969798","total_m3":3.122,"target_m3":2.337,"current_status":"OK","total_backward_flow_m3":0,"timestamp":"1111-11-11T11:11:11Z"}
|Uater;95969798;3.122000;2.337000;OK;0.000000;1111-11-11 11:11.11 |Uater;95969798;3.122;2.337;OK;0;1111-11-11 11:11.11
# Test Sensostar 2 heat meter # Test Sensostar 2 heat meter
telegram=|9E44C5147956341200047A7B0090052F2F_046D25248A2B04063D1F000001FD17000415265F00004406131F0000840106901E0000C40106841E0000840206841E0000C402067A1E0000840306541E0000C40306021E00008404069E1D0000C40406D71C0000840506F21B0000C40506681A00008406061E190000C40606EB1700008407061C170000C40706EE1600002F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F| telegram=|9E44C5147956341200047A7B0090052F2F_046D25248A2B04063D1F000001FD17000415265F00004406131F0000840106901E0000C40106841E0000840206841E0000C402067A1E0000840306541E0000C40306021E00008404069E1D0000C40406D71C0000840506F21B0000C40506681A00008406061E190000C40606EB1700008407061C170000C40706EE1600002F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F|
{"media":"heat","meter":"sensostar","name":"Heater","id":"12345679","meter_timestamp":"2020-11-10 04:37","total_kwh":7997,"total_water_m3":2435.8,"current_status":"OK","reporting_date":null,"energy_consumption_at_reporting_date_kwh":7955,"consumption_1_months_ago_kwh":7955,"consumption_2_months_ago_kwh":7824,"consumption_3_months_ago_kwh":7812,"consumption_4_months_ago_kwh":7812,"consumption_5_months_ago_kwh":7802,"consumption_6_months_ago_kwh":7764,"consumption_7_months_ago_kwh":7682,"consumption_8_months_ago_kwh":7582,"consumption_9_months_ago_kwh":7383,"consumption_10_months_ago_kwh":7154,"consumption_11_months_ago_kwh":6760,"consumption_12_months_ago_kwh":6430,"consumption_13_months_ago_kwh":6123,"consumption_14_months_ago_kwh":5916,"consumption_15_months_ago_kwh":5870,"timestamp":"1111-11-11T11:11:11Z"} {"media":"heat","meter":"sensostar","name":"Heater","id":"12345679","meter_timestamp":"2020-11-10 04:37","total_kwh":7997,"total_water_m3":2435.8,"current_status":"OK","energy_consumption_at_reporting_date_kwh":7955,"consumption_1_months_ago_kwh":7955,"consumption_2_months_ago_kwh":7824,"consumption_3_months_ago_kwh":7812,"consumption_4_months_ago_kwh":7812,"consumption_5_months_ago_kwh":7802,"consumption_6_months_ago_kwh":7764,"consumption_7_months_ago_kwh":7682,"consumption_8_months_ago_kwh":7582,"consumption_9_months_ago_kwh":7383,"consumption_10_months_ago_kwh":7154,"consumption_11_months_ago_kwh":6760,"consumption_12_months_ago_kwh":6430,"consumption_13_months_ago_kwh":6123,"consumption_14_months_ago_kwh":5916,"consumption_15_months_ago_kwh":5870,"timestamp":"1111-11-11T11:11:11Z"}
|Heater;12345679;7997.000000;2435.800000;OK;null;7955.000000;1111-11-11 11:11.11 |Heater;12345679;7997;2435.8;OK;null;7955;1111-11-11 11:11.11
# Test Elster V200H water meter # Test Elster V200H water meter
telegram=|2E449215303099990D077AB50820452F2F_0C12495849004C12557545000FB10445007022C50BFFFFFFFF0000FFF000| telegram=|2E449215303099990D077AB50820452F2F_0C12495849004C12557545000FB10445007022C50BFFFFFFFF0000FFF000|
@ -256,7 +256,7 @@ telegram=|5E44A5112751617241047A8B0050052F2F0C0E000000000C13010000000B3B0000000C
# Test Hydrometer/Diehl Metering Sharky 775 heat meter # Test Hydrometer/Diehl Metering Sharky 775 heat meter
telegram=|534424232004256092687A370045752235854DEEEA5939FAD81C25FEEF5A23C38FB9168493C563F08DB10BAF87F660FBA91296BA2397E8F4220B86D3A192FB51E0BFCF24DCE72118E0C75A9E89F43BDFE370824B| telegram=|534424232004256092687A370045752235854DEEEA5939FAD81C25FEEF5A23C38FB9168493C563F08DB10BAF87F660FBA91296BA2397E8F4220B86D3A192FB51E0BFCF24DCE72118E0C75A9E89F43BDFE370824B|
{"media":"heat","meter":"sharky","name":"Sharky775","id":"68926025","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,"power_kw":0,"flow_temperature_c":42.3,"return_temperature_c":28.1,"temperature_difference_c":14.1,"timestamp":"1111-11-11T11:11:11Z"} {"media":"heat","meter":"sharky","name":"Sharky775","id":"68926025","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,"power_kw":0,"flow_temperature_c":42.3,"return_temperature_c":28.1,"temperature_difference_c":14.1,"timestamp":"1111-11-11T11:11:11Z"}
|Sharky775;68926025;2651.000000;0.000000;150.347000;0.018000;0.000000;0.000000;42.300000;28.100000;14.100000;1111-11-11 11:11.11 |Sharky775;68926025;2651;0;150.347;0.018;0;0;42.3;28.1;14.1;1111-11-11 11:11.11
# Test Apator Elf Heat meter # Test Apator Elf Heat meter
telegram=|51440186010905001837721956880101064004DA000020026CA9220E017799241103000C13641320000A2D00000A5A90060A5E800544050E77000001FD0C010A6564370AFD4731030A274907047F00000002| telegram=|51440186010905001837721956880101064004DA000020026CA9220E017799241103000C13641320000A2D00000A5A90060A5E800544050E77000001FD0C010A6564370AFD4731030A274907047F00000002|
@ -271,17 +271,17 @@ telegram=|1E44A511909192937B077A9F0010052F2F_04130347030002FD1700002F2F2F|
# Test IZAR RS 868 water meter # Test IZAR RS 868 water meter
telegram=|1E4424238B07797389607A8F00107D_041312170100426CBF23441344100100| telegram=|1E4424238B07797389607A8F00107D_041312170100426CBF23441344100100|
{"media":"water","meter":"hydrus","name":"HydrusIzarRS","id":"60897379","total_m3":71.442,"total_tariff1_m3":0,"total_tariff2_m3":0,"max_flow_m3h":0,"flow_temperature_c":127,"external_temperature_c":0,"current_date":"","total_at_date_m3":69.7,"total_tariff1_at_date_m3":0,"total_tariff2_at_date_m3":0,"at_date":"2021-03-31 00:00","actuality_duration_s":0,"operating_time_h":0,"remaining_battery_life_y":0,"status":"OK","timestamp":"1111-11-11T11:11:11Z"} {"media":"water","meter":"hydrus","name":"HydrusIzarRS","id":"60897379","total_m3":71.442,"total_tariff1_m3":0,"total_tariff2_m3":0,"max_flow_m3h":0,"flow_temperature_c":127,"external_temperature_c":0,"current_date":"","total_at_date_m3":69.7,"total_tariff1_at_date_m3":0,"total_tariff2_at_date_m3":0,"at_date":"2021-03-31 00:00","actuality_duration_s":0,"operating_time_h":0,"remaining_battery_life_y":0,"status":"OK","timestamp":"1111-11-11T11:11:11Z"}
|HydrusIzarRS;60897379;71.442000;0.000000;OK;1111-11-11 11:11.11 |HydrusIzarRS;60897379;71.442;69.7;OK;1111-11-11 11:11.11
# Test IZAR RS 868 water meter warm # Test IZAR RS 868 water meter warm
telegram=|1E4424238B06204790607A2A0010D8_0413DDC00000426CBF23441382BB0000| telegram=|1E4424238B06204790607A2A0010D8_0413DDC00000426CBF23441382BB0000|
{"media":"warm water","meter":"hydrus","name":"HydrusIzarRSWarm","id":"60904720","total_m3":49.373,"total_tariff1_m3":0,"total_tariff2_m3":0,"max_flow_m3h":0,"flow_temperature_c":127,"external_temperature_c":0,"current_date":"","total_at_date_m3":48.002,"total_tariff1_at_date_m3":0,"total_tariff2_at_date_m3":0,"at_date":"2021-03-31 00:00","actuality_duration_s":0,"operating_time_h":0,"remaining_battery_life_y":0,"status":"OK","timestamp":"1111-11-11T11:11:11Z"} {"media":"warm water","meter":"hydrus","name":"HydrusIzarRSWarm","id":"60904720","total_m3":49.373,"total_tariff1_m3":0,"total_tariff2_m3":0,"max_flow_m3h":0,"flow_temperature_c":127,"external_temperature_c":0,"current_date":"","total_at_date_m3":48.002,"total_tariff1_at_date_m3":0,"total_tariff2_at_date_m3":0,"at_date":"2021-03-31 00:00","actuality_duration_s":0,"operating_time_h":0,"remaining_battery_life_y":0,"status":"OK","timestamp":"1111-11-11T11:11:11Z"}
|HydrusIzarRSWarm;60904720;49.373000;0.000000;OK;1111-11-11 11:11.11 |HydrusIzarRSWarm;60904720;49.373;48.002;OK;1111-11-11 11:11.11
# Test another Diehl branded meter with the izar protocol # Test another Diehl branded meter with the izar protocol
telegram=|19442423850798160018A2410100133EBBD44081053F243A82A3| telegram=|19442423850798160018A2410100133EBBD44081053F243A82A3|
{"media":"water","meter":"izar","name":"IzarWater4","id":"18001698","prefix":"","serial_number":"000000","total_m3":835.689,"last_month_total_m3":820.329,"last_month_measure_date":"2021-09-01","remaining_battery_life_y":0.5,"current_alarms":"no_alarm","previous_alarms":"no_alarm","transmit_period_s":8,"manufacture_year":"0","timestamp":"1111-11-11T11:11:11Z"} {"media":"water","meter":"izar","name":"IzarWater4","id":"18001698","prefix":"","serial_number":"000000","total_m3":835.689,"last_month_total_m3":820.329,"last_month_measure_date":"2021-09-01","remaining_battery_life_y":0.5,"current_alarms":"no_alarm","previous_alarms":"no_alarm","transmit_period_s":8,"manufacture_year":"0","timestamp":"1111-11-11T11:11:11Z"}
|IzarWater4;18001698;;000000;835.689000;820.329000;2021-09-01;0.500000;no_alarm;no_alarm;8.000000;0;1111-11-11 11:11.11 |IzarWater4;18001698;;000000;835.689;820.329;2021-09-01;0.5;no_alarm;no_alarm;8;0;1111-11-11 11:11.11
# Test Aventies Water Meter # Test Aventies Water Meter
telegram=76442104710007612507727100076121042507B5006005E2E95A3C2A1279A5415E6732679B43369FD5FDDDD783EEEBB48236D34E7C94AF0A18A5FDA5F7D64111EB42D4D891622139F2952F9D12A20088DFA4CF8123871123EE1F6C1DCEA414879DDB4E05E508F1826D7EFBA6964DF804C9261EA23BBF03 telegram=76442104710007612507727100076121042507B5006005E2E95A3C2A1279A5415E6732679B43369FD5FDDDD783EEEBB48236D34E7C94AF0A18A5FDA5F7D64111EB42D4D891622139F2952F9D12A20088DFA4CF8123871123EE1F6C1DCEA414879DDB4E05E508F1826D7EFBA6964DF804C9261EA23BBF03

Wyświetl plik

@ -39,7 +39,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_consumption", "total_energy_consumption",
"The total energy consumption recorded by this meter.", "The total energy consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -49,7 +49,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"firmware_version", "firmware_version",
"Firmware version.", "Firmware version.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::FirmwareVersion) .set(VIFRange::FirmwareVersion)
@ -59,7 +59,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"product_no", "product_no",
"The meter device product number.", "The meter device product number.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build(). FieldMatcher::build().
set(DifVifKey("0DFFAA00"))); set(DifVifKey("0DFFAA00")));
} }

Wyświetl plik

@ -41,7 +41,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_consumption", "total_energy_consumption",
"The total energy consumption recorded by this meter.", "The total energy consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -52,7 +52,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_power_consumption", "current_power_consumption",
"Current power consumption.", "Current power consumption.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -63,7 +63,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_production", "total_energy_production",
"The total energy production recorded by this meter.", "The total energy production recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -73,7 +73,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_power_production", "current_power_production",
"Current power production.", "Current power production.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -83,7 +83,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"voltage_at_phase_1", "voltage_at_phase_1",
"Voltage at phase L1.", "Voltage at phase L1.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Voltage, Quantity::Voltage,
VifScaling::None, VifScaling::None,
FieldMatcher::build() FieldMatcher::build()
@ -93,7 +93,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"voltage_at_phase_2", "voltage_at_phase_2",
"Voltage at phase L2.", "Voltage at phase L2.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Voltage, Quantity::Voltage,
VifScaling::None, VifScaling::None,
FieldMatcher::build() FieldMatcher::build()
@ -103,7 +103,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"voltage_at_phase_3", "voltage_at_phase_3",
"Voltage at phase L3.", "Voltage at phase L3.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Voltage, Quantity::Voltage,
VifScaling::None, VifScaling::None,
FieldMatcher::build() FieldMatcher::build()
@ -113,7 +113,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"device_date_time", "device_date_time",
"Device date time.", "Device date time.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::DateTime) .set(VIFRange::DateTime)
@ -122,7 +122,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_consumption_tariff_1", "total_energy_consumption_tariff_1",
"The total energy consumption recorded by this meter on tariff 1.", "The total energy consumption recorded by this meter on tariff 1.",
PrintProperty::JSON | PrintProperty::FIELD, // | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES, // ,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -134,7 +134,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_consumption_tariff_2", "total_energy_consumption_tariff_2",
"The total energy consumption recorded by this meter on tariff 2.", "The total energy consumption recorded by this meter on tariff 2.",
PrintProperty::JSON | PrintProperty::FIELD, // | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES, // ,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -146,7 +146,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_consumption_tariff_3", "total_energy_consumption_tariff_3",
"The total energy consumption recorded by this meter on tariff 3.", "The total energy consumption recorded by this meter on tariff 3.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -158,7 +158,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_production_tariff_1", "total_energy_production_tariff_1",
"The total energy production recorded by this meter on tariff 1.", "The total energy production recorded by this meter on tariff 1.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -168,7 +168,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_production_tariff_2", "total_energy_production_tariff_2",
"The total energy production recorded by this meter on tariff 2.", "The total energy production recorded by this meter on tariff 2.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -178,7 +178,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_production_tariff_3", "total_energy_production_tariff_3",
"The total energy production recorded by this meter on tariff 3.", "The total energy production recorded by this meter on tariff 3.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -189,19 +189,17 @@ namespace
// Test: MyElectricity1 amiplus 10101010 NOKEY // Test: MyElectricity1 amiplus 10101010 NOKEY
// telegram=|4E4401061010101002027A00004005_2F2F0E035040691500000B2B300300066D00790C7423400C78371204860BABC8FC100000000E833C8074000000000BAB3C0000000AFDC9FC0136022F2F2F2F2F| // telegram=|4E4401061010101002027A00004005_2F2F0E035040691500000B2B300300066D00790C7423400C78371204860BABC8FC100000000E833C8074000000000BAB3C0000000AFDC9FC0136022F2F2F2F2F|
// {"media":"electricity","meter":"amiplus","name":"MyElectricity1","id":"10101010","total_energy_consumption_kwh":15694.05,"current_power_consumption_kw":0.33,"total_energy_production_kwh":7.48,"current_power_production_kw":0,"voltage_at_phase_1_v":236,"voltage_at_phase_2_v":null,"voltage_at_phase_3_v":null,"device_date_time":"2019-03-20 12:57:00","total_energy_consumption_tariff_1_kwh":null,"total_energy_consumption_tariff_2_kwh":null,"total_energy_consumption_tariff_3_kwh":null,"total_energy_production_tariff_1_kwh":null,"total_energy_production_tariff_2_kwh":null,"total_energy_production_tariff_3_kwh":null,"timestamp":"1111-11-11T11:11:11Z"} // {"media":"electricity","meter":"amiplus","name":"MyElectricity1","id":"10101010","total_energy_consumption_kwh":15694.05,"current_power_consumption_kw":0.33,"total_energy_production_kwh":7.48,"current_power_production_kw":0,"voltage_at_phase_1_v":236,"device_date_time":"2019-03-20 12:57:00","timestamp":"1111-11-11T11:11:11Z"}
// |MyElectricity1;10101010;15694.05;0.33;7.48;0;236;null;null;null;null;null;null;null;null;1111-11-11 11:11.11 // |MyElectricity1;10101010;15694.05;0.33;7.48;0;236;null;null;null;null;null;null;null;null;1111-11-11 11:11.11
// Test: MyElectricity2 amiplus 00254358 NOKEY // Test: MyElectricity2 amiplus 00254358 NOKEY
// amiplus/apator electricity meter with three phase voltages // Comment: amiplus/apator electricity meter with three phase voltages
// telegram=|5E44B6105843250000027A2A005005_2F2F0C7835221400066D404708AC2A400E032022650900000E833C0000000000001B2B9647000B2B5510000BAB3C0000000AFDC9FC0135020AFDC9FC0245020AFDC9FC0339020BABC8FC100000002F2F| // telegram=|5E44B6105843250000027A2A005005_2F2F0C7835221400066D404708AC2A400E032022650900000E833C0000000000001B2B9647000B2B5510000BAB3C0000000AFDC9FC0135020AFDC9FC0245020AFDC9FC0339020BABC8FC100000002F2F|
// {"media":"electricity","meter":"amiplus","name":"MyElectricity2","id":"00254358","total_energy_consumption_kwh":9652.22,"current_power_consumption_kw":1.055,"total_energy_production_kwh":0,"current_power_production_kw":0,"voltage_at_phase_1_v":235,"voltage_at_phase_2_v":245,"voltage_at_phase_3_v":239,"device_date_time":"2021-10-12 08:07:00","total_energy_consumption_tariff_1_kwh":null,"total_energy_consumption_tariff_2_kwh":null,"total_energy_consumption_tariff_3_kwh":null,"total_energy_production_tariff_1_kwh":null,"total_energy_production_tariff_2_kwh":null,"total_energy_production_tariff_3_kwh":null,"timestamp":"1111-11-11T11:11:11Z"} // {"media":"electricity","meter":"amiplus","name":"MyElectricity2","id":"00254358","total_energy_consumption_kwh":9652.22,"current_power_consumption_kw":1.055,"total_energy_production_kwh":0,"current_power_production_kw":0,"voltage_at_phase_1_v":235,"voltage_at_phase_2_v":245,"voltage_at_phase_3_v":239,"device_date_time":"2021-10-12 08:07:00","timestamp":"1111-11-11T11:11:11Z"}
// |MyElectricity2;00254358;9652.22;1.055;0;0;235;245;239;null;null;null;null;null;null;1111-11-11 11:11.11 // |MyElectricity2;00254358;9652.22;1.055;0;0;235;245;239;null;null;null;null;null;null;1111-11-11 11:11.11
// Test: MyElectricity3 amiplus 86064864 NOKEY // Test: MyElectricity3 amiplus 86064864 NOKEY
// amiplus/apator electricity meter with three phase voltages and 2 tariffs // Comment: amiplus/apator electricity meter with three phase voltages and 2 tariffs.
// telegram=|804401066448068602027A000070052F2F_066D1E5C11DA21400C78644806868E10036110012500008E20038106531800008E10833C9949000000008E20833C8606000000001B2B5228020B2B3217000BAB3C0000000AFDC9FC0131020AFDC9FC0225020AFDC9FC0331020BABC8FC100000002F2F2F2F2F2F2F2F2F2F2F2F2FDE47| // telegram=|804401066448068602027A000070052F2F_066D1E5C11DA21400C78644806868E10036110012500008E20038106531800008E10833C9949000000008E20833C8606000000001B2B5228020B2B3217000BAB3C0000000AFDC9FC0131020AFDC9FC0225020AFDC9FC0331020BABC8FC100000002F2F2F2F2F2F2F2F2F2F2F2F2FDE47|
// {"media":"electricity","meter":"amiplus","name":"MyElectricity3","id":"86064864","total_energy_consumption_kwh":null,"current_power_consumption_kw":1.732,"total_energy_production_kwh":null,"current_power_production_kw":0,"voltage_at_phase_1_v":231,"voltage_at_phase_2_v":225,"voltage_at_phase_3_v":231,"device_date_time":"2022-01-26 17:28:30","total_energy_consumption_tariff_1_kwh":25011.061,"total_energy_consumption_tariff_2_kwh":18530.681,"total_energy_consumption_tariff_3_kwh":null,"total_energy_production_tariff_1_kwh":4.999,"total_energy_production_tariff_2_kwh":0.686,"total_energy_production_tariff_3_kwh":null,"timestamp":"1111-11-11T11:11:11Z"} // {"media":"electricity","meter":"amiplus","name":"MyElectricity3","id":"86064864","current_power_consumption_kw":1.732,"current_power_production_kw":0,"voltage_at_phase_1_v":231,"voltage_at_phase_2_v":225,"voltage_at_phase_3_v":231,"device_date_time":"2022-01-26 17:28:30","total_energy_consumption_tariff_1_kwh":25011.061,"total_energy_consumption_tariff_2_kwh":18530.681,"total_energy_production_tariff_1_kwh":4.999,"total_energy_production_tariff_2_kwh":0.686,"timestamp":"1111-11-11T11:11:11Z"}
// |MyElectricity3;86064864;null;1.732;null;0;231;225;231;25011.061;18530.681;null;4.999;0.686;null;1111-11-11 11:11.11 // |MyElectricity3;86064864;null;1.732;null;0;231;225;231;25011.061;18530.681;null;4.999;0.686;null;1111-11-11 11:11.11

Wyświetl plik

@ -33,6 +33,7 @@ private:
static bool ok = registerDriver([](DriverInfo&di) static bool ok = registerDriver([](DriverInfo&di)
{ {
di.setName("apator08"); di.setName("apator08");
di.setDefaultFields("name,id,total_m3,timestamp");
di.setMeterType(MeterType::WaterMeter); di.setMeterType(MeterType::WaterMeter);
di.addLinkMode(LinkMode::T1); di.addLinkMode(LinkMode::T1);
di.addDetection(0x8614/*APT?*/, 0x03, 0x03); di.addDetection(0x8614/*APT?*/, 0x03, 0x03);
@ -44,7 +45,7 @@ MeterApator08::MeterApator08(MeterInfo &mi, DriverInfo &di) : MeterCommonImpleme
addNumericField( addNumericField(
"total", "total",
Quantity::Volume, Quantity::Volume,
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
"The total water consumption recorded by this meter.", "The total water consumption recorded by this meter.",
SET_FUNC(total_water_consumption_m3_, Unit::M3), SET_FUNC(total_water_consumption_m3_, Unit::M3),
GET_FUNC(total_water_consumption_m3_, Unit::M3)); GET_FUNC(total_water_consumption_m3_, Unit::M3));
@ -83,4 +84,4 @@ void MeterApator08::processContent(Telegram *t)
// Test: Vatten apator08 004444dd NOKEY // Test: Vatten apator08 004444dd NOKEY
// telegram=|73441486DD4444000303A0B9E527004C4034B31CED0106FF01D093270065F022009661230054D02300EC49240018B424005F012500936D2500FFD525000E3D26001EAC26000B2027000300000000371D0B2000000000000024000000000000280000000000002C0033150C010D2F000000000000| // telegram=|73441486DD4444000303A0B9E527004C4034B31CED0106FF01D093270065F022009661230054D02300EC49240018B424005F012500936D2500FFD525000E3D26001EAC26000B2027000300000000371D0B2000000000000024000000000000280000000000002C0033150C010D2F000000000000|
// {"media":"water","meter":"apator08","name":"Vatten","id":"004444dd","total_m3":871.571,"timestamp":"1111-11-11T11:11:11Z"} // {"media":"water","meter":"apator08","name":"Vatten","id":"004444dd","total_m3":871.571,"timestamp":"1111-11-11T11:11:11Z"}
// |Vatten;004444dd;871.571000;1111-11-11 11:11.11 // |Vatten;004444dd;871.571;1111-11-11 11:11.11

Wyświetl plik

@ -50,7 +50,7 @@ namespace
addPrint("total", Quantity::Volume, addPrint("total", Quantity::Volume,
[&](Unit u){ return convert(total_water_consumption_m3_, Unit::M3, u); }, [&](Unit u){ return convert(total_water_consumption_m3_, Unit::M3, u); },
"The total water consumption recorded by this meter.", "The total water consumption recorded by this meter.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
} }
void Driver::processContent(Telegram *t) void Driver::processContent(Telegram *t)

Wyświetl plik

@ -33,6 +33,7 @@ namespace
static bool ok = registerDriver([](DriverInfo&di) static bool ok = registerDriver([](DriverInfo&di)
{ {
di.setName("apator172"); di.setName("apator172");
di.setDefaultFields("name,id,total_m3,timestamp");
di.setMeterType(MeterType::WaterMeter); di.setMeterType(MeterType::WaterMeter);
di.addDetection(0x8614 /*APT?*/, 0x11, 0x04); di.addDetection(0x8614 /*APT?*/, 0x11, 0x04);
di.setConstructor([](MeterInfo& mi, DriverInfo& di){ return shared_ptr<Meter>(new Driver(mi, di)); }); di.setConstructor([](MeterInfo& mi, DriverInfo& di){ return shared_ptr<Meter>(new Driver(mi, di)); });
@ -43,7 +44,7 @@ namespace
addPrint("total", Quantity::Volume, addPrint("total", Quantity::Volume,
[&](Unit u){ return convert(total_water_consumption_m3_, Unit::M3, u); }, [&](Unit u){ return convert(total_water_consumption_m3_, Unit::M3, u); },
"The total water consumption recorded by this meter.", "The total water consumption recorded by this meter.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
} }
void Driver::processContent(Telegram *t) void Driver::processContent(Telegram *t)
@ -78,8 +79,8 @@ namespace
// Test: Vattur apator172 0014a807 NOKEY // Test: Vattur apator172 0014a807 NOKEY
// telegram=|1C44148607A814000411A0_1D5400000840030000000005FF05D83D0000| // telegram=|1C44148607A814000411A0_1D5400000840030000000005FF05D83D0000|
// {"media":"water","meter":"apator172","name":"Vattur","id":"0014a807","total_m3":7177.7,"timestamp":"1111-11-11T11:11:11Z"} // {"media":"water","meter":"apator172","name":"Vattur","id":"0014a807","total_m3":7177.7,"timestamp":"1111-11-11T11:11:11Z"}
// |Vattur;0014a807;7177.700000;1111-11-11 11:11.11 // |Vattur;0014a807;7177.7;1111-11-11 11:11.11
// telegram=|1C44148607A814000411A0_215400000840030000000005FF05D83D0000| // telegram=|1C44148607A814000411A0_215400000840030000000005FF05D83D0000|
// {"media":"water","meter":"apator172","name":"Vattur","id":"0014a807","total_m3":7179,"timestamp":"1111-11-11T11:11:11Z"} // {"media":"water","meter":"apator172","name":"Vattur","id":"0014a807","total_m3":7179,"timestamp":"1111-11-11T11:11:11Z"}
// |Vattur;0014a807;7179.000000;1111-11-11 11:11.11 // |Vattur;0014a807;7179;1111-11-11 11:11.11

Wyświetl plik

@ -54,37 +54,37 @@ namespace
addPrint("current", Quantity::HCA, addPrint("current", Quantity::HCA,
[&](Unit u){ return convert(curr_energy_hca_, Unit::HCA, u);}, [&](Unit u){ return convert(curr_energy_hca_, Unit::HCA, u);},
"Energy consumption so far in this billing period.", "Energy consumption so far in this billing period.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("previous", Quantity::HCA, addPrint("previous", Quantity::HCA,
[&](Unit u){ return convert(prev_energy_hca_, Unit::HCA, u); }, [&](Unit u){ return convert(prev_energy_hca_, Unit::HCA, u); },
"Energy consumption in previous billing period.", "Energy consumption in previous billing period.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("current_date", Quantity::Text, addPrint("current_date", Quantity::Text,
[&](){ return curr_energy_hca_date_; }, [&](){ return curr_energy_hca_date_; },
"Current date, as reported by meter.", "Current date, as reported by meter.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("season_start_date", Quantity::Text, addPrint("season_start_date", Quantity::Text,
[&](){ return season_start_date_; }, [&](){ return season_start_date_; },
"Season start date.", "Season start date.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("esb_date", Quantity::Text, addPrint("esb_date", Quantity::Text,
[&](){ return esb_date_; }, [&](){ return esb_date_; },
"Electronic seal protection break date.", "Electronic seal protection break date.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("temp_room_avg", Quantity::Temperature, addPrint("temp_room_avg", Quantity::Temperature,
[&](Unit u){ return convert(temp_room_avg_, Unit::C, u); }, [&](Unit u){ return convert(temp_room_avg_, Unit::C, u); },
"Average room temperature in current season.", "Average room temperature in current season.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("temp_room_prev_avg", Quantity::Temperature, addPrint("temp_room_prev_avg", Quantity::Temperature,
[&](Unit u){ return convert(temp_room_prev_avg_, Unit::C, u); }, [&](Unit u){ return convert(temp_room_prev_avg_, Unit::C, u); },
"Average room temperature in previous season.", "Average room temperature in previous season.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
} }
void Driver::processContent(Telegram *t) void Driver::processContent(Telegram *t)

Wyświetl plik

@ -29,6 +29,7 @@ struct MeterAuto : public virtual MeterCommonImplementation
bool ok = registerDriver([](DriverInfo&di) bool ok = registerDriver([](DriverInfo&di)
{ {
di.setName("auto"); di.setName("auto");
di.setDefaultFields("name,id,timestamp");
di.setMeterType(MeterType::AutoMeter); di.setMeterType(MeterType::AutoMeter);
di.setConstructor([](MeterInfo& mi, DriverInfo& di){ return shared_ptr<Meter>(new MeterAuto(mi, di)); }); di.setConstructor([](MeterInfo& mi, DriverInfo& di){ return shared_ptr<Meter>(new MeterAuto(mi, di)); });
}); });

Wyświetl plik

@ -39,8 +39,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Meter status from error flags and tpl status field.", "Meter status from error flags and tpl status field.",
PrintProperty::JSON | PrintProperty::IMPORTANT | PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS,
PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::ErrorFlags), .set(VIFRange::ErrorFlags),
@ -67,7 +66,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"error_flags", "error_flags",
"Deprecated.", "Deprecated.",
PrintProperty::JSON | PrintProperty::DEPRECATED, DEFAULT_PRINT_PROPERTIES | PrintProperty::DEPRECATED,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::ErrorFlags), .set(VIFRange::ErrorFlags),
@ -94,7 +93,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_consumption", "current_consumption",
"The current heat cost allocation.", "The current heat cost allocation.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::HCA, Quantity::HCA,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -105,7 +104,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"consumption_at_set_date", "consumption_at_set_date",
"Heat cost allocation at the most recent billing period date.", "Heat cost allocation at the most recent billing period date.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::HCA, Quantity::HCA,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -117,7 +116,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"consumption_at_set_date_{storage_counter}", "consumption_at_set_date_{storage_counter}",
"The heat cost allocation at set date #.", "The heat cost allocation at set date #.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::HCA, Quantity::HCA,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -40,8 +40,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Meter status from error flags and tpl status field.", "Meter status from error flags and tpl status field.",
PrintProperty::JSON | PrintProperty::IMPORTANT | PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS,
PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::ErrorFlags), .set(VIFRange::ErrorFlags),
@ -68,7 +67,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total", "total",
"The total water consumption recorded by this meter.", "The total water consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -79,7 +78,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"consumption_at_set_date_{storage_counter}", "consumption_at_set_date_{storage_counter}",
"Water consumption at the # billing period date.", "Water consumption at the # billing period date.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -92,7 +91,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"error_flags", "error_flags",
"Deprecated.", "Deprecated.",
PrintProperty::JSON | PrintProperty::DEPRECATED, DEFAULT_PRINT_PROPERTIES | PrintProperty::DEPRECATED,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::ErrorFlags), .set(VIFRange::ErrorFlags),

Wyświetl plik

@ -47,12 +47,12 @@ namespace
addPrint("current", Quantity::HCA, addPrint("current", Quantity::HCA,
[&](Unit u){ return convert(current_hca_, Unit::HCA, u);}, [&](Unit u){ return convert(current_hca_, Unit::HCA, u);},
"Energy consumption so far in this billing period.", "Energy consumption so far in this billing period.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("prev", Quantity::HCA, addPrint("prev", Quantity::HCA,
[&](Unit u){ return convert(prev_hca_, Unit::HCA, u); }, [&](Unit u){ return convert(prev_hca_, Unit::HCA, u); },
"Energy consumption at end of previous billing period.", "Energy consumption at end of previous billing period.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
for (int i=0; i<18; ++i) for (int i=0; i<18; ++i)
{ {
@ -61,13 +61,13 @@ namespace
addPrint(info, Quantity::HCA, addPrint(info, Quantity::HCA,
[this,i](Unit u){ return convert(historic_hca_[i], Unit::HCA, u);}, [this,i](Unit u){ return convert(historic_hca_[i], Unit::HCA, u);},
about, PrintProperty::JSON); about, DEFAULT_PRINT_PROPERTIES);
} }
addPrint("device_date", Quantity::Text, addPrint("device_date", Quantity::Text,
[&](){ return device_date_; }, [&](){ return device_date_; },
"Device date when telegram was sent.", "Device date when telegram was sent.",
PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
} }

Wyświetl plik

@ -51,15 +51,17 @@ namespace
}; };
static bool ok = registerDriver([](DriverInfo&di) static bool ok = registerDriver([](DriverInfo&di)
{ {
di.setName("c5isf"); di.setName("c5isf");
di.setMeterType(MeterType::HeatMeter); di.setDefaultFields("name,id,total_energy_consumption_kwh,total_volume_m3,status,timestamp");
di.addLinkMode(LinkMode::T1);
di.addDetection(MANUFACTURER_ZRI, 0x0d, 0x88); // Telegram type T1A1 di.setMeterType(MeterType::HeatMeter);
di.addDetection(MANUFACTURER_ZRI, 0x07, 0x88); // Telegram type T1A2 di.addLinkMode(LinkMode::T1);
di.addDetection(MANUFACTURER_ZRI, 0x04, 0x88); // Telegram type T1B di.addDetection(MANUFACTURER_ZRI, 0x0d, 0x88); // Telegram type T1A1
di.setConstructor([](MeterInfo& mi, DriverInfo& di){ return shared_ptr<Meter>(new Driver(mi, di)); }); di.addDetection(MANUFACTURER_ZRI, 0x07, 0x88); // Telegram type T1A2
}); di.addDetection(MANUFACTURER_ZRI, 0x04, 0x88); // Telegram type T1B
di.setConstructor([](MeterInfo& mi, DriverInfo& di){ return shared_ptr<Meter>(new Driver(mi, di)); });
});
Driver::Driver(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementation(mi, di) Driver::Driver(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementation(mi, di)
{ {
@ -68,7 +70,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_consumption", "total_energy_consumption",
"The total heat energy consumption recorded by this meter.", "The total heat energy consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -79,7 +81,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_volume", "total_volume",
"The total heating media volume recorded by this meter.", "The total heating media volume recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -92,8 +94,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Status and error flags.", "Status and error flags.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT | PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS,
PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(VIFRange::ErrorFlags), .set(VIFRange::ErrorFlags),
{ {
@ -134,7 +135,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
tostrprintf("prev_%d_month", i+1), tostrprintf("prev_%d_month", i+1),
"The due date.", "The due date.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(StorageNr(32+i)) .set(StorageNr(32+i))
@ -149,7 +150,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
tostrprintf("prev_%d_month", i+1), tostrprintf("prev_%d_month", i+1),
"The total heat energy consumption recorded at end of previous month.", "The total heat energy consumption recorded at end of previous month.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -166,7 +167,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
tostrprintf("prev_%d_month", i+1), tostrprintf("prev_%d_month", i+1),
tostrprintf("Previous month %d last date.", i+1), tostrprintf("Previous month %d last date.", i+1),
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -181,7 +182,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"due_energy_consumption", "due_energy_consumption",
"The total heat energy consumption at the due date.", "The total heat energy consumption at the due date.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -193,7 +194,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"due_date", "due_date",
"The due date.", "The due date.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(StorageNr(8)) .set(StorageNr(8))
@ -203,7 +204,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"volume_flow", "volume_flow",
"The current heat media volume flow.", "The current heat media volume flow.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Flow, Quantity::Flow,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -214,7 +215,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"power", "power",
"The current power consumption.", "The current power consumption.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -225,7 +226,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_consumption_last_month", "total_energy_consumption_last_month",
"The total heat energy consumption recorded at end of last month.", "The total heat energy consumption recorded at end of last month.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -237,7 +238,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"last_month_date", "last_month_date",
"The due date.", "The due date.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::DateTime) .set(VIFRange::DateTime)
@ -246,7 +247,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"max_power_last_month", "max_power_last_month",
"Maximum power consumption last month.", "Maximum power consumption last month.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -259,7 +260,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"flow_temperature", "flow_temperature",
"The current forward heat media temperature.", "The current forward heat media temperature.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -270,7 +271,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"return_temperature", "return_temperature",
"The current return heat media temperature.", "The current return heat media temperature.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -284,21 +285,21 @@ namespace
// telegram=|E544496A55554455880D7A320200002F2F_04060000000004130000000002FD17240084800106000000008280016C2124C480010600000080C280016CFFFF84810106000000808281016CFFFFC481010600000080C281016CFFFF84820106000000808282016CFFFFC482010600000080C282016CFFFF84830106000000808283016CFFFFC483010600000080C283016CFFFF84840106000000808284016CFFFFC484010600000080C284016CFFFF84850106000000808285016CFFFFC485010600000080C285016CFFFF84860106000000808286016CFFFFC486010600000080C286016CFFFF| // telegram=|E544496A55554455880D7A320200002F2F_04060000000004130000000002FD17240084800106000000008280016C2124C480010600000080C280016CFFFF84810106000000808281016CFFFFC481010600000080C281016CFFFF84820106000000808282016CFFFFC482010600000080C282016CFFFF84830106000000808283016CFFFFC483010600000080C283016CFFFF84840106000000808284016CFFFFC484010600000080C284016CFFFF84850106000000808285016CFFFFC485010600000080C285016CFFFF84860106000000808286016CFFFFC486010600000080C286016CFFFF|
// {"media":"heat/cooling load","meter":"c5isf","name":"Heat","id":"55445555","total_energy_consumption_kwh":0,"total_volume_m3":0,"status":"ERROR REVERSE_FLOW SUPPLY_SENSOR_INTERRUPTED","prev_1_month":"2017-04-01","prev_2_month":"2127-15-31","prev_3_month":"2127-15-31","prev_4_month":"2127-15-31","prev_5_month":"2127-15-31","prev_6_month":"2127-15-31","prev_7_month":"2127-15-31","prev_8_month":"2127-15-31","prev_9_month":"2127-15-31","prev_10_month":"2127-15-31","prev_11_month":"2127-15-31","prev_12_month":"2127-15-31","prev_13_month":"2127-15-31","prev_14_month":"2127-15-31","prev_1_month_kwh":0,"prev_2_month_kwh":2147483648,"prev_3_month_kwh":2147483648,"prev_4_month_kwh":2147483648,"prev_5_month_kwh":2147483648,"prev_6_month_kwh":2147483648,"prev_7_month_kwh":2147483648,"prev_8_month_kwh":2147483648,"prev_9_month_kwh":2147483648,"prev_10_month_kwh":2147483648,"prev_11_month_kwh":2147483648,"prev_12_month_kwh":2147483648,"prev_13_month_kwh":2147483648,"prev_14_month_kwh":2147483648,"total_energy_consumption_last_month_kwh":0,"timestamp":"1111-11-11T11:11:11Z"} // {"media":"heat/cooling load","meter":"c5isf","name":"Heat","id":"55445555","total_energy_consumption_kwh":0,"total_volume_m3":0,"status":"ERROR REVERSE_FLOW SUPPLY_SENSOR_INTERRUPTED","prev_1_month":"2017-04-01","prev_2_month":"2127-15-31","prev_3_month":"2127-15-31","prev_4_month":"2127-15-31","prev_5_month":"2127-15-31","prev_6_month":"2127-15-31","prev_7_month":"2127-15-31","prev_8_month":"2127-15-31","prev_9_month":"2127-15-31","prev_10_month":"2127-15-31","prev_11_month":"2127-15-31","prev_12_month":"2127-15-31","prev_13_month":"2127-15-31","prev_14_month":"2127-15-31","prev_1_month_kwh":0,"prev_2_month_kwh":2147483648,"prev_3_month_kwh":2147483648,"prev_4_month_kwh":2147483648,"prev_5_month_kwh":2147483648,"prev_6_month_kwh":2147483648,"prev_7_month_kwh":2147483648,"prev_8_month_kwh":2147483648,"prev_9_month_kwh":2147483648,"prev_10_month_kwh":2147483648,"prev_11_month_kwh":2147483648,"prev_12_month_kwh":2147483648,"prev_13_month_kwh":2147483648,"prev_14_month_kwh":2147483648,"total_energy_consumption_last_month_kwh":0,"timestamp":"1111-11-11T11:11:11Z"}
// |Heat;55445555;0.000000;0.000000;ERROR REVERSE_FLOW SUPPLY_SENSOR_INTERRUPTED;1111-11-11 11:11.11 // |Heat;55445555;0;0;ERROR REVERSE_FLOW SUPPLY_SENSOR_INTERRUPTED;1111-11-11 11:11.11
// Type T1A2 telegram: // Type T1A2 telegram:
// telegram=|DA44496A5555445588077A320200002F2F_04140000000084800114000000008280016C2124C480011400000080C280016CFFFF84810114000000808281016CFFFFC481011400000080C281016CFFFF84820114000000808282016CFFFFC482011400000080C282016CFFFF84830114000000808283016CFFFFC483011400000080C283016CFFFF84840114000000808284016CFFFFC484011400000080C284016CFFFF84850114000000808285016CFFFFC485011400000080C285016CFFFF84860114000000808286016CFFFFC486011400000080C286016CFFFF| // telegram=|DA44496A5555445588077A320200002F2F_04140000000084800114000000008280016C2124C480011400000080C280016CFFFF84810114000000808281016CFFFFC481011400000080C281016CFFFF84820114000000808282016CFFFFC482011400000080C282016CFFFF84830114000000808283016CFFFFC483011400000080C283016CFFFF84840114000000808284016CFFFFC484011400000080C284016CFFFF84850114000000808285016CFFFFC485011400000080C285016CFFFF84860114000000808286016CFFFFC486011400000080C286016CFFFF|
// {"media":"water","meter":"c5isf","name":"Heat","id":"55445555","total_energy_consumption_kwh":0,"total_volume_m3":0,"status":"ERROR","prev_1_month":"2017-04-01","prev_2_month":"2127-15-31","prev_3_month":"2127-15-31","prev_4_month":"2127-15-31","prev_5_month":"2127-15-31","prev_6_month":"2127-15-31","prev_7_month":"2127-15-31","prev_8_month":"2127-15-31","prev_9_month":"2127-15-31","prev_10_month":"2127-15-31","prev_11_month":"2127-15-31","prev_12_month":"2127-15-31","prev_13_month":"2127-15-31","prev_14_month":"2127-15-31","prev_1_month_m3":0,"prev_2_month_m3":21474836.48,"prev_3_month_m3":21474836.48,"prev_4_month_m3":21474836.48,"prev_5_month_m3":21474836.48,"prev_6_month_m3":21474836.48,"prev_7_month_m3":21474836.48,"prev_8_month_m3":21474836.48,"prev_9_month_m3":21474836.48,"prev_10_month_m3":21474836.48,"prev_11_month_m3":21474836.48,"prev_12_month_m3":21474836.48,"prev_13_month_m3":21474836.48,"prev_14_month_m3":21474836.48,"total_energy_consumption_last_month_kwh":0,"timestamp":"1111-11-11T11:11:11Z"} // {"media":"water","meter":"c5isf","name":"Heat","id":"55445555","total_energy_consumption_kwh":0,"total_volume_m3":0,"status":"ERROR","prev_1_month":"2017-04-01","prev_2_month":"2127-15-31","prev_3_month":"2127-15-31","prev_4_month":"2127-15-31","prev_5_month":"2127-15-31","prev_6_month":"2127-15-31","prev_7_month":"2127-15-31","prev_8_month":"2127-15-31","prev_9_month":"2127-15-31","prev_10_month":"2127-15-31","prev_11_month":"2127-15-31","prev_12_month":"2127-15-31","prev_13_month":"2127-15-31","prev_14_month":"2127-15-31","prev_1_month_m3":0,"prev_2_month_m3":21474836.48,"prev_3_month_m3":21474836.48,"prev_4_month_m3":21474836.48,"prev_5_month_m3":21474836.48,"prev_6_month_m3":21474836.48,"prev_7_month_m3":21474836.48,"prev_8_month_m3":21474836.48,"prev_9_month_m3":21474836.48,"prev_10_month_m3":21474836.48,"prev_11_month_m3":21474836.48,"prev_12_month_m3":21474836.48,"prev_13_month_m3":21474836.48,"prev_14_month_m3":21474836.48,"total_energy_consumption_last_month_kwh":0,"timestamp":"1111-11-11T11:11:11Z"}
// |Heat;55445555;0.000000;0.000000;ERROR;1111-11-11 11:11.11 // |Heat;55445555;0;0;ERROR;1111-11-11 11:11.11
// Type T1B telegram: // Type T1B telegram:
// telegram=|5E44496A5555445588047A0A0050052F2F_04061A0000000413C20800008404060000000082046CC121043BA4000000042D1900000002591216025DE21002FD17000084800106000000008280016CC121948001AE25000000002F2F2F2F2F2F| // telegram=|5E44496A5555445588047A0A0050052F2F_04061A0000000413C20800008404060000000082046CC121043BA4000000042D1900000002591216025DE21002FD17000084800106000000008280016CC121948001AE25000000002F2F2F2F2F2F|
// {"media":"heat","meter":"c5isf","name":"Heat","id":"55445555","total_energy_consumption_kwh":26,"total_volume_m3":2.242,"status":"OK","prev_1_month":"2022-01-01","prev_2_month":"2127-15-31","prev_3_month":"2127-15-31","prev_4_month":"2127-15-31","prev_5_month":"2127-15-31","prev_6_month":"2127-15-31","prev_7_month":"2127-15-31","prev_8_month":"2127-15-31","prev_9_month":"2127-15-31","prev_10_month":"2127-15-31","prev_11_month":"2127-15-31","prev_12_month":"2127-15-31","prev_13_month":"2127-15-31","prev_14_month":"2127-15-31","prev_1_month_kwh":0,"prev_2_month_kwh":2147483648,"prev_3_month_kwh":2147483648,"prev_4_month_kwh":2147483648,"prev_5_month_kwh":2147483648,"prev_6_month_kwh":2147483648,"prev_7_month_kwh":2147483648,"prev_8_month_kwh":2147483648,"prev_9_month_kwh":2147483648,"prev_10_month_kwh":2147483648,"prev_11_month_kwh":2147483648,"prev_12_month_kwh":2147483648,"prev_13_month_kwh":2147483648,"prev_14_month_kwh":2147483648,"prev_2_month_m3":21474836.48,"prev_3_month_m3":21474836.48,"prev_4_month_m3":21474836.48,"prev_5_month_m3":21474836.48,"prev_6_month_m3":21474836.48,"prev_7_month_m3":21474836.48,"prev_8_month_m3":21474836.48,"prev_9_month_m3":21474836.48,"prev_10_month_m3":21474836.48,"prev_11_month_m3":21474836.48,"prev_12_month_m3":21474836.48,"prev_13_month_m3":21474836.48,"prev_14_month_m3":21474836.48,"due_energy_consumption_kwh":0,"due_date":"2022-01-01","volume_flow_m3h":0.164,"power_kw":2.5,"total_energy_consumption_last_month_kwh":0,"max_power_last_month_kw":0,"flow_temperature_c":56.5,"return_temperature_c":43.22,"timestamp":"1111-11-11T11:11:11Z"} // {"media":"heat","meter":"c5isf","name":"Heat","id":"55445555","total_energy_consumption_kwh":26,"total_volume_m3":2.242,"status":"OK","prev_1_month":"2022-01-01","prev_2_month":"2127-15-31","prev_3_month":"2127-15-31","prev_4_month":"2127-15-31","prev_5_month":"2127-15-31","prev_6_month":"2127-15-31","prev_7_month":"2127-15-31","prev_8_month":"2127-15-31","prev_9_month":"2127-15-31","prev_10_month":"2127-15-31","prev_11_month":"2127-15-31","prev_12_month":"2127-15-31","prev_13_month":"2127-15-31","prev_14_month":"2127-15-31","prev_1_month_kwh":0,"prev_2_month_kwh":2147483648,"prev_3_month_kwh":2147483648,"prev_4_month_kwh":2147483648,"prev_5_month_kwh":2147483648,"prev_6_month_kwh":2147483648,"prev_7_month_kwh":2147483648,"prev_8_month_kwh":2147483648,"prev_9_month_kwh":2147483648,"prev_10_month_kwh":2147483648,"prev_11_month_kwh":2147483648,"prev_12_month_kwh":2147483648,"prev_13_month_kwh":2147483648,"prev_14_month_kwh":2147483648,"prev_2_month_m3":21474836.48,"prev_3_month_m3":21474836.48,"prev_4_month_m3":21474836.48,"prev_5_month_m3":21474836.48,"prev_6_month_m3":21474836.48,"prev_7_month_m3":21474836.48,"prev_8_month_m3":21474836.48,"prev_9_month_m3":21474836.48,"prev_10_month_m3":21474836.48,"prev_11_month_m3":21474836.48,"prev_12_month_m3":21474836.48,"prev_13_month_m3":21474836.48,"prev_14_month_m3":21474836.48,"due_energy_consumption_kwh":0,"due_date":"2022-01-01","volume_flow_m3h":0.164,"power_kw":2.5,"total_energy_consumption_last_month_kwh":0,"max_power_last_month_kw":0,"flow_temperature_c":56.5,"return_temperature_c":43.22,"timestamp":"1111-11-11T11:11:11Z"}
// |Heat;55445555;26.000000;2.242000;OK;1111-11-11 11:11.11 // |Heat;55445555;26;2.242;OK;1111-11-11 11:11.11
// Test: Heat c5isf 32002044 NOKEY // Test: Heat c5isf 32002044 NOKEY
// Test telegram with max_power_last_month_kwh which is non-zero // Test telegram with max_power_last_month_kwh which is non-zero
// telegram=|5E44496A4420003288047AFC0050052F2F_0406D00E00000413B28A05008404060000000082046CC121043B00000000042D000000000259E719025D051402FD17000084800106C00C00008280016CC125948001AE25090000002F2F2F2F2F2F| // telegram=|5E44496A4420003288047AFC0050052F2F_0406D00E00000413B28A05008404060000000082046CC121043B00000000042D000000000259E719025D051402FD17000084800106C00C00008280016CC125948001AE25090000002F2F2F2F2F2F|
// {"media":"heat","meter":"c5isf","name":"Heat","id":"32002044","total_energy_consumption_kwh":3792,"total_volume_m3":363.186,"status":"OK","prev_1_month":"2022-05-01","prev_1_month_kwh":3264,"due_energy_consumption_kwh":0,"due_date":"2022-01-01","volume_flow_m3h":0,"power_kw":0,"total_energy_consumption_last_month_kwh":3264,"max_power_last_month_kw":9,"flow_temperature_c":66.31,"return_temperature_c":51.25,"timestamp":"1111-11-11T11:11:11Z"} // {"media":"heat","meter":"c5isf","name":"Heat","id":"32002044","total_energy_consumption_kwh":3792,"total_volume_m3":363.186,"status":"OK","prev_1_month":"2022-05-01","prev_1_month_kwh":3264,"due_energy_consumption_kwh":0,"due_date":"2022-01-01","volume_flow_m3h":0,"power_kw":0,"total_energy_consumption_last_month_kwh":3264,"max_power_last_month_kw":9,"flow_temperature_c":66.31,"return_temperature_c":51.25,"timestamp":"1111-11-11T11:11:11Z"}
// |Heat;32002044;3792.000000;363.186000;OK;1111-11-11 11:11.11 // |Heat;32002044;3792;363.186;OK;1111-11-11 11:11.11

Wyświetl plik

@ -44,13 +44,12 @@ namespace
addStringField( addStringField(
"status", "status",
"Meter status from tpl status field.", "Meter status from tpl status field.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT | PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS);
PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS);
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_temperature", "current_temperature",
"The current temperature.", "The current temperature.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -61,7 +60,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"average_temperature_1h", "average_temperature_1h",
"The average temperature over the last hour.", "The average temperature over the last hour.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -73,7 +72,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"battery", "battery",
"Battery status.", "Battery status.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::DigitalInput), .set(VIFRange::DigitalInput),

Wyświetl plik

@ -51,17 +51,17 @@ namespace
addPrint("total", Quantity::Energy, addPrint("total", Quantity::Energy,
[&](Unit u){ return convert(total_energy_kwh_, Unit::KWH, u); }, [&](Unit u){ return convert(total_energy_kwh_, Unit::KWH, u); },
"The total energy consumption recorded by this meter.", "The total energy consumption recorded by this meter.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("current", Quantity::Energy, addPrint("current", Quantity::Energy,
[&](Unit u){ return convert(curr_energy_kwh_, Unit::KWH, u); }, [&](Unit u){ return convert(curr_energy_kwh_, Unit::KWH, u); },
"Energy consumption so far in this billing period.", "Energy consumption so far in this billing period.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("previous", Quantity::Energy, addPrint("previous", Quantity::Energy,
[&](Unit u){ return convert(prev_energy_kwh_, Unit::KWH, u); }, [&](Unit u){ return convert(prev_energy_kwh_, Unit::KWH, u); },
"Energy consumption in previous billing period.", "Energy consumption in previous billing period.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
} }
void Driver::processContent(Telegram *t) void Driver::processContent(Telegram *t)

Wyświetl plik

@ -39,7 +39,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Status of meter.", "Status of meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT | PrintProperty::STATUS, DEFAULT_PRINT_PROPERTIES | PrintProperty::STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::ErrorFlags), .set(VIFRange::ErrorFlags),
@ -59,7 +59,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total", "total",
"The total water consumption recorded by this meter.", "The total water consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -39,7 +39,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_consumption", "total_energy_consumption",
"The total energy consumption recorded by this meter.", "The total energy consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -50,7 +50,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_power_consumption_phase1", "current_power_consumption_phase1",
"Current power consumption at phase 1.", "Current power consumption at phase 1.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -60,7 +60,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_power_consumption_phase2", "current_power_consumption_phase2",
"Current power consumption at phase 2.", "Current power consumption at phase 2.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -70,7 +70,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_power_consumption_phase3", "current_power_consumption_phase3",
"Current power consumption at phase 3.", "Current power consumption at phase 3.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -80,7 +80,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"customer", "customer",
"Customer name.", "Customer name.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Customer) .set(VIFRange::Customer)
@ -90,7 +90,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_power_consumption", "current_power_consumption",
"Calculated sum of power consumption of all phases.", "Calculated sum of power consumption of all phases.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -102,7 +102,7 @@ namespace
addNumericFieldWithCalculator( addNumericFieldWithCalculator(
"current_power_consumption", "current_power_consumption",
"Calculated sum of power consumption of all phases.", "Calculated sum of power consumption of all phases.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
"current_power_consumption_phase1_kw + current_power_consumption_phase2_kw + current_power_consumption_phase3_kw" "current_power_consumption_phase1_kw + current_power_consumption_phase2_kw + current_power_consumption_phase3_kw"
); );

Wyświetl plik

@ -38,15 +38,14 @@ namespace
addStringField( addStringField(
"status", "status",
"Meter status. Includes both meter error field and tpl status field.", "Meter status. Includes both meter error field and tpl status field.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT | PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS);
PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS);
addOptionalCommonFields("on_time_h"); addOptionalCommonFields("on_time_h");
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_consumption", "total_energy_consumption",
"The total energy consumption recorded by this meter.", "The total energy consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -57,7 +56,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_power_consumption", "current_power_consumption",
"Current power consumption.", "Current power consumption.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -68,7 +67,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_production", "total_energy_production",
"The total energy production recorded by this meter.", "The total energy production recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -27,6 +27,7 @@ namespace
static bool ok = registerDriver([](DriverInfo&di) static bool ok = registerDriver([](DriverInfo&di)
{ {
di.setName("ei6500"); di.setName("ei6500");
di.setDefaultFields("name,id,status,last_alarm_date,alarm_counter,timestamp");
di.setMeterType(MeterType::SmokeDetector); di.setMeterType(MeterType::SmokeDetector);
di.addLinkMode(LinkMode::T1); di.addLinkMode(LinkMode::T1);
di.addDetection(MANUFACTURER_EIE, 0x1a, 0x0c); di.addDetection(MANUFACTURER_EIE, 0x1a, 0x0c);
@ -45,8 +46,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Meter error flags. IMPORTANT! Smoke alarm is NOT reported here! You MUST check last alarm date and counter!", "Meter error flags. IMPORTANT! Smoke alarm is NOT reported here! You MUST check last alarm date and counter!",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT | PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS,
PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(VIFRange::ErrorFlags), .set(VIFRange::ErrorFlags),
Translate::Lookup( Translate::Lookup(
@ -77,7 +77,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"last_alarm_date", "last_alarm_date",
"Date when the smoke alarm last triggered.", "Date when the smoke alarm last triggered.",
PrintProperty::FIELD | PrintProperty::JSON | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(SubUnitNr(1)) .set(SubUnitNr(1))
@ -88,7 +88,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"alarm", "alarm",
"Number of times the smoke alarm has triggered.", "Number of times the smoke alarm has triggered.",
PrintProperty::FIELD | PrintProperty::JSON | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Counter, Quantity::Counter,
VifScaling::None, VifScaling::None,
FieldMatcher::build() FieldMatcher::build()
@ -101,7 +101,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"software_version", "software_version",
"Meter software version number.", "Meter software version number.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::SoftwareVersion) .set(VIFRange::SoftwareVersion)
@ -110,7 +110,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"message_datetime", "message_datetime",
"Device date time.", "Device date time.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::DateTime) .set(VIFRange::DateTime)
@ -119,7 +119,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"duration_removed", "duration_removed",
"Time the smoke alarm has been removed.", "Time the smoke alarm has been removed.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Time, Quantity::Time,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -132,7 +132,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"last_remove_date", "last_remove_date",
"Date when the smoke alarm was last removed.", "Date when the smoke alarm was last removed.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(SubUnitNr(1)) .set(SubUnitNr(1))
@ -143,7 +143,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"removed", "removed",
"Number of times the smoke alarm has been removed.", "Number of times the smoke alarm has been removed.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Counter, Quantity::Counter,
VifScaling::None, VifScaling::None,
FieldMatcher::build() FieldMatcher::build()
@ -156,7 +156,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"test_button_last_date", "test_button_last_date",
"Date when test button was last pressed.", "Date when test button was last pressed.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(SubUnitNr(1)) .set(SubUnitNr(1))
@ -167,7 +167,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"test_button", "test_button",
"Number of times the test button has been pressed.", "Number of times the test button has been pressed.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Counter, Quantity::Counter,
VifScaling::None, VifScaling::None,
FieldMatcher::build() FieldMatcher::build()
@ -180,7 +180,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"installation_date", "installation_date",
"Date when the smoke alarm was installed.", "Date when the smoke alarm was installed.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(TariffNr(2)) .set(TariffNr(2))
@ -190,7 +190,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"last_sound_check_date", "last_sound_check_date",
"Date when the smoke alarm last checked the piezo speaker.", "Date when the smoke alarm last checked the piezo speaker.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(StorageNr(1)) .set(StorageNr(1))
@ -200,7 +200,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"dust_level", "dust_level",
"Dust level 0 (best) to 15 (worst).", "Dust level 0 (best) to 15 (worst).",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("8440FF2C")), .set(DifVifKey("8440FF2C")),
Translate::Lookup( Translate::Lookup(
@ -220,7 +220,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"battery_level", "battery_level",
"Battery voltage level.", "Battery voltage level.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("8440FF2C")), .set(DifVifKey("8440FF2C")),
Translate::Lookup( Translate::Lookup(
@ -259,7 +259,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"obstacle_distance", "obstacle_distance",
"The distance to a detected obstacle.", "The distance to a detected obstacle.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("8440FF2C")), .set(DifVifKey("8440FF2C")),
Translate::Lookup( Translate::Lookup(
@ -289,7 +289,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"head_status", "head_status",
"Status of smoke detector sensors, merged into the status field.", "Status of smoke detector sensors, merged into the status field.",
PrintProperty::JOIN_INTO_STATUS, PrintProperty::INJECT_INTO_STATUS | PrintProperty::HIDE,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("8440FF2C")), .set(DifVifKey("8440FF2C")),
Translate::Lookup( Translate::Lookup(
@ -329,16 +329,16 @@ namespace
// Test: Smokey ei6500 01097274 NOKEY // Test: Smokey ei6500 01097274 NOKEY
// telegram=|58442515747209010C1A7A8B0000000BFD0F070101046D2A06D82502FD17000082206CD825426CD0238440FF2C000F11008250FD61000082506C01018260FD6100008360FD3100000082606C01018270FD61000082706C0101| // telegram=|58442515747209010C1A7A8B0000000BFD0F070101046D2A06D82502FD17000082206CD825426CD0238440FF2C000F11008250FD61000082506C01018260FD6100008360FD3100000082606C01018270FD61000082706C0101|
// {"media":"smoke detector","meter":"ei6500","name":"Smokey","id":"01097274","status":"OK","last_alarm_date":"2000-01-01","alarm_counter":0,"software_version":"010107","message_datetime":"2022-05-24 06:42","duration_removed_h":0,"last_remove_date":"2000-01-01","removed_counter":0,"test_button_last_date":"2000-01-01","test_button_counter":0,"installation_date":"2022-05-24","last_sound_check_date":"2022-03-16","dust_level":"DUST_0","battery_level":"3.00V","obstacle_distance":"","timestamp":"1111-11-11T11:11:11Z"} // {"media":"smoke detector","meter":"ei6500","name":"Smokey","id":"01097274","status":"OK","last_alarm_date":"2000-01-01","alarm_counter":0,"software_version":"010107","message_datetime":"2022-05-24 06:42","duration_removed_h":0,"last_remove_date":"2000-01-01","removed_counter":0,"test_button_last_date":"2000-01-01","test_button_counter":0,"installation_date":"2022-05-24","last_sound_check_date":"2022-03-16","dust_level":"DUST_0","battery_level":"3.00V","obstacle_distance":"","timestamp":"1111-11-11T11:11:11Z"}
// |Smokey;01097274;OK;2000-01-01;0.000000;1111-11-11 11:11.11 // |Smokey;01097274;OK;2000-01-01;0;1111-11-11 11:11.11
// telegram=|58442515747209010C1A7A8D0000000BFD0F070101046D2E06D82502FD17000082206CD825426CD0238440FF2C000F11008250FD61000082506C01018260FD6100008360FD3100000082606C01018270FD61020082706CD825| // telegram=|58442515747209010C1A7A8D0000000BFD0F070101046D2E06D82502FD17000082206CD825426CD0238440FF2C000F11008250FD61000082506C01018260FD6100008360FD3100000082606C01018270FD61020082706CD825|
// {"media":"smoke detector","meter":"ei6500","name":"Smokey","id":"01097274","status":"OK","last_alarm_date":"2000-01-01","alarm_counter":0,"software_version":"010107","message_datetime":"2022-05-24 06:46","duration_removed_h":0,"last_remove_date":"2000-01-01","removed_counter":0,"test_button_last_date":"2022-05-24","test_button_counter":2,"installation_date":"2022-05-24","last_sound_check_date":"2022-03-16","dust_level":"DUST_0","battery_level":"3.00V","obstacle_distance":"","timestamp":"1111-11-11T11:11:11Z"} // {"media":"smoke detector","meter":"ei6500","name":"Smokey","id":"01097274","status":"OK","last_alarm_date":"2000-01-01","alarm_counter":0,"software_version":"010107","message_datetime":"2022-05-24 06:46","duration_removed_h":0,"last_remove_date":"2000-01-01","removed_counter":0,"test_button_last_date":"2022-05-24","test_button_counter":2,"installation_date":"2022-05-24","last_sound_check_date":"2022-03-16","dust_level":"DUST_0","battery_level":"3.00V","obstacle_distance":"","timestamp":"1111-11-11T11:11:11Z"}
// |Smokey;01097274;OK;2000-01-01;0.000000;1111-11-11 11:11.11 // |Smokey;01097274;OK;2000-01-01;0;1111-11-11 11:11.11
// telegram=|58442515747209010C1A7A900000000BFD0F070101046D3406D82502FD17000082206CD825426CD0238440FF2C020F11008250FD61010082506CD8258260FD6100008360FD3100000082606C01018270FD61020082706CD825| // telegram=|58442515747209010C1A7A900000000BFD0F070101046D3406D82502FD17000082206CD825426CD0238440FF2C020F11008250FD61010082506CD8258260FD6100008360FD3100000082606C01018270FD61020082706CD825|
// {"media":"smoke detector","meter":"ei6500","name":"Smokey","id":"01097274","status":"OK","last_alarm_date":"2022-05-24","alarm_counter":1,"software_version":"010107","message_datetime":"2022-05-24 06:52","duration_removed_h":0,"last_remove_date":"2000-01-01","removed_counter":0,"test_button_last_date":"2022-05-24","test_button_counter":2,"installation_date":"2022-05-24","last_sound_check_date":"2022-03-16","dust_level":"DUST_2","battery_level":"3.00V","obstacle_distance":"","timestamp":"1111-11-11T11:11:11Z"} // {"media":"smoke detector","meter":"ei6500","name":"Smokey","id":"01097274","status":"OK","last_alarm_date":"2022-05-24","alarm_counter":1,"software_version":"010107","message_datetime":"2022-05-24 06:52","duration_removed_h":0,"last_remove_date":"2000-01-01","removed_counter":0,"test_button_last_date":"2022-05-24","test_button_counter":2,"installation_date":"2022-05-24","last_sound_check_date":"2022-03-16","dust_level":"DUST_2","battery_level":"3.00V","obstacle_distance":"","timestamp":"1111-11-11T11:11:11Z"}
// |Smokey;01097274;OK;2022-05-24;1.000000;1111-11-11 11:11.11 // |Smokey;01097274;OK;2022-05-24;1;1111-11-11 11:11.11
// telegram=|58442515747209010C1A7A940000000BFD0F070101046D0007D82502FD17000082206CD825426CD0238440FF2C420F11008250FD61010082506CD8258260FD6101008360FD3101000082606CD8258270FD61020082706CD825| // telegram=|58442515747209010C1A7A940000000BFD0F070101046D0007D82502FD17000082206CD825426CD0238440FF2C420F11008250FD61010082506CD8258260FD6101008360FD3101000082606CD8258270FD61020082706CD825|
// {"media":"smoke detector","meter":"ei6500","name":"Smokey","id":"01097274","status":"TAMPER_WHILE_REMOVED","last_alarm_date":"2022-05-24","alarm_counter":1,"software_version":"010107","message_datetime":"2022-05-24 07:00","duration_removed_h":0.016667,"last_remove_date":"2022-05-24","removed_counter":1,"test_button_last_date":"2022-05-24","test_button_counter":2,"installation_date":"2022-05-24","last_sound_check_date":"2022-03-16","dust_level":"DUST_2","battery_level":"3.00V","obstacle_distance":"","timestamp":"1111-11-11T11:11:11Z"} // {"media":"smoke detector","meter":"ei6500","name":"Smokey","id":"01097274","status":"TAMPER_WHILE_REMOVED","last_alarm_date":"2022-05-24","alarm_counter":1,"software_version":"010107","message_datetime":"2022-05-24 07:00","duration_removed_h":0.016667,"last_remove_date":"2022-05-24","removed_counter":1,"test_button_last_date":"2022-05-24","test_button_counter":2,"installation_date":"2022-05-24","last_sound_check_date":"2022-03-16","dust_level":"DUST_2","battery_level":"3.00V","obstacle_distance":"","timestamp":"1111-11-11T11:11:11Z"}
// |Smokey;01097274;TAMPER_WHILE_REMOVED;2022-05-24;1.000000;1111-11-11 11:11.11 // |Smokey;01097274;TAMPER_WHILE_REMOVED;2022-05-24;1;1111-11-11 11:11.11

Wyświetl plik

@ -38,8 +38,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Meter status from manufacturer status and tpl status field.", "Meter status from manufacturer status and tpl status field.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT | PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS,
PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("047F")), .set(DifVifKey("047F")),
{ {
@ -59,7 +58,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"meter_date", "meter_date",
"The meter date.", "The meter date.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -68,7 +67,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_consumption", "total_energy_consumption",
"The total energy consumption recorded by this meter.", "The total energy consumption recorded by this meter.",
PrintProperty::FIELD | PrintProperty::JSON | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -79,7 +78,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_power_consumption", "current_power_consumption",
"Current power consumption.", "Current power consumption.",
PrintProperty::FIELD | PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -90,7 +89,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_volume", "total_volume",
"Total volume of heat media.", "Total volume of heat media.",
PrintProperty::FIELD | PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -101,7 +100,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_consumption_at_date", "total_energy_consumption_at_date",
"The total energy consumption recorded at the target date.", "The total energy consumption recorded at the target date.",
PrintProperty::FIELD | PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -113,7 +112,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"flow_temperature", "flow_temperature",
"The flow temperature.", "The flow temperature.",
PrintProperty::FIELD | PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -124,7 +123,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"return_temperature", "return_temperature",
"The return temperature.", "The return temperature.",
PrintProperty::FIELD | PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -135,7 +134,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"external_temperature", "external_temperature",
"The external temperature.", "The external temperature.",
PrintProperty::FIELD | PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -146,7 +145,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"operating_time", "operating_time",
"How long the meter has been collecting data.", "How long the meter has been collecting data.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Time, Quantity::Time,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -157,7 +156,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"version", "version",
"version.", "version.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::ModelVersion) .set(VIFRange::ModelVersion)
@ -166,7 +165,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"battery", "battery",
"Battery voltage.", "Battery voltage.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Voltage, Quantity::Voltage,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -44,7 +44,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Status of meter.", "Status of meter.",
PrintProperty::JSON | PrintProperty::IMPORTANT | PrintProperty::STATUS, DEFAULT_PRINT_PROPERTIES | PrintProperty::STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::ErrorFlags), .set(VIFRange::ErrorFlags),
@ -71,7 +71,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"error", "error",
"Any errors currently being reported, this field is deprecated and replaced by the status field.", "Any errors currently being reported, this field is deprecated and replaced by the status field.",
PrintProperty::JSON | PrintProperty::IMPORTANT | PrintProperty::DEPRECATED, DEFAULT_PRINT_PROPERTIES | PrintProperty::DEPRECATED,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::ErrorFlags), .set(VIFRange::ErrorFlags),
@ -98,7 +98,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_consumption", "total_energy_consumption",
"The total energy consumption recorded by this meter.", "The total energy consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -109,7 +109,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_production", "total_energy_production",
"The total energy backward (production) recorded by this meter.", "The total energy backward (production) recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -121,7 +121,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_reactive_energy_consumption", "total_reactive_energy_consumption",
"The reactive total energy consumption recorded by this meter.", "The reactive total energy consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Reactive_Energy, Quantity::Reactive_Energy,
VifScaling::None, VifScaling::None,
FieldMatcher::build() FieldMatcher::build()
@ -131,7 +131,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_reactive_energy_production", "total_reactive_energy_production",
"The total reactive energy backward (production) recorded by this meter.", "The total reactive energy backward (production) recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Reactive_Energy, Quantity::Reactive_Energy,
VifScaling::None, VifScaling::None,
FieldMatcher::build() FieldMatcher::build()
@ -142,7 +142,7 @@ namespace
addNumericFieldWithCalculator( addNumericFieldWithCalculator(
"total_apparent_energy_consumption", "total_apparent_energy_consumption",
"Calculated: the total apparent energy consumption.", "Calculated: the total apparent energy consumption.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Apparent_Energy, Quantity::Apparent_Energy,
"sqrt(" "sqrt("
" (total_energy_consumption_kwh * total_energy_consumption_kwh) " " (total_energy_consumption_kwh * total_energy_consumption_kwh) "
@ -153,7 +153,7 @@ namespace
addNumericFieldWithCalculator( addNumericFieldWithCalculator(
"total_apparent_energy_production", "total_apparent_energy_production",
"Calculated: the total apparent energy production.", "Calculated: the total apparent energy production.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Apparent_Energy, Quantity::Apparent_Energy,
R"STR( R"STR(
sqrt( (total_energy_production_kwh * total_energy_production_kwh) + sqrt( (total_energy_production_kwh * total_energy_production_kwh) +

Wyświetl plik

@ -40,7 +40,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total", "total",
"The total water consumption recorded by this meter.", "The total water consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -51,7 +51,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"target", "target",
"The target water consumption recorded at previous period.", "The target water consumption recorded at previous period.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -62,7 +62,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"target_date", "target_date",
"Date when previous period ended.", "Date when previous period ended.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)

Wyświetl plik

@ -26,6 +26,7 @@ namespace
static bool ok = registerDriver([](DriverInfo&di) static bool ok = registerDriver([](DriverInfo&di)
{ {
di.setName("enercal"); di.setName("enercal");
di.setDefaultFields("name,id,status,total_kwh,target_kwh,total_m3,target_m3,timestamp");
di.setMeterType(MeterType::HeatMeter); di.setMeterType(MeterType::HeatMeter);
di.addLinkMode(LinkMode::MBUS); di.addLinkMode(LinkMode::MBUS);
di.addDetection(MANUFACTURER_GWF, 0x04, 0x08); di.addDetection(MANUFACTURER_GWF, 0x04, 0x08);
@ -37,13 +38,12 @@ namespace
addStringField( addStringField(
"status", "status",
"Meter status.", "Meter status.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT | PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS);
PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS);
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total", "total",
"The total energy consumption recorded by this meter.", "The total energy consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -54,7 +54,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"target", "target",
"The energy consumption recorded by this meter at the set date.", "The energy consumption recorded by this meter at the set date.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -66,7 +66,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"power", "power",
"The active power consumption.", "The active power consumption.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -77,7 +77,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"flow", "flow",
"The flow of water.", "The flow of water.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Flow, Quantity::Flow,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -88,7 +88,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"flow_max", "flow_max",
"The maximum forward flow of water since the last set date?", "The maximum forward flow of water since the last set date?",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Flow, Quantity::Flow,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -99,7 +99,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"forward", "forward",
"The forward temperature of the water.", "The forward temperature of the water.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -110,7 +110,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"return", "return",
"The return temperature of the water.", "The return temperature of the water.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -121,7 +121,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"difference", "difference",
"The temperature difference forward-return for the water.", "The temperature difference forward-return for the water.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::AutoSigned, VifScaling::AutoSigned,
FieldMatcher::build() FieldMatcher::build()
@ -132,7 +132,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total", "total",
"The total amount of water that has passed through this meter.", "The total amount of water that has passed through this meter.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -143,7 +143,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"target", "target",
"The amount of water that had passed through this meter at the set date.", "The amount of water that had passed through this meter at the set date.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -155,7 +155,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"subunit1", "subunit1",
"The amount of water that has passed through subunit 1.", "The amount of water that has passed through subunit 1.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -167,7 +167,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"subunit1_target", "subunit1_target",
"The amount of water that had passed through the subunit 1 at the set date.", "The amount of water that had passed through the subunit 1 at the set date.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -180,7 +180,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"subunit1", "subunit1",
"The current heat cost allocation for subunit 1.", "The current heat cost allocation for subunit 1.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::HCA, Quantity::HCA,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -192,7 +192,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"subunit1_target", "subunit1_target",
"The heat cost allocation for subunit 1 at the target date.", "The heat cost allocation for subunit 1 at the target date.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::HCA, Quantity::HCA,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -205,7 +205,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"subunit2", "subunit2",
"The current heat cost allocation for subunit 2.", "The current heat cost allocation for subunit 2.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::HCA, Quantity::HCA,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -217,7 +217,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"subunit2_target", "subunit2_target",
"The heat cost allocation for subunit 2 at the target date.", "The heat cost allocation for subunit 2 at the target date.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::HCA, Quantity::HCA,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -230,7 +230,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"target_date", "target_date",
"The most recent billing period date.", "The most recent billing period date.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -245,4 +245,4 @@ namespace
// Comment: // Comment:
// telegram=|688e8e6808017224993000e61e080406000000040681460600041488f2350084401426e02600025B2600025f220002622a00042247880200042647880200043B00000000042c00000000046d2d0ede2784406e000000008480406e00000000c4800006B1450600c48000143Be43500c4c000142fd22600c4c0006e00000000c480406e00000000c280006cc1271f00000000f416| // telegram=|688e8e6808017224993000e61e080406000000040681460600041488f2350084401426e02600025B2600025f220002622a00042247880200042647880200043B00000000042c00000000046d2d0ede2784406e000000008480406e00000000c4800006B1450600c48000143Be43500c4c000142fd22600c4c0006e00000000c480406e00000000c280006cc1271f00000000f416|
// {"media":"heat","meter":"enercal","name":"Heat","id":"00309924","status":"OK","total_kwh":411265,"target_kwh":411057,"power_kw":0,"flow_m3h":0,"forward_c":38,"return_c":34,"difference_c":4.2,"total_m3":35354.96,"target_m3":35318.35,"subunit1_m3":25477.5,"subunit1_target_m3":25441.75,"subunit1_hca":0,"subunit1_target_hca":0,"subunit2_hca":0,"subunit2_target_hca":0,"target_date":"2022-07-01","operating_time_h":165959,"on_time_h":165959,"meter_datetime":"2022-07-30 14:45","timestamp":"1111-11-11T11:11:11Z"} // {"media":"heat","meter":"enercal","name":"Heat","id":"00309924","status":"OK","total_kwh":411265,"target_kwh":411057,"power_kw":0,"flow_m3h":0,"forward_c":38,"return_c":34,"difference_c":4.2,"total_m3":35354.96,"target_m3":35318.35,"subunit1_m3":25477.5,"subunit1_target_m3":25441.75,"subunit1_hca":0,"subunit1_target_hca":0,"subunit2_hca":0,"subunit2_target_hca":0,"target_date":"2022-07-01","operating_time_h":165959,"on_time_h":165959,"meter_datetime":"2022-07-30 14:45","timestamp":"1111-11-11T11:11:11Z"}
// |Heat;00309924;OK;411265.000000;411057.000000;35354.960000;35318.350000;1111-11-11 11:11.11 // |Heat;00309924;OK;411265;411057;35354.96;35318.35;1111-11-11 11:11.11

Wyświetl plik

@ -27,7 +27,7 @@ namespace
static bool ok = registerDriver([](DriverInfo&di) static bool ok = registerDriver([](DriverInfo&di)
{ {
di.setName("engelmann-faw"); di.setName("engelmann-faw");
di.setMeterType(MeterType::WaterMeter); di.setDefaultFields("name,id,status,reporting_date,consumption_at_reporting_date_m3,timestamp");
di.addLinkMode(LinkMode::T1); di.addLinkMode(LinkMode::T1);
di.addDetection(MANUFACTURER_EFE, 0x07, 0x00); di.addDetection(MANUFACTURER_EFE, 0x07, 0x00);
di.setConstructor([](MeterInfo& mi, DriverInfo& di){ return shared_ptr<Meter>(new Driver(mi, di)); }); di.setConstructor([](MeterInfo& mi, DriverInfo& di){ return shared_ptr<Meter>(new Driver(mi, di)); });
@ -39,7 +39,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Status and error flags.", "Status and error flags.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS, DEFAULT_PRINT_PROPERTIES | PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(VIFRange::ErrorFlags), .set(VIFRange::ErrorFlags),
{ {
@ -66,7 +66,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"reporting_date", "reporting_date",
"The reporting date of the last billing period.", "The reporting date of the last billing period.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -76,7 +76,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"consumption_at_reporting_date", "consumption_at_reporting_date",
"The water consumption at the last billing period date.", "The water consumption at the last billing period date.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -93,7 +93,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
name, name,
info, info,
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -108,4 +108,4 @@ namespace
// Test: Wasserzaehler engelmann-faw 43000255 NOKEY // Test: Wasserzaehler engelmann-faw 43000255 NOKEY
// telegram=|8f44c5145502004301077260402520c51400076b0000002f2f426cbf2c441322e9000001fd17008401133c340100c40113ae2d010084021303290100c402137e21010084031313180100c403138a0e010084041337060100c40413b2fc00008405139af30000c4051322e90000840613c1df0000c40613cdd5000084071365ce0000c407136dc500008408138dbf0000| // telegram=|8f44c5145502004301077260402520c51400076b0000002f2f426cbf2c441322e9000001fd17008401133c340100c40113ae2d010084021303290100c402137e21010084031313180100c403138a0e010084041337060100c40413b2fc00008405139af30000c4051322e90000840613c1df0000c40613cdd5000084071365ce0000c407136dc500008408138dbf0000|
// {"media":"water","meter":"engelmann-faw","name":"Wasserzaehler","id":"20254060","status":"OK","reporting_date":"2021-12-31","consumption_at_reporting_date_m3":59.682,"consumption_1_months_ago_m3":78.908,"consumption_2_months_ago_m3":77.23,"consumption_3_months_ago_m3":76.035,"consumption_4_months_ago_m3":74.11,"consumption_5_months_ago_m3":71.699,"consumption_6_months_ago_m3":69.258,"consumption_7_months_ago_m3":67.127,"consumption_8_months_ago_m3":64.69,"consumption_9_months_ago_m3":62.362,"consumption_10_months_ago_m3":59.682,"consumption_11_months_ago_m3":57.281,"consumption_12_months_ago_m3":54.733,"consumption_13_months_ago_m3":52.837,"consumption_14_months_ago_m3":50.541,"consumption_15_months_ago_m3":49.037,"timestamp":"1111-11-11T11:11:11Z"} // {"media":"water","meter":"engelmann-faw","name":"Wasserzaehler","id":"20254060","status":"OK","reporting_date":"2021-12-31","consumption_at_reporting_date_m3":59.682,"consumption_1_months_ago_m3":78.908,"consumption_2_months_ago_m3":77.23,"consumption_3_months_ago_m3":76.035,"consumption_4_months_ago_m3":74.11,"consumption_5_months_ago_m3":71.699,"consumption_6_months_ago_m3":69.258,"consumption_7_months_ago_m3":67.127,"consumption_8_months_ago_m3":64.69,"consumption_9_months_ago_m3":62.362,"consumption_10_months_ago_m3":59.682,"consumption_11_months_ago_m3":57.281,"consumption_12_months_ago_m3":54.733,"consumption_13_months_ago_m3":52.837,"consumption_14_months_ago_m3":50.541,"consumption_15_months_ago_m3":49.037,"timestamp":"1111-11-11T11:11:11Z"}
// |Wasserzaehler;20254060;OK;2021-12-31;59.682000;1111-11-11 11:11.11 // |Wasserzaehler;20254060;OK;2021-12-31;59.682;1111-11-11 11:11.11

Wyświetl plik

@ -42,7 +42,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"location_hex", "location_hex",
"Meter installed at this customer location. Deprecate field.", "Meter installed at this customer location. Deprecate field.",
PrintProperty::JSON | PrintProperty::OPTIONAL | PrintProperty::DEPRECATED, DEFAULT_PRINT_PROPERTIES | PrintProperty::DEPRECATED,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Location) .set(VIFRange::Location)
@ -51,7 +51,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_consumption", "total_energy_consumption",
"The total energy consumption recorded by this meter.", "The total energy consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -62,7 +62,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_power_consumption", "current_power_consumption",
"Calculated sum of power consumption of all phases.", "Calculated sum of power consumption of all phases.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -73,7 +73,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_production", "total_energy_production",
"The total energy production recorded by this meter.", "The total energy production recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -85,7 +85,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_consumption_tariff1", "total_energy_consumption_tariff1",
"The total energy consumption recorded by this meter on tariff 1.", "The total energy consumption recorded by this meter on tariff 1.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -97,7 +97,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_consumption_tariff2", "total_energy_consumption_tariff2",
"The total energy consumption recorded by this meter on tariff 2.", "The total energy consumption recorded by this meter on tariff 2.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -109,7 +109,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_power_consumption_phase1", "current_power_consumption_phase1",
"Current power consumption phase 1.", "Current power consumption phase 1.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -119,7 +119,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_power_consumption_phase2", "current_power_consumption_phase2",
"Current power consumption phase 2.", "Current power consumption phase 2.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -129,7 +129,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_power_consumption_phase3", "current_power_consumption_phase3",
"Current power consumption phase 3.", "Current power consumption phase 3.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -139,7 +139,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"version", "version",
"Static version information.", "Static version information.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(DifVifKey("0DFD09")) .set(DifVifKey("0DFD09"))
@ -151,7 +151,7 @@ namespace
// Test: Elen2 esyswm 77997799 NOKEY // Test: Elen2 esyswm 77997799 NOKEY
// Comment: Static telegram // Comment: Static telegram
// telegram=|7B4479169977997730378C208B900F002C25E4EF0A002EA98E7D58B3ADC57299779977991611028B005087102F2F#0DFD090F34302e3030562030303030303030300D790E31323334353637383839595345310DFD100AAAAAAAAAAAAAAAAAAAAA0D780E31323334353637383930594553312F2F2F2F2F2F2F2F2F2F2F| // telegram=|7B4479169977997730378C208B900F002C25E4EF0A002EA98E7D58B3ADC57299779977991611028B005087102F2F#0DFD090F34302e3030562030303030303030300D790E31323334353637383839595345310DFD100AAAAAAAAAAAAAAAAAAAAA0D780E31323334353637383930594553312F2F2F2F2F2F2F2F2F2F2F|
// {"media":"electricity","meter":"esyswm","name":"Elen2","id":"77997799","fabrication_no":"1SEY0987654321","enhanced_id":"1ESY9887654321","location":"AAAAAAAAAAAAAAAAAAAA","location_hex":"AAAAAAAAAAAAAAAAAAAA","total_energy_consumption_kwh":null,"current_power_consumption_kw":null,"total_energy_production_kwh":null,"total_energy_consumption_tariff1_kwh":null,"total_energy_consumption_tariff2_kwh":null,"current_power_consumption_phase1_kw":null,"current_power_consumption_phase2_kw":null,"current_power_consumption_phase3_kw":null,"version":"00000000 V00.04","timestamp":"1111-11-11T11:11:11Z"} // {"media":"electricity","meter":"esyswm","name":"Elen2","id":"77997799","fabrication_no":"1SEY0987654321","enhanced_id":"1ESY9887654321","location":"AAAAAAAAAAAAAAAAAAAA","location_hex":"AAAAAAAAAAAAAAAAAAAA","version":"00000000 V00.04","timestamp":"1111-11-11T11:11:11Z"}
// |Elen2;77997799;null;null;null;null;null;null;null;null;1ESY9887654321;1111-11-11 11:11.11 // |Elen2;77997799;null;null;null;null;null;null;null;null;1ESY9887654321;1111-11-11 11:11.11
// Comment: Dynamic telegram // Comment: Dynamic telegram

Wyświetl plik

@ -39,8 +39,8 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Meter status from error flags and tpl status field.", "Meter status from error flags and tpl status field.",
PrintProperty::JSON | PrintProperty::IMPORTANT | DEFAULT_PRINT_PROPERTIES |
PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS, PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::ErrorFlags), .set(VIFRange::ErrorFlags),
@ -67,8 +67,8 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"error_flags", "error_flags",
"Deprecated field! Use status instead.", "Deprecated field! Use status instead.",
PrintProperty::JSON | PrintProperty::DEPRECATED | DEFAULT_PRINT_PROPERTIES | PrintProperty::DEPRECATED |
PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS, PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::ErrorFlags), .set(VIFRange::ErrorFlags),
@ -95,7 +95,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_consumption", "current_consumption",
"The current heat cost allocation.", "The current heat cost allocation.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::HCA, Quantity::HCA,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -106,7 +106,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"consumption_at_set_date_{storage_counter}", "consumption_at_set_date_{storage_counter}",
"The heat cost allocation at set date #.", "The heat cost allocation at set date #.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::HCA, Quantity::HCA,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -118,7 +118,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"consumption_at_set_date", "consumption_at_set_date",
"Deprecated field.", "Deprecated field.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::HCA, Quantity::HCA,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -40,7 +40,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total", "total",
"The total water consumption recorded by this meter.", "The total water consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -51,7 +51,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"target", "target",
"The target water consumption recorded at previous period.", "The target water consumption recorded at previous period.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -40,8 +40,8 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"current_status", "current_status",
"Status of meter.", "Status of meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT DEFAULT_PRINT_PROPERTIES
| PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS, | PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::ErrorFlags), .set(VIFRange::ErrorFlags),
@ -65,7 +65,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"consumption_at_set_date", "consumption_at_set_date",
"The total water consumption at the most recent billing period date.", "The total water consumption at the most recent billing period date.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -77,7 +77,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"set_date", "set_date",
"The most recent billing period date.", "The most recent billing period date.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -87,7 +87,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"consumption_at_set_date_2", "consumption_at_set_date_2",
"The total water consumption at the second most recent billing period date.", "The total water consumption at the second most recent billing period date.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -99,7 +99,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"set_date_2", "set_date_2",
"The second most recent billing period date.", "The second most recent billing period date.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -109,7 +109,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"max_flow_since_datetime", "max_flow_since_datetime",
"Maximum water flow since date time.", "Maximum water flow since date time.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Flow, Quantity::Flow,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -121,7 +121,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"max_flow_datetime", "max_flow_datetime",
"The datetime to which maximum flow is measured.", "The datetime to which maximum flow is measured.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::DateTime) .set(VIFRange::DateTime)
@ -131,7 +131,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"consumption_at_history_{storage_counter-7counter}", "consumption_at_history_{storage_counter-7counter}",
"The total water consumption at the historic date.", "The total water consumption at the historic date.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -143,7 +143,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"history_reference", "history_reference",
"Reference date for history.", "Reference date for history.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::PointInTime, Quantity::PointInTime,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -156,7 +156,7 @@ namespace
addNumericFieldWithCalculatorAndMatcher( addNumericFieldWithCalculatorAndMatcher(
"history_{storage_counter-7counter}", "history_{storage_counter-7counter}",
"The historic date #.", "The historic date #.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::PointInTime, Quantity::PointInTime,
"history_reference_date - ((storage_counter-8counter) * 1 month)", "history_reference_date - ((storage_counter-8counter) * 1 month)",
FieldMatcher::build() FieldMatcher::build()
@ -169,7 +169,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"device_date_time", "device_date_time",
"Date and time when the meter sent the telegram.", "Date and time when the meter sent the telegram.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::DateTime) .set(VIFRange::DateTime)

Wyświetl plik

@ -45,6 +45,7 @@ namespace
static bool ok = registerDriver([](DriverInfo&di) static bool ok = registerDriver([](DriverInfo&di)
{ {
di.setName("fhkvdataiii"); di.setName("fhkvdataiii");
di.setDefaultFields("name,id,current_hca,current_date,previous_hca,previous_date,temp_room_c,temp_radiator_c,timestamp");
di.setMeterType(MeterType::HeatCostAllocationMeter); di.setMeterType(MeterType::HeatCostAllocationMeter);
di.addLinkMode(LinkMode::T1); di.addLinkMode(LinkMode::T1);
di.addDetection(MANUFACTURER_TCH, 0x80, 0x69); di.addDetection(MANUFACTURER_TCH, 0x80, 0x69);
@ -58,32 +59,32 @@ namespace
addPrint("current", Quantity::HCA, addPrint("current", Quantity::HCA,
[&](Unit u){ return currentPeriodEnergyConsumption(u); }, [&](Unit u){ return currentPeriodEnergyConsumption(u); },
"Energy consumption so far in this billing period.", "Energy consumption so far in this billing period.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("current_date", Quantity::Text, addPrint("current_date", Quantity::Text,
[&](){ return currentPeriodDate(); }, [&](){ return currentPeriodDate(); },
"Date of current billing period.", "Date of current billing period.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("previous", Quantity::HCA, addPrint("previous", Quantity::HCA,
[&](Unit u){ return previousPeriodEnergyConsumption(u); }, [&](Unit u){ return previousPeriodEnergyConsumption(u); },
"Energy consumption in previous billing period.", "Energy consumption in previous billing period.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("previous_date", Quantity::Text, addPrint("previous_date", Quantity::Text,
[&](){ return previousPeriodDate(); }, [&](){ return previousPeriodDate(); },
"Date of last billing period.", "Date of last billing period.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("temp_room", Quantity::Temperature, addPrint("temp_room", Quantity::Temperature,
[&](Unit u){ return currentRoomTemperature(u); }, [&](Unit u){ return currentRoomTemperature(u); },
"Current room temperature.", "Current room temperature.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("temp_radiator", Quantity::Temperature, addPrint("temp_radiator", Quantity::Temperature,
[&](Unit u){ return currentRadiatorTemperature(u); }, [&](Unit u){ return currentRadiatorTemperature(u); },
"Current radiator temperature.", "Current radiator temperature.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
} }
double Driver::currentPeriodEnergyConsumption(Unit u) double Driver::currentPeriodEnergyConsumption(Unit u)
@ -229,11 +230,11 @@ namespace
// Test: Room fhkvdataiii 11776622 NOKEY // Test: Room fhkvdataiii 11776622 NOKEY
// Comment: There is a problem in the decoding here, the data stored inside the telegram does not seem to properly encode/decode the year.... We should not report a current_date with a full year, if the year is actually not part of the telegram. // Comment: There is a problem in the decoding here, the data stored inside the telegram does not seem to properly encode/decode the year.... We should not report a current_date with a full year, if the year is actually not part of the telegram.
// telegram=|31446850226677116980A0119F27020480048300C408F709143C003D341A2B0B2A0707000000000000062D114457563D71A1850000| // telegram=|31446850226677116980A0119F27020480048300C408F709143C003D341A2B0B2A0707000000000000062D114457563D71A1850000|
// {"media":"heat cost allocator","meter":"fhkvdataiii","name":"Room","id":"11776622","current_hca":131,"current_date":"2022-02-08T02:00:00Z","previous_hca":1026,"previous_date":"2019-12-31T02:00:00Z","temp_room_c":22.44,"temp_radiator_c":25.51,"timestamp":"1111-11-11T11:11:11Z"} // {"media":"heat cost allocator","meter":"fhkvdataiii","name":"Room","id":"11776622","current_hca":131,"current_date":"2023-02-08T02:00:00Z","previous_hca":1026,"previous_date":"2019-12-31T02:00:00Z","temp_room_c":22.44,"temp_radiator_c":25.51,"timestamp":"1111-11-11T11:11:11Z"}
// |Room;11776622;131.000000;2022-02-08T02:00:00Z;1026.000000;2019-12-31T02:00:00Z;22.440000;25.510000;1111-11-11 11:11.11 // |Room;11776622;131;2023-02-08T02:00:00Z;1026;2019-12-31T02:00:00Z;22.44;25.51;1111-11-11 11:11.11
// Test: Rooom fhkvdataiii 11111234 NOKEY // Test: Rooom fhkvdataiii 11111234 NOKEY
// Comment: FHKV radio 4 / EHKV vario 4 There is a problem in the decoding here, the data stored inside the telegram does not seem to properly encode/decode the year.... We should not report a current_date with a full year, if the year is actually not part of the telegram. // Comment: FHKV radio 4 / EHKV vario 4 There is a problem in the decoding here, the data stored inside the telegram does not seem to properly encode/decode the year.... We should not report a current_date with a full year, if the year is actually not part of the telegram.
// telegram=|33446850341211119480A2_0F9F292D005024040011BD08380904000000070000000000000000000000000001000000000003140E| // telegram=|33446850341211119480A2_0F9F292D005024040011BD08380904000000070000000000000000000000000001000000000003140E|
// {"media":"heat cost allocator","meter":"fhkvdataiii","name":"Rooom","id":"11111234","current_hca":4,"current_date":"2022-02-05T02:00:00Z","previous_hca":45,"previous_date":"2020-12-31T02:00:00Z","temp_room_c":22.37,"temp_radiator_c":23.6,"timestamp":"1111-11-11T11:11:11Z"} // {"media":"heat cost allocator","meter":"fhkvdataiii","name":"Rooom","id":"11111234","current_hca":4,"current_date":"2023-02-05T02:00:00Z","previous_hca":45,"previous_date":"2020-12-31T02:00:00Z","temp_room_c":22.37,"temp_radiator_c":23.6,"timestamp":"1111-11-11T11:11:11Z"}
// |Rooom;11111234;4.000000;2022-02-05T02:00:00Z;45.000000;2020-12-31T02:00:00Z;22.370000;23.600000;1111-11-11 11:11.11 // |Rooom;11111234;4;2023-02-05T02:00:00Z;45;2020-12-31T02:00:00Z;22.37;23.6;1111-11-11 11:11.11

Wyświetl plik

@ -42,13 +42,13 @@ namespace
addStringField( addStringField(
"status", "status",
"Meter status from tpl status field.", "Meter status from tpl status field.",
PrintProperty::JSON | PrintProperty::IMPORTANT | DEFAULT_PRINT_PROPERTIES |
PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS); PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS);
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_consumption", "current_consumption",
"The current heat cost allocation.", "The current heat cost allocation.",
PrintProperty::FIELD | PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::HCA, Quantity::HCA,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -58,7 +58,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"set_date", "set_date",
"The most recent billing period date.", "The most recent billing period date.",
PrintProperty::FIELD | PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -67,7 +67,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"consumption_at_set_date", "consumption_at_set_date",
"Heat cost allocation at the most recent billing period date.", "Heat cost allocation at the most recent billing period date.",
PrintProperty::FIELD | PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::HCA, Quantity::HCA,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -78,7 +78,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"set_date_1", "set_date_1",
"The most recent billing period date.", "The most recent billing period date.",
PrintProperty::FIELD | PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -87,7 +87,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"consumption_at_set_date_1", "consumption_at_set_date_1",
"Heat cost allocation at the most recent billing period date.", "Heat cost allocation at the most recent billing period date.",
PrintProperty::FIELD | PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::HCA, Quantity::HCA,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -98,7 +98,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"set_date_8", "set_date_8",
"The 8 billing period date.", "The 8 billing period date.",
PrintProperty::FIELD | PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -107,7 +107,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"consumption_at_set_date_8", "consumption_at_set_date_8",
"Heat cost allocation at the 8 billing period date.", "Heat cost allocation at the 8 billing period date.",
PrintProperty::FIELD | PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::HCA, Quantity::HCA,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -44,7 +44,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Status of meter. Not fully understood!", "Status of meter. Not fully understood!",
PrintProperty::JSON | PrintProperty::IMPORTANT | PrintProperty::STATUS, DEFAULT_PRINT_PROPERTIES | PrintProperty::STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("04FF23")), .set(DifVifKey("04FF23")),
{ {
@ -69,7 +69,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total", "total",
"The total water consumption recorded by this meter.", "The total water consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -80,7 +80,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"target", "target",
"The total water consumption recorded at the beginning of this month.", "The total water consumption recorded at the beginning of this month.",
PrintProperty::JSON | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -92,7 +92,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"target_date", "target_date",
"The date at the beginning of this month.", "The date at the beginning of this month.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -102,7 +102,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"flow", "flow",
"The current flow of water through the meter.", "The current flow of water through the meter.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Flow, Quantity::Flow,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -113,7 +113,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"min_flow_temperature", "min_flow_temperature",
"The water temperature.", "The water temperature.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -125,7 +125,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"max_flow_temperature", "max_flow_temperature",
"The maximum water temperature.", "The maximum water temperature.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -137,7 +137,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"min_external_temperature", "min_external_temperature",
"The external temperature outside of the meter.", "The external temperature outside of the meter.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -149,7 +149,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"max_flow", "max_flow",
"The maxium flow recorded during previous period.", "The maxium flow recorded during previous period.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Flow, Quantity::Flow,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -161,7 +161,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"min_flow", "min_flow",
"The minimum flow recorded during previous period.", "The minimum flow recorded during previous period.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Flow, Quantity::Flow,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -173,7 +173,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"max_external_temperature", "max_external_temperature",
"The maxium temperature recorded during previous period.", "The maxium temperature recorded during previous period.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -185,7 +185,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"min_external_temperature", "min_external_temperature",
"The minimum flow recorded during previous period.", "The minimum flow recorded during previous period.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -197,7 +197,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"max_flow", "max_flow",
"The maxium flow recorded during previous period.", "The maxium flow recorded during previous period.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Flow, Quantity::Flow,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -209,7 +209,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"time_dry", "time_dry",
"Amount of time the meter has been dry.", "Amount of time the meter has been dry.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("02FF20")), .set(DifVifKey("02FF20")),
{ {
@ -236,7 +236,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"time_reversed", "time_reversed",
"Amount of time the meter has been reversed.", "Amount of time the meter has been reversed.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("02FF20")), .set(DifVifKey("02FF20")),
{ {
@ -263,7 +263,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"time_leaking", "time_leaking",
"Amount of time the meter has been leaking.", "Amount of time the meter has been leaking.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("02FF20")), .set(DifVifKey("02FF20")),
{ {
@ -290,7 +290,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"time_bursting", "time_bursting",
"Amount of time the meter has been bursting.", "Amount of time the meter has been bursting.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("02FF20")), .set(DifVifKey("02FF20")),
{ {

Wyświetl plik

@ -62,7 +62,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Status of meter.", "Status of meter.",
PrintProperty::JSON | PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS, DEFAULT_PRINT_PROPERTIES | PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::ErrorFlags), .set(VIFRange::ErrorFlags),
@ -116,7 +116,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"info", "info",
"Is it a three phase or single phase meter.", "Is it a three phase or single phase meter.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::ErrorFlags), .set(VIFRange::ErrorFlags),
@ -139,7 +139,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_consumption", "total_energy_consumption",
"The total energy consumption recorded by this meter.", "The total energy consumption recorded by this meter.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -150,7 +150,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_consumption_tariff_{tariff_counter}", "total_energy_consumption_tariff_{tariff_counter}",
"The total energy consumption recorded by this meter.", "The total energy consumption recorded by this meter.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -162,7 +162,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"target", "target",
"Last day?", "Last day?",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::PointInTime, Quantity::PointInTime,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -174,7 +174,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"target_energy_consumption", "target_energy_consumption",
"Last day energy consumption?", "Last day energy consumption?",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -186,7 +186,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"target_energy_consumption_tariff_{tariff_counter}", "target_energy_consumption_tariff_{tariff_counter}",
"Last day energy consumption for tariff?", "Last day energy consumption for tariff?",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -199,7 +199,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"device", "device",
"Device date time when telegram was sent.", "Device date time when telegram was sent.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::PointInTime, Quantity::PointInTime,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -210,7 +210,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"voltage_at_phase_1", "voltage_at_phase_1",
"Voltage for single phase meter.", "Voltage for single phase meter.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Voltage, Quantity::Voltage,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -222,7 +222,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"voltage_at_phase_{subunit_counter}", "voltage_at_phase_{subunit_counter}",
"Voltage at phase L#.", "Voltage at phase L#.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Voltage, Quantity::Voltage,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -234,7 +234,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_at_phase_1", "current_at_phase_1",
"Amperage for single phase meter.", "Amperage for single phase meter.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Amperage, Quantity::Amperage,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -246,7 +246,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_at_phase_{subunit_counter}", "current_at_phase_{subunit_counter}",
"Amperage at phase L#.", "Amperage at phase L#.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Amperage, Quantity::Amperage,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -258,7 +258,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"raw_frequency", "raw_frequency",
"Raw input to frequency.", "Raw input to frequency.",
PrintProperty::JSON | PrintProperty::HIDE, DEFAULT_PRINT_PROPERTIES | PrintProperty::HIDE,
Quantity::Frequency, Quantity::Frequency,
VifScaling::None, VifScaling::None,
FieldMatcher::build() FieldMatcher::build()
@ -268,7 +268,7 @@ namespace
addNumericFieldWithCalculator( addNumericFieldWithCalculator(
"frequency", "frequency",
"Frequency of AC.", "Frequency of AC.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Frequency, Quantity::Frequency,
"raw_frequency_hz / 100 counter"); "raw_frequency_hz / 100 counter");
} }

Wyświetl plik

@ -46,13 +46,13 @@ namespace
addStringField( addStringField(
"status", "status",
"Meter status from tpl status field.", "Meter status from tpl status field.",
PrintProperty::JSON | PrintProperty::IMPORTANT | DEFAULT_PRINT_PROPERTIES |
PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS); PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS);
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_heating", "total_heating",
"The total heating energy consumption recorded by this meter.", "The total heating energy consumption recorded by this meter.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -64,7 +64,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"device", "device",
"The date time when the recording was made.", "The date time when the recording was made.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::PointInTime, Quantity::PointInTime,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -75,7 +75,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_cooling", "total_cooling",
"The total cooling energy consumption recorded by this meter.", "The total cooling energy consumption recorded by this meter.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -87,7 +87,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_heating", "total_heating",
"Total heating volume of media.", "Total heating volume of media.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -99,7 +99,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_cooling", "total_cooling",
"Total cooling volume of media.", "Total cooling volume of media.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -111,7 +111,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"c1_volume", "c1_volume",
"Supply c1 volume.", "Supply c1 volume.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -123,7 +123,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"c2_volume", "c2_volume",
"Return c2 volume.", "Return c2 volume.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -135,7 +135,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"supply_temperature", "supply_temperature",
"The supply t1 pipe temperature.", "The supply t1 pipe temperature.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -147,7 +147,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"return_temperature", "return_temperature",
"The return t2 pipe temperature.", "The return t2 pipe temperature.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -35,6 +35,7 @@ namespace
static bool ok = registerDriver([](DriverInfo&di) static bool ok = registerDriver([](DriverInfo&di)
{ {
di.setName("hydroclima"); di.setName("hydroclima");
di.setDefaultFields("name,id,current_consumption_hca,average_ambient_temperature_c,timestamp");
di.setMeterType(MeterType::HeatCostAllocationMeter); di.setMeterType(MeterType::HeatCostAllocationMeter);
di.addLinkMode(LinkMode::T1); di.addLinkMode(LinkMode::T1);
di.addDetection(MANUFACTURER_BMP, 0x08, 0x53); di.addDetection(MANUFACTURER_BMP, 0x08, 0x53);
@ -46,7 +47,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_consumption", "current_consumption",
"The current heat cost allocation.", "The current heat cost allocation.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::HCA, Quantity::HCA,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -58,25 +59,25 @@ namespace
Quantity::Temperature, Quantity::Temperature,
GET_FUNC(average_ambient_temperature_, Unit::C), GET_FUNC(average_ambient_temperature_, Unit::C),
"Average ambient temperature since this beginning of this month.", "Average ambient temperature since this beginning of this month.",
PrintProperty::JSON | PrintProperty::FIELD); DEFAULT_PRINT_PROPERTIES );
addPrint("max_ambient_temperature", addPrint("max_ambient_temperature",
Quantity::Temperature, Quantity::Temperature,
GET_FUNC(max_ambient_temperature_, Unit::C), GET_FUNC(max_ambient_temperature_, Unit::C),
"Max ambient temperature since the beginning of this month.", "Max ambient temperature since the beginning of this month.",
PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("average_ambient_temperature_last_month", addPrint("average_ambient_temperature_last_month",
Quantity::Temperature, Quantity::Temperature,
GET_FUNC(average_ambient_temperature_last_month_, Unit::C), GET_FUNC(average_ambient_temperature_last_month_, Unit::C),
"Average ambient temperature last month.", "Average ambient temperature last month.",
PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("average_heater_temperature_last_month", addPrint("average_heater_temperature_last_month",
Quantity::Temperature, Quantity::Temperature,
GET_FUNC(average_heater_temperature_last_month_, Unit::C), GET_FUNC(average_heater_temperature_last_month_, Unit::C),
"Average heater temperature last month.", "Average heater temperature last month.",
PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
} }
double toTemperature(uchar hi, uchar lo) double toTemperature(uchar hi, uchar lo)
@ -245,11 +246,11 @@ namespace
// Comment: // Comment:
// telegram=|2e44b0099861036853087a000020002F2F036E0000000F100043106A7D2C4A078F12202CB1242A06D3062100210000| // telegram=|2e44b0099861036853087a000020002F2F036E0000000F100043106A7D2C4A078F12202CB1242A06D3062100210000|
// {"media":"heat cost allocation","meter":"hydroclima","name":"HCA","id":"68036198","current_consumption_hca":0,"average_ambient_temperature_c":18.66,"max_ambient_temperature_c":47.51,"average_ambient_temperature_last_month_c":15.78,"average_heater_temperature_last_month_c":17.47,"timestamp":"1111-11-11T11:11:11Z"} // {"media":"heat cost allocation","meter":"hydroclima","name":"HCA","id":"68036198","current_consumption_hca":0,"average_ambient_temperature_c":18.66,"max_ambient_temperature_c":47.51,"average_ambient_temperature_last_month_c":15.78,"average_heater_temperature_last_month_c":17.47,"timestamp":"1111-11-11T11:11:11Z"}
// |HCA;68036198;0.000000;18.660000;1111-11-11 11:11.11 // |HCA;68036198;0;18.66;1111-11-11 11:11.11
// Test: HCAA hydroclima 74393723 NOKEY // Test: HCAA hydroclima 74393723 NOKEY
// Comment: // Comment:
// telegram=|2D44B009233739743308780F9D1300023ED97AEC7BC5908A32C15D8A32C126915AC15AC126912691269187912689| // telegram=|2D44B009233739743308780F9D1300023ED97AEC7BC5908A32C15D8A32C126915AC15AC126912691269187912689|
// {"media":"heat cost allocation","meter":"hydroclima","name":"HCAA","id":"74393723","current_consumption_hca":null,"average_ambient_temperature_c":0,"max_ambient_temperature_c":0,"average_ambient_temperature_last_month_c":0,"average_heater_temperature_last_month_c":0,"timestamp":"1111-11-11T11:11:11Z"} // {"media":"heat cost allocation","meter":"hydroclima","name":"HCAA","id":"74393723","average_ambient_temperature_c":0,"max_ambient_temperature_c":0,"average_ambient_temperature_last_month_c":0,"average_heater_temperature_last_month_c":0,"timestamp":"1111-11-11T11:11:11Z"}
// |HCAA;74393723;nan;0.000000;1111-11-11 11:11.11 // |HCAA;74393723;null;0;1111-11-11 11:11.11

Wyświetl plik

@ -41,7 +41,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total", "total",
"The total water consumption recorded by this meter.", "The total water consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -52,7 +52,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"meter", "meter",
"Meter timestamp for measurement.", "Meter timestamp for measurement.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::PointInTime, Quantity::PointInTime,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -63,6 +63,7 @@ namespace
static bool ok = registerDriver([](DriverInfo&di) static bool ok = registerDriver([](DriverInfo&di)
{ {
di.setName("hydrus"); di.setName("hydrus");
di.setDefaultFields("name,id,total_m3,total_at_date_m3,status,timestamp");
di.setMeterType(MeterType::WaterMeter); di.setMeterType(MeterType::WaterMeter);
di.addLinkMode(LinkMode::T1); di.addLinkMode(LinkMode::T1);
di.addDetection(MANUFACTURER_DME, 0x07, 0x70); di.addDetection(MANUFACTURER_DME, 0x07, 0x70);
@ -102,77 +103,77 @@ namespace
addPrint("total", Quantity::Volume, addPrint("total", Quantity::Volume,
[&](Unit u){ return totalWaterConsumption(u); }, [&](Unit u){ return totalWaterConsumption(u); },
"The total water consumption recorded by this meter.", "The total water consumption recorded by this meter.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("total_tariff1", Quantity::Volume, addPrint("total_tariff1", Quantity::Volume,
[&](Unit u){ return totalWaterConsumptionTariff1(u); }, [&](Unit u){ return totalWaterConsumptionTariff1(u); },
"The total water consumption recorded by this meter at tariff 1.", "The total water consumption recorded by this meter at tariff 1.",
PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("total_tariff2", Quantity::Volume, addPrint("total_tariff2", Quantity::Volume,
[&](Unit u){ return totalWaterConsumptionTariff2(u); }, [&](Unit u){ return totalWaterConsumptionTariff2(u); },
"The total water consumption recorded by this meter at tariff 2.", "The total water consumption recorded by this meter at tariff 2.",
PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("max_flow", Quantity::Flow, addPrint("max_flow", Quantity::Flow,
[&](Unit u){ return maxFlow(u); }, [&](Unit u){ return maxFlow(u); },
"The maximum flow recorded during previous period.", "The maximum flow recorded during previous period.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("flow_temperature", Quantity::Temperature, addPrint("flow_temperature", Quantity::Temperature,
[&](Unit u){ return flowTemperature(u); }, [&](Unit u){ return flowTemperature(u); },
"The water temperature.", "The water temperature.",
PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("external_temperature", Quantity::Temperature, addPrint("external_temperature", Quantity::Temperature,
[&](Unit u){ return externalTemperature(u); }, [&](Unit u){ return externalTemperature(u); },
"The external temperature.", "The external temperature.",
PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("current_date", Quantity::Text, addPrint("current_date", Quantity::Text,
[&](){ return current_date_; }, [&](){ return current_date_; },
"Current date of measurement.", "Current date of measurement.",
PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("total_at_date", Quantity::Volume, addPrint("total_at_date", Quantity::Volume,
[&](Unit u){ return totalWaterConsumptionAtDate(u); }, [&](Unit u){ return totalWaterConsumptionAtDate(u); },
"The total water consumption recorded at date.", "The total water consumption recorded at date.",
PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("total_tariff1_at_date", Quantity::Volume, addPrint("total_tariff1_at_date", Quantity::Volume,
[&](Unit u){ return totalWaterConsumptionTariff1AtDate(u); }, [&](Unit u){ return totalWaterConsumptionTariff1AtDate(u); },
"The total water consumption recorded at tariff 1 at date.", "The total water consumption recorded at tariff 1 at date.",
PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("total_tariff2_at_date", Quantity::Volume, addPrint("total_tariff2_at_date", Quantity::Volume,
[&](Unit u){ return totalWaterConsumptionTariff2AtDate(u); }, [&](Unit u){ return totalWaterConsumptionTariff2AtDate(u); },
"The total water consumption recorded at tariff 2 at date.", "The total water consumption recorded at tariff 2 at date.",
PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("at_date", Quantity::Text, addPrint("at_date", Quantity::Text,
[&](){ return at_date_; }, [&](){ return at_date_; },
"Date when total water consumption was recorded.", "Date when total water consumption was recorded.",
PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("actuality_duration", Quantity::Time, Unit::Second, addPrint("actuality_duration", Quantity::Time, Unit::Second,
[&](Unit u){ return convert(actuality_duration_s_, Unit::Second, u); }, [&](Unit u){ return convert(actuality_duration_s_, Unit::Second, u); },
"Elapsed time between measurement and transmission", "Elapsed time between measurement and transmission",
PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("operating_time", Quantity::Time, Unit::Hour, addPrint("operating_time", Quantity::Time, Unit::Hour,
[&](Unit u){ return convert(operating_time_h_, Unit::Hour, u); }, [&](Unit u){ return convert(operating_time_h_, Unit::Hour, u); },
"How long the meter is operating", "How long the meter is operating",
PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("remaining_battery_life", Quantity::Time, Unit::Year, addPrint("remaining_battery_life", Quantity::Time, Unit::Year,
[&](Unit u){ return convert(remaining_battery_life_year_, Unit::Year, u); }, [&](Unit u){ return convert(remaining_battery_life_year_, Unit::Year, u); },
"How many more years the battery is expected to last", "How many more years the battery is expected to last",
PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("status", Quantity::Text, addPrint("status", Quantity::Text,
[&](){ return status_; }, [&](){ return status_; },
"The status is OK or some error condition.", "The status is OK or some error condition.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
} }
void Driver::processContent(Telegram *t) void Driver::processContent(Telegram *t)
@ -592,14 +593,14 @@ namespace
// Test: HydrusWater hydrus 64646464 NOKEY // Test: HydrusWater hydrus 64646464 NOKEY
// telegram=|4E44A5116464646470077AED004005_2F2F01FD08300C13741100007C1300000000FC101300000000FC201300000000726C00000B3B00000002FD748713025A6800C4016D3B177F2ACC011300020000| // telegram=|4E44A5116464646470077AED004005_2F2F01FD08300C13741100007C1300000000FC101300000000FC201300000000726C00000B3B00000002FD748713025A6800C4016D3B177F2ACC011300020000|
// {"media":"water","meter":"hydrus","name":"HydrusWater","id":"64646464","total_m3":1.174,"total_tariff1_m3":0,"total_tariff2_m3":0,"max_flow_m3h":0,"flow_temperature_c":10.4,"external_temperature_c":0,"current_date":"","total_at_date_m3":0,"total_tariff1_at_date_m3":0,"total_tariff2_at_date_m3":0,"at_date":"2000-00-00 00:00","actuality_duration_s":0,"operating_time_h":0,"remaining_battery_life_y":13.686516,"status":"OK","timestamp":"1111-11-11T11:11:11Z"} // {"media":"water","meter":"hydrus","name":"HydrusWater","id":"64646464","total_m3":1.174,"total_tariff1_m3":0,"total_tariff2_m3":0,"max_flow_m3h":0,"flow_temperature_c":10.4,"external_temperature_c":0,"current_date":"","total_at_date_m3":0,"total_tariff1_at_date_m3":0,"total_tariff2_at_date_m3":0,"at_date":"2000-00-00 00:00","actuality_duration_s":0,"operating_time_h":0,"remaining_battery_life_y":13.686516,"status":"OK","timestamp":"1111-11-11T11:11:11Z"}
// |HydrusWater;64646464;1.174000;0.000000;OK;1111-11-11 11:11.11 // |HydrusWater;64646464;1.174;0;OK;1111-11-11 11:11.11
// Test: HydrusVater hydrus 65656565 NOKEY // Test: HydrusVater hydrus 65656565 NOKEY
// telegram=|3E44A5116565656570067AFB0030052F2F_0C13503400000DFD110A383731303134423032410B3B00000002FD74DC15C4016D3B178D29CC0113313400002F2F| // telegram=|3E44A5116565656570067AFB0030052F2F_0C13503400000DFD110A383731303134423032410B3B00000002FD74DC15C4016D3B178D29CC0113313400002F2F|
// {"media":"warm water","meter":"hydrus","name":"HydrusVater","id":"65656565","total_m3":3.45,"total_tariff1_m3":0,"total_tariff2_m3":0,"max_flow_m3h":0,"flow_temperature_c":127,"external_temperature_c":0,"current_date":"","total_at_date_m3":3.431,"total_tariff1_at_date_m3":0,"total_tariff2_at_date_m3":0,"at_date":"2020-09-13 23:59","actuality_duration_s":0,"operating_time_h":0,"remaining_battery_life_y":15.321013,"status":"OK","timestamp":"1111-11-11T11:11:11Z"} // {"media":"warm water","meter":"hydrus","name":"HydrusVater","id":"65656565","total_m3":3.45,"total_tariff1_m3":0,"total_tariff2_m3":0,"max_flow_m3h":0,"flow_temperature_c":127,"external_temperature_c":0,"current_date":"","total_at_date_m3":3.431,"total_tariff1_at_date_m3":0,"total_tariff2_at_date_m3":0,"at_date":"2020-09-13 23:59","actuality_duration_s":0,"operating_time_h":0,"remaining_battery_life_y":15.321013,"status":"OK","timestamp":"1111-11-11T11:11:11Z"}
// |HydrusVater;65656565;3.450000;0.000000;OK;1111-11-11 11:11.11 // |HydrusVater;65656565;3.45;3.431;OK;1111-11-11 11:11.11
// Test: HydrusAES hydrus 64745666 NOKEY // Test: HydrusAES hydrus 64745666 NOKEY
// telegram=||6644242328001081640E7266567464A51170071F0050052C411A08674048DD6BA82A0DF79FFD401309179A893A1BE3CE8EDC50C2A45CD7AFEC3B4CE765820BE8056C124A17416C3722985FFFF7FCEB7094901AB3A16294B511B9A740C9F9911352B42A72FB3B0C| // telegram=||6644242328001081640E7266567464A51170071F0050052C411A08674048DD6BA82A0DF79FFD401309179A893A1BE3CE8EDC50C2A45CD7AFEC3B4CE765820BE8056C124A17416C3722985FFFF7FCEB7094901AB3A16294B511B9A740C9F9911352B42A72FB3B0C|
// {"media":"water","meter":"hydrus","name":"HydrusAES","id":"64745666","total_m3":137.291,"total_tariff1_m3":0,"total_tariff2_m3":137.291,"max_flow_m3h":0,"flow_temperature_c":24.5,"external_temperature_c":23.9,"current_date":"2021-01-23 08:27","total_at_date_m3":128.638,"total_tariff1_at_date_m3":0,"total_tariff2_at_date_m3":128.638,"at_date":"2020-12-31 00:00","actuality_duration_s":6673,"operating_time_h":14678,"remaining_battery_life_y":0,"status":"OK","timestamp":"1111-11-11T11:11:11Z"} // {"media":"water","meter":"hydrus","name":"HydrusAES","id":"64745666","total_m3":137.291,"total_tariff1_m3":0,"total_tariff2_m3":137.291,"max_flow_m3h":0,"flow_temperature_c":24.5,"external_temperature_c":23.9,"current_date":"2021-01-23 08:27","total_at_date_m3":128.638,"total_tariff1_at_date_m3":0,"total_tariff2_at_date_m3":128.638,"at_date":"2020-12-31 00:00","actuality_duration_s":6673,"operating_time_h":14678,"remaining_battery_life_y":0,"status":"OK","timestamp":"1111-11-11T11:11:11Z"}
// |HydrusAES;64745666;137.291000;0.000000;OK;1111-11-11 11:11.11 // |HydrusAES;64745666;137.291;128.638;OK;1111-11-11 11:11.11

Wyświetl plik

@ -28,6 +28,7 @@ namespace
static bool ok = registerDriver([](DriverInfo&di) static bool ok = registerDriver([](DriverInfo&di)
{ {
di.setName("iperl"); di.setName("iperl");
di.setDefaultFields("name,id,total_m3,max_flow_m3h,timestamp");
di.setMeterType(MeterType::WaterMeter); di.setMeterType(MeterType::WaterMeter);
di.addLinkMode(LinkMode::T1); di.addLinkMode(LinkMode::T1);
di.addDetection(MANUFACTURER_SEN, 0x06, 0x68); di.addDetection(MANUFACTURER_SEN, 0x06, 0x68);
@ -41,7 +42,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total", "total",
"The total water consumption recorded by this meter.", "The total water consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -52,7 +53,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"max_flow", "max_flow",
"The maxium flow recorded during previous period.", "The maxium flow recorded during previous period.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Flow, Quantity::Flow,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -65,10 +66,10 @@ namespace
// Comment: Test iPerl T1 telegram, that after decryption, has 2f2f markers. // Comment: Test iPerl T1 telegram, that after decryption, has 2f2f markers.
// telegram=|1E44AE4C9956341268077A36001000_2F2F0413181E0000023B00002F2F2F2F| // telegram=|1E44AE4C9956341268077A36001000_2F2F0413181E0000023B00002F2F2F2F|
// {"media":"water","meter":"iperl","name":"MoreWater","id":"12345699","total_m3":7.704,"max_flow_m3h":0,"timestamp":"1111-11-11T11:11:11Z"} // {"media":"water","meter":"iperl","name":"MoreWater","id":"12345699","total_m3":7.704,"max_flow_m3h":0,"timestamp":"1111-11-11T11:11:11Z"}
// |MoreWater;12345699;7.704000;0.000000;1111-11-11 11:11.11 // |MoreWater;12345699;7.704;0;1111-11-11 11:11.11
// Test: WaterWater iperl 33225544 NOKEY // Test: WaterWater iperl 33225544 NOKEY
// Comment: Test iPerl T1 telegram not encrypted, which has no 2f2f markers. // Comment: Test iPerl T1 telegram not encrypted, which has no 2f2f markers.
// telegram=|1844AE4C4455223368077A55000000_041389E20100023B0000| // telegram=|1844AE4C4455223368077A55000000_041389E20100023B0000|
// {"media":"water","meter":"iperl","name":"WaterWater","id":"33225544","total_m3":123.529,"max_flow_m3h":0,"timestamp":"1111-11-11T11:11:11Z"} // {"media":"water","meter":"iperl","name":"WaterWater","id":"33225544","total_m3":123.529,"max_flow_m3h":0,"timestamp":"1111-11-11T11:11:11Z"}
// |WaterWater;33225544;123.529000;0.000000;1111-11-11 11:11.11 // |WaterWater;33225544;123.529;0;1111-11-11 11:11.11

Wyświetl plik

@ -49,7 +49,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Status and error flags.", "Status and error flags.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS, DEFAULT_PRINT_PROPERTIES | PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::ErrorFlags) .set(VIFRange::ErrorFlags)
@ -71,7 +71,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"target", "target",
"The total water consumption recorded at the end of previous billing period.", "The total water consumption recorded at the end of previous billing period.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -83,7 +83,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"target_date", "target_date",
"Date when previous billing period ended.", "Date when previous billing period ended.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -93,7 +93,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"unknown_a", "unknown_a",
"Unknown flags.", "Unknown flags.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("047F")), .set(DifVifKey("047F")),
{ {
@ -113,7 +113,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"unknown_b", "unknown_b",
"Unknown flags.", "Unknown flags.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("027F")), .set(DifVifKey("027F")),
{ {

Wyświetl plik

@ -73,6 +73,13 @@ namespace
static bool ok = registerDriver([](DriverInfo&di) static bool ok = registerDriver([](DriverInfo&di)
{ {
di.setName("izar"); di.setName("izar");
di.setDefaultFields("name,id,prefix,serial_number,total_m3,last_month_total_m3,"
"last_month_measure_date,"
"remaining_battery_life_y,"
"current_alarms,"
"previous_alarms,"
"transmit_period_s,"
"manufacture_year,timestamp");
di.setMeterType(MeterType::WaterMeter); di.setMeterType(MeterType::WaterMeter);
di.addLinkMode(LinkMode::T1); di.addLinkMode(LinkMode::T1);
di.addDetection(MANUFACTURER_HYD, 0x07, 0x85); di.addDetection(MANUFACTURER_HYD, 0x07, 0x85);
@ -93,52 +100,52 @@ namespace
addPrint("prefix", Quantity::Text, addPrint("prefix", Quantity::Text,
[&](){ return prefix; }, [&](){ return prefix; },
"The alphanumeric prefix printed before serial number on device.", "The alphanumeric prefix printed before serial number on device.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("serial_number", Quantity::Text, addPrint("serial_number", Quantity::Text,
[&](){ return serialNumber(); }, [&](){ return serialNumber(); },
"The meter serial number.", "The meter serial number.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("total", Quantity::Volume, addPrint("total", Quantity::Volume,
[&](Unit u){ return totalWaterConsumption(u); }, [&](Unit u){ return totalWaterConsumption(u); },
"The total water consumption recorded by this meter.", "The total water consumption recorded by this meter.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("last_month_total", Quantity::Volume, addPrint("last_month_total", Quantity::Volume,
[&](Unit u){ return lastMonthTotalWaterConsumption(u); }, [&](Unit u){ return lastMonthTotalWaterConsumption(u); },
"The total water consumption recorded by this meter around end of last month.", "The total water consumption recorded by this meter around end of last month.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("last_month_measure_date", Quantity::Text, addPrint("last_month_measure_date", Quantity::Text,
[&](){ return setH0Date(); }, [&](){ return setH0Date(); },
"The date when the meter recorded the most recent billing value.", "The date when the meter recorded the most recent billing value.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("remaining_battery_life", Quantity::Time, Unit::Year, addPrint("remaining_battery_life", Quantity::Time, Unit::Year,
[&](Unit u){ return convert(remaining_battery_life, Unit::Year, u); }, [&](Unit u){ return convert(remaining_battery_life, Unit::Year, u); },
"How many more years the battery is expected to last", "How many more years the battery is expected to last",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("current_alarms", Quantity::Text, addPrint("current_alarms", Quantity::Text,
[&](){ return currentAlarmsText(); }, [&](){ return currentAlarmsText(); },
"Alarms currently reported by the meter.", "Alarms currently reported by the meter.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("previous_alarms", Quantity::Text, addPrint("previous_alarms", Quantity::Text,
[&](){ return previousAlarmsText(); }, [&](){ return previousAlarmsText(); },
"Alarms previously reported by the meter.", "Alarms previously reported by the meter.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("transmit_period", Quantity::Time, Unit::Second, addPrint("transmit_period", Quantity::Time, Unit::Second,
[&](Unit u){ return convert(transmit_period_s_, Unit::Second, u); }, [&](Unit u){ return convert(transmit_period_s_, Unit::Second, u); },
"The period at which the meter transmits its data.", "The period at which the meter transmits its data.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("manufacture_year", Quantity::Text, addPrint("manufacture_year", Quantity::Text,
[&](){ return to_string(manufacture_year); }, [&](){ return to_string(manufacture_year); },
"The year during which the meter was manufactured.", "The year during which the meter was manufactured.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
} }
double Driver::totalWaterConsumption(Unit u) double Driver::totalWaterConsumption(Unit u)
@ -304,31 +311,31 @@ namespace
// Test: IzarWater izar 21242472 NOKEY // Test: IzarWater izar 21242472 NOKEY
// telegram=|1944304C72242421D401A2|013D4013DD8B46A4999C1293E582CC| // telegram=|1944304C72242421D401A2|013D4013DD8B46A4999C1293E582CC|
// {"media":"water","meter":"izar","name":"IzarWater","id":"21242472","prefix":"C19UA","serial_number":"145842","total_m3":3.488,"last_month_total_m3":3.486,"last_month_measure_date":"2019-09-30","remaining_battery_life_y":14.5,"current_alarms":"meter_blocked,underflow","previous_alarms":"no_alarm","transmit_period_s":8,"manufacture_year":"2019","timestamp":"1111-11-11T11:11:11Z"} // {"media":"water","meter":"izar","name":"IzarWater","id":"21242472","prefix":"C19UA","serial_number":"145842","total_m3":3.488,"last_month_total_m3":3.486,"last_month_measure_date":"2019-09-30","remaining_battery_life_y":14.5,"current_alarms":"meter_blocked,underflow","previous_alarms":"no_alarm","transmit_period_s":8,"manufacture_year":"2019","timestamp":"1111-11-11T11:11:11Z"}
// |IzarWater;21242472;C19UA;145842;3.488000;3.486000;2019-09-30;14.500000;meter_blocked,underflow;no_alarm;8.000000;2019;1111-11-11 11:11.11 // |IzarWater;21242472;C19UA;145842;3.488;3.486;2019-09-30;14.5;meter_blocked,underflow;no_alarm;8;2019;1111-11-11 11:11.11
// Test: IzarWater2 izar 66236629 NOKEY // Test: IzarWater2 izar 66236629 NOKEY
// telegram=|2944A511780729662366A20118001378D3B3DB8CEDD77731F25832AAF3DA8CADF9774EA673172E8C61F2| // telegram=|2944A511780729662366A20118001378D3B3DB8CEDD77731F25832AAF3DA8CADF9774EA673172E8C61F2|
// {"media":"water","meter":"izar","name":"IzarWater2","id":"66236629","prefix":"","serial_number":"000000","total_m3":16.76,"last_month_total_m3":11.84,"last_month_measure_date":"2019-11-30","remaining_battery_life_y":12,"current_alarms":"no_alarm","previous_alarms":"no_alarm","transmit_period_s":8,"manufacture_year":"0","timestamp":"1111-11-11T11:11:11Z"} // {"media":"water","meter":"izar","name":"IzarWater2","id":"66236629","prefix":"","serial_number":"000000","total_m3":16.76,"last_month_total_m3":11.84,"last_month_measure_date":"2019-11-30","remaining_battery_life_y":12,"current_alarms":"no_alarm","previous_alarms":"no_alarm","transmit_period_s":8,"manufacture_year":"0","timestamp":"1111-11-11T11:11:11Z"}
// |IzarWater2;66236629;;000000;16.760000;11.840000;2019-11-30;12.000000;no_alarm;no_alarm;8.000000;0;1111-11-11 11:11.11 // |IzarWater2;66236629;;000000;16.76;11.84;2019-11-30;12;no_alarm;no_alarm;8;0;1111-11-11 11:11.11
// Test: IzarWater3 izar 20481979 NOKEY // Test: IzarWater3 izar 20481979 NOKEY
// telegram=|1944A511780779194820A1|21170013355F8EDB2D03C6912B1E37 // telegram=|1944A511780779194820A1|21170013355F8EDB2D03C6912B1E37
// {"media":"water","meter":"izar","name":"IzarWater3","id":"20481979","prefix":"","serial_number":"000000","total_m3":4.366,"last_month_total_m3":0,"last_month_measure_date":"2020-12-31","remaining_battery_life_y":11.5,"current_alarms":"no_alarm","previous_alarms":"no_alarm","transmit_period_s":8,"manufacture_year":"0","timestamp":"1111-11-11T11:11:11Z"} // {"media":"water","meter":"izar","name":"IzarWater3","id":"20481979","prefix":"","serial_number":"000000","total_m3":4.366,"last_month_total_m3":0,"last_month_measure_date":"2020-12-31","remaining_battery_life_y":11.5,"current_alarms":"no_alarm","previous_alarms":"no_alarm","transmit_period_s":8,"manufacture_year":"0","timestamp":"1111-11-11T11:11:11Z"}
// |IzarWater3;20481979;;000000;4.366000;0.000000;2020-12-31;11.500000;no_alarm;no_alarm;8.000000;0;1111-11-11 11:11.11 // |IzarWater3;20481979;;000000;4.366;0;2020-12-31;11.5;no_alarm;no_alarm;8;0;1111-11-11 11:11.11
// Test: IzarWater4 izar 2124589c NOKEY // Test: IzarWater4 izar 2124589c NOKEY
// Comment: With mfct specific tpl ci field a3. // Comment: With mfct specific tpl ci field a3.
// telegram=|1944304c9c5824210c04a363140013716577ec59e8663ab0d31c| // telegram=|1944304c9c5824210c04a363140013716577ec59e8663ab0d31c|
// {"media":"water","meter":"izar","name":"IzarWater4","id":"2124589c","prefix":"H19CA","serial_number":"159196","total_m3":38.944,"last_month_total_m3":38.691,"last_month_measure_date":"2021-02-01","remaining_battery_life_y":10,"current_alarms":"no_alarm","previous_alarms":"no_alarm","transmit_period_s":32,"manufacture_year":"2019","timestamp":"1111-11-11T11:11:11Z"} // {"media":"water","meter":"izar","name":"IzarWater4","id":"2124589c","prefix":"H19CA","serial_number":"159196","total_m3":38.944,"last_month_total_m3":38.691,"last_month_measure_date":"2021-02-01","remaining_battery_life_y":10,"current_alarms":"no_alarm","previous_alarms":"no_alarm","transmit_period_s":32,"manufacture_year":"2019","timestamp":"1111-11-11T11:11:11Z"}
// |IzarWater4;2124589c;H19CA;159196;38.944000;38.691000;2021-02-01;10.000000;no_alarm;no_alarm;32.000000;2019;1111-11-11 11:11.11 // |IzarWater4;2124589c;H19CA;159196;38.944;38.691;2021-02-01;10;no_alarm;no_alarm;32;2019;1111-11-11 11:11.11
// Test: IzarWater5 izar 20e4ffde NOKEY // Test: IzarWater5 izar 20e4ffde NOKEY
// Comment: Ensure non-regression on manufacture year parsing // Comment: Ensure non-regression on manufacture year parsing
// telegram=|1944304CDEFFE420CC01A2|63120013258F907B0AFF12529AC33B| // telegram=|1944304CDEFFE420CC01A2|63120013258F907B0AFF12529AC33B|
// {"media":"water","meter":"izar","name":"IzarWater5","id":"20e4ffde","prefix":"C15SA","serial_number":"007710","total_m3":159.832,"last_month_total_m3":157.76,"last_month_measure_date":"2021-02-01","remaining_battery_life_y":9,"current_alarms":"no_alarm","previous_alarms":"no_alarm","transmit_period_s":32,"manufacture_year":"2015","timestamp":"1111-11-11T11:11:11Z"} // {"media":"water","meter":"izar","name":"IzarWater5","id":"20e4ffde","prefix":"C15SA","serial_number":"007710","total_m3":159.832,"last_month_total_m3":157.76,"last_month_measure_date":"2021-02-01","remaining_battery_life_y":9,"current_alarms":"no_alarm","previous_alarms":"no_alarm","transmit_period_s":32,"manufacture_year":"2015","timestamp":"1111-11-11T11:11:11Z"}
// |IzarWater5;20e4ffde;C15SA;007710;159.832000;157.760000;2021-02-01;9.000000;no_alarm;no_alarm;32.000000;2015;1111-11-11 11:11.11 // |IzarWater5;20e4ffde;C15SA;007710;159.832;157.76;2021-02-01;9;no_alarm;no_alarm;32;2015;1111-11-11 11:11.11
// Test: IzarWater6 izar 48500375 NOKEY // Test: IzarWater6 izar 48500375 NOKEY
// telegram=|19442423860775035048A251520015BEB6B2E1ED623A18FC74A5| // telegram=|19442423860775035048A251520015BEB6B2E1ED623A18FC74A5|
// {"media":"water","meter":"izar","name":"IzarWater6","id":"48500375","prefix":"","serial_number":"000000","total_m3":521.602,"last_month_total_m3":519.147,"last_month_measure_date":"2021-11-15","remaining_battery_life_y":9,"current_alarms":"no_alarm","previous_alarms":"leakage","transmit_period_s":8,"manufacture_year":"0","timestamp":"1111-11-11T11:11:11Z"} // {"media":"water","meter":"izar","name":"IzarWater6","id":"48500375","prefix":"","serial_number":"000000","total_m3":521.602,"last_month_total_m3":519.147,"last_month_measure_date":"2021-11-15","remaining_battery_life_y":9,"current_alarms":"no_alarm","previous_alarms":"leakage","transmit_period_s":8,"manufacture_year":"0","timestamp":"1111-11-11T11:11:11Z"}
// |IzarWater6;48500375;;000000;521.602000;519.147000;2021-11-15;9.000000;no_alarm;leakage;8.000000;0;1111-11-11 11:11.11 // |IzarWater6;48500375;;000000;521.602;519.147;2021-11-15;9;no_alarm;leakage;8;0;1111-11-11 11:11.11

Wyświetl plik

@ -62,7 +62,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Status and error flags.", "Status and error flags.",
PrintProperty::JSON | PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS, DEFAULT_PRINT_PROPERTIES | PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("04FF22")), .set(DifVifKey("04FF22")),
Translate::Lookup( Translate::Lookup(
@ -114,7 +114,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_consumption", "total_energy_consumption",
"The total energy consumption recorded by this meter.", "The total energy consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -125,7 +125,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_volume", "total_volume",
"The volume of water (3/68/Volume V1).", "The volume of water (3/68/Volume V1).",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -136,7 +136,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"volume_flow", "volume_flow",
"The actual amount of water that pass through this meter (8/74/Flow V1 actual).", "The actual amount of water that pass through this meter (8/74/Flow V1 actual).",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Flow, Quantity::Flow,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -147,7 +147,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"power", "power",
"The current power flowing.", "The current power flowing.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -158,7 +158,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"max_power", "max_power",
"The maximum power supplied.", "The maximum power supplied.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -169,7 +169,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"t1_temperature", "t1_temperature",
"The forward temperature of the water (6/86/t2 actual 2 decimals).", "The forward temperature of the water (6/86/t2 actual 2 decimals).",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -180,7 +180,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"t2_temperature", "t2_temperature",
"The return temperature of the water (7/87/t2 actual 2 decimals).", "The return temperature of the water (7/87/t2 actual 2 decimals).",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -191,7 +191,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"max_flow", "max_flow",
"The maximum flow of water that passed through this meter.", "The maximum flow of water that passed through this meter.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Flow, Quantity::Flow,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -202,7 +202,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"forward_energy", "forward_energy",
"The forward energy of the water (4/97/Energy E8).", "The forward energy of the water (4/97/Energy E8).",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::None, VifScaling::None,
FieldMatcher::build() FieldMatcher::build()
@ -212,7 +212,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"return_energy", "return_energy",
"The return energy of the water (5/110/Energy E9).", "The return energy of the water (5/110/Energy E9).",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::None, VifScaling::None,
FieldMatcher::build() FieldMatcher::build()
@ -222,7 +222,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"meter_date", "meter_date",
"The date and time (10/348/Date and time).", "The date and time (10/348/Date and time).",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -231,7 +231,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"target_energy", "target_energy",
"The energy consumption recorded by this meter at the set date (11/60/Heat energy E1/026C).", "The energy consumption recorded by this meter at the set date (11/60/Heat energy E1/026C).",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -243,7 +243,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"target_volume", "target_volume",
"The amount of water that had passed through this meter at the set date (13/68/Volume V1).", "The amount of water that had passed through this meter at the set date (13/68/Volume V1).",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -255,7 +255,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"target_date", "target_date",
"The most recent billing period date and time (14/348/Date and Time logged).", "The most recent billing period date and time (14/348/Date and Time logged).",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)

Wyświetl plik

@ -27,6 +27,7 @@ namespace
static bool ok = registerDriver([](DriverInfo&di) static bool ok = registerDriver([](DriverInfo&di)
{ {
di.setName("kampress"); di.setName("kampress");
di.setDefaultFields("name,id,status,pressure_bar,max_pressure_bar,min_pressure_bar,timestamp");
di.setMeterType(MeterType::PressureSensor); di.setMeterType(MeterType::PressureSensor);
di.addLinkMode(LinkMode::C1); di.addLinkMode(LinkMode::C1);
di.addDetection(MANUFACTURER_KAM, 0x18, 0x01); di.addDetection(MANUFACTURER_KAM, 0x18, 0x01);
@ -38,7 +39,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Status and error flags.", "Status and error flags.",
PrintProperty::JSON | PrintProperty::FIELD | JOIN_TPL_STATUS, DEFAULT_PRINT_PROPERTIES | INCLUDE_TPL_STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(VIFRange::ErrorFlags), .set(VIFRange::ErrorFlags),
{ {
@ -63,7 +64,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"pressure", "pressure",
"The measured pressure.", "The measured pressure.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Pressure, Quantity::Pressure,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -74,7 +75,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"max_pressure", "max_pressure",
"The maximum pressure measured during ?.", "The maximum pressure measured during ?.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Pressure, Quantity::Pressure,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -85,7 +86,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"min_pressure", "min_pressure",
"The minumum pressure measured during ?.", "The minumum pressure measured during ?.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Pressure, Quantity::Pressure,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -96,7 +97,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"alfa", "alfa",
"We do not know what this is.", "We do not know what this is.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Counter, Quantity::Counter,
VifScaling::None, VifScaling::None,
FieldMatcher::build() FieldMatcher::build()
@ -106,7 +107,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"beta", "beta",
"We do not know what this is.", "We do not know what this is.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Counter, Quantity::Counter,
VifScaling::None, VifScaling::None,
FieldMatcher::build() FieldMatcher::build()
@ -118,12 +119,12 @@ namespace
// Test: Pressing kampress 77000317 NOKEY // Test: Pressing kampress 77000317 NOKEY
// telegram=|32442D2C1703007701188D280080E39322DB8F78_22696600126967000269660005FF091954A33A05FF0A99BD823A02FD170800| // telegram=|32442D2C1703007701188D280080E39322DB8F78_22696600126967000269660005FF091954A33A05FF0A99BD823A02FD170800|
// {"media":"pressure","meter":"kampress","name":"Pressing","id":"77000317","status":"LOW","pressure_bar":1.02,"max_pressure_bar":1.03,"min_pressure_bar":1.02,"alfa_counter":0.001246,"beta_counter":0.000997,"timestamp":"1111-11-11T11:11:11Z"} // {"media":"pressure","meter":"kampress","name":"Pressing","id":"77000317","status":"LOW","pressure_bar":1.02,"max_pressure_bar":1.03,"min_pressure_bar":1.02,"alfa_counter":0.001246,"beta_counter":0.000997,"timestamp":"1111-11-11T11:11:11Z"}
// |Pressing;77000317;LOW;1.020000;1.030000;1.020000;1111-11-11 11:11.11 // |Pressing;77000317;LOW;1.02;1.03;1.02;1111-11-11 11:11.11
// telegram=|27442D2C1703007701188D280194E393226EC679DE735657_660067006600962B913A21B9423A0800| // telegram=|27442D2C1703007701188D280194E393226EC679DE735657_660067006600962B913A21B9423A0800|
// {"media":"pressure","meter":"kampress","name":"Pressing","id":"77000317","status":"LOW","pressure_bar":1.02,"max_pressure_bar":1.03,"min_pressure_bar":1.02,"alfa_counter":0.001108,"beta_counter":0.000743,"timestamp":"1111-11-11T11:11:11Z"} // {"media":"pressure","meter":"kampress","name":"Pressing","id":"77000317","status":"LOW","pressure_bar":1.02,"max_pressure_bar":1.03,"min_pressure_bar":1.02,"alfa_counter":0.001108,"beta_counter":0.000743,"timestamp":"1111-11-11T11:11:11Z"}
// |Pressing;77000317;LOW;1.020000;1.030000;1.020000;1111-11-11 11:11.11 // |Pressing;77000317;LOW;1.02;1.03;1.02;1111-11-11 11:11.11
// telegram=|27442D2C1703007701188D289554F295224ED579DE73188A_650066006600E80EA43A6B97A3BA0800| // telegram=|27442D2C1703007701188D289554F295224ED579DE73188A_650066006600E80EA43A6B97A3BA0800|
// {"media":"pressure","meter":"kampress","name":"Pressing","id":"77000317","status":"LOW","pressure_bar":1.02,"max_pressure_bar":1.02,"min_pressure_bar":1.01,"alfa_counter":0.001252,"beta_counter":-0.001248,"timestamp":"1111-11-11T11:11:11Z"} // {"media":"pressure","meter":"kampress","name":"Pressing","id":"77000317","status":"LOW","pressure_bar":1.02,"max_pressure_bar":1.02,"min_pressure_bar":1.01,"alfa_counter":0.001252,"beta_counter":-0.001248,"timestamp":"1111-11-11T11:11:11Z"}
// |Pressing;77000317;LOW;1.020000;1.020000;1.010000;1111-11-11 11:11.11 // |Pressing;77000317;LOW;1.02;1.02;1.01;1111-11-11 11:11.11

Wyświetl plik

@ -38,6 +38,7 @@ private:
static bool ok = registerDriver([](DriverInfo&di) static bool ok = registerDriver([](DriverInfo&di)
{ {
di.setName("lansendw"); di.setName("lansendw");
di.setDefaultFields("name,id,status,timestamp");
di.setMeterType(MeterType::DoorWindowDetector); di.setMeterType(MeterType::DoorWindowDetector);
di.addLinkMode(LinkMode::T1); di.addLinkMode(LinkMode::T1);
di.setConstructor([](MeterInfo& mi, DriverInfo& di){ return shared_ptr<Meter>(new MeterLansenDW(mi, di)); }); di.setConstructor([](MeterInfo& mi, DriverInfo& di){ return shared_ptr<Meter>(new MeterLansenDW(mi, di)); });
@ -56,23 +57,17 @@ MeterLansenDW::MeterLansenDW(MeterInfo &mi, DriverInfo &di) :
addPrint("status", Quantity::Text, addPrint("status", Quantity::Text,
[&](){ return status(); }, [&](){ return status(); },
"The current status: OPEN or CLOSED.", "The current status: OPEN or CLOSED.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
/*
addPrint("statuss", Quantity::Text,
[&](){ return status(); },
"The current status: OPEN or CLOSED.",
PrintProperty::FIELD | PrintProperty::JSON);
*/
addPrint("a", Quantity::Counter, addPrint("a", Quantity::Counter,
[&](Unit u) { assertQuantity(u, Quantity::Counter); return pulse_counter_a_; }, [&](Unit u) { assertQuantity(u, Quantity::Counter); return pulse_counter_a_; },
"How many times the door/window has been opened or closed.", "How many times the door/window has been opened or closed.",
PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("b", Quantity::Counter, addPrint("b", Quantity::Counter,
[&](Unit u) { assertQuantity(u, Quantity::Counter); return pulse_counter_b_; }, [&](Unit u) { assertQuantity(u, Quantity::Counter); return pulse_counter_b_; },
"The current number of counted pulses from counter b.", "The current number of counted pulses from counter b.",
PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
} }

Wyświetl plik

@ -47,8 +47,8 @@ namespace
addStringField( addStringField(
"status", "status",
"Meter status from tpl status field.", "Meter status from tpl status field.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT | DEFAULT_PRINT_PROPERTIES |
PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS); PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS);
/* Doubles have a 52 bit significand 11 bit exp and 1 bit sign, /* Doubles have a 52 bit significand 11 bit exp and 1 bit sign,
so double is good for incremental pulses up to 2^52 counts so double is good for incremental pulses up to 2^52 counts
@ -58,7 +58,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"a", "a",
"The current number of counted pulses from counter a.", "The current number of counted pulses from counter a.",
PrintProperty::FIELD | PrintProperty::JSON | PrintProperty::IMPORTANT | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Counter, Quantity::Counter,
VifScaling::None, VifScaling::None,
FieldMatcher::build() FieldMatcher::build()
@ -68,7 +68,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"b", "b",
"The current number of counted pulses from counter b.", "The current number of counted pulses from counter b.",
PrintProperty::FIELD | PrintProperty::JSON | PrintProperty::IMPORTANT | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Counter, Quantity::Counter,
VifScaling::None, VifScaling::None,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -39,8 +39,8 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Meter status.", "Meter status.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT | DEFAULT_PRINT_PROPERTIES |
PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS, PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(VIFRange::ErrorFlags) .set(VIFRange::ErrorFlags)
.add(VIFCombinable::StandardConformantDataContent), .add(VIFCombinable::StandardConformantDataContent),
@ -67,7 +67,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"async_msg_id", "async_msg_id",
"Unique asynchronous message number.", "Unique asynchronous message number.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Counter, Quantity::Counter,
VifScaling::None, VifScaling::None,
FieldMatcher::build() FieldMatcher::build()
@ -78,7 +78,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"minutes_since_last_manual_test", "minutes_since_last_manual_test",
"Minutes since last manual test.", "Minutes since last manual test.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Counter, Quantity::Counter,
VifScaling::None, VifScaling::None,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -45,13 +45,13 @@ namespace
addStringField( addStringField(
"status", "status",
"Meter status from tpl status field.", "Meter status from tpl status field.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT | DEFAULT_PRINT_PROPERTIES |
PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS); PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS);
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_temperature", "current_temperature",
"The current temperature.", "The current temperature.",
PrintProperty::FIELD | PrintProperty::JSON | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -62,7 +62,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_relative_humidity", "current_relative_humidity",
"The current humidity.", "The current humidity.",
PrintProperty::FIELD | PrintProperty::JSON | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::RelativeHumidity, Quantity::RelativeHumidity,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -73,7 +73,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"average_temperature_1h", "average_temperature_1h",
"The average temperature over the last hour.", "The average temperature over the last hour.",
PrintProperty::FIELD | PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -85,7 +85,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"average_relative_humidity_1h", "average_relative_humidity_1h",
"The average humidity over the last hour.", "The average humidity over the last hour.",
PrintProperty::FIELD | PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::RelativeHumidity, Quantity::RelativeHumidity,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -97,7 +97,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"average_temperature_24h", "average_temperature_24h",
"The average temperature over the last 24 hours.", "The average temperature over the last 24 hours.",
PrintProperty::FIELD | PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -109,7 +109,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"average_relative_humidity_24h", "average_relative_humidity_24h",
"The average humidity over the last 24 hours.", "The average humidity over the last 24 hours.",
PrintProperty::FIELD | PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::RelativeHumidity, Quantity::RelativeHumidity,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -27,6 +27,7 @@ namespace
static bool ok = registerDriver([](DriverInfo&di) static bool ok = registerDriver([](DriverInfo&di)
{ {
di.setName("lse_07_17"); di.setName("lse_07_17");
di.setDefaultFields("name,id,total_m3,due_date_m3,due_date,error_code,error_date,device_date_time,timestamp");
di.setMeterType(MeterType::WaterMeter); di.setMeterType(MeterType::WaterMeter);
di.addLinkMode(LinkMode::S1); di.addLinkMode(LinkMode::S1);
di.addDetection(MANUFACTURER_LSE, 0x06, 0x18); di.addDetection(MANUFACTURER_LSE, 0x06, 0x18);
@ -41,7 +42,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total", "total",
"The total water consumption recorded by this meter.", "The total water consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -52,7 +53,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"due_date", "due_date",
"The water consumption at the due date.", "The water consumption at the due date.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -64,7 +65,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"due_date", "due_date",
"The due date configured on the meter.", "The due date configured on the meter.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -74,7 +75,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"what_date", "what_date",
"The water consumption at the what date?", "The water consumption at the what date?",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -86,7 +87,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"what_date", "what_date",
"The what date?", "The what date?",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -96,7 +97,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"error_code", "error_code",
"Error code of the Meter, 0 means no error.", "Error code of the Meter, 0 means no error.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("02BB56") .set(DifVifKey("02BB56")
), ),
@ -117,7 +118,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"error_date", "error_date",
"The date the error occured at. If no error, reads 2127-15-31 (FFFF).", "The date the error occured at. If no error, reads 2127-15-31 (FFFF).",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::AtError) .set(MeasurementType::AtError)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -126,7 +127,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"device_date_time", "device_date_time",
"Date when measurement was recorded.", "Date when measurement was recorded.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::DateTime) .set(VIFRange::DateTime)
@ -135,7 +136,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"meter_version", "meter_version",
"Meter model/version.", "Meter model/version.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::ModelVersion) .set(VIFRange::ModelVersion)
@ -196,13 +197,13 @@ namespace
// Test: Water lse_07_17 13963399 NOKEY // Test: Water lse_07_17 13963399 NOKEY
// telegram=|244465329933961318067AE1000000_8C04130070000082046CBE2B01FD0C11046D010CA22C| // telegram=|244465329933961318067AE1000000_8C04130070000082046CBE2B01FD0C11046D010CA22C|
// {"media":"warm water","meter":"lse_07_17","name":"Water","id":"13963399","total_m3":null,"due_date_m3":null,"due_date":null,"what_date_m3":7,"what_date":"2021-11-30","error_code":null,"error_date":null,"device_date_time":"2021-12-02 12:01","meter_version":"11","timestamp":"1111-11-11T11:11:11Z"} // {"media":"warm water","meter":"lse_07_17","name":"Water","id":"13963399","what_date_m3":7,"what_date":"2021-11-30","device_date_time":"2021-12-02 12:01","meter_version":"11","timestamp":"1111-11-11T11:11:11Z"}
// |Water;13963399;nan;nan;null;null;null;2021-12-02 12:01;1111-11-11 11:11.11 // |Water;13963399;null;null;null;null;null;2021-12-02 12:01;1111-11-11 11:11.11
// telegram=|2A4465329933961318067AD8800000_8C04130070000082046CBE2B01FD0C11046D1800A12C02FDAC7E9B2E| // telegram=|2A4465329933961318067AD8800000_8C04130070000082046CBE2B01FD0C11046D1800A12C02FDAC7E9B2E|
// {"media":"warm water","meter":"lse_07_17","name":"Water","id":"13963399","total_m3":null,"due_date_m3":null,"due_date":null,"what_date_m3":7,"what_date":"2021-11-30","error_code":null,"error_date":null,"device_date_time":"2021-12-01 00:24","meter_version":"11","timestamp":"1111-11-11T11:11:11Z"} // {"media":"warm water","meter":"lse_07_17","name":"Water","id":"13963399","what_date_m3":7,"what_date":"2021-11-30","device_date_time":"2021-12-01 00:24","meter_version":"11","timestamp":"1111-11-11T11:11:11Z"}
// |Water;13963399;nan;nan;null;null;null;2021-12-01 00:24;1111-11-11 11:11.11 // |Water;13963399;null;null;null;null;null;2021-12-01 00:24;1111-11-11 11:11.11
// telegram=|2D4465329933961318067ADA000000_0C13567100004C1300000000426CFFFF02BB560000326CFFFF046D2307A12C| // 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"} // {"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.156000;0.000000;2127-15-31;OK;2127-15-31;2021-12-01 07:35;1111-11-11 11:11.11 // |Water;13963399;7.156;0;2127-15-31;OK;2127-15-31;2021-12-01 07:35;1111-11-11 11:11.11

Wyświetl plik

@ -42,8 +42,8 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Meter status from tpl status field.", "Meter status from tpl status field.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT | DEFAULT_PRINT_PROPERTIES |
PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS, PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("01FD73")), .set(DifVifKey("01FD73")),
Translate::Lookup( Translate::Lookup(
@ -64,7 +64,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_consumption", "current_consumption",
"The current heat cost allocation.", "The current heat cost allocation.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::HCA, Quantity::HCA,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -75,7 +75,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"set_date", "set_date",
"The most recent billing period date.", "The most recent billing period date.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -85,7 +85,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"consumption_at_set_date", "consumption_at_set_date",
"Heat cost allocation at the most recent billing period date.", "Heat cost allocation at the most recent billing period date.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::HCA, Quantity::HCA,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -97,7 +97,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"device_date_time", "device_date_time",
"Date and time when the meter sent the telegram.", "Date and time when the meter sent the telegram.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::DateTime) .set(VIFRange::DateTime)
@ -106,7 +106,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"duration_since_readout", "duration_since_readout",
"Duration since last measurement.", "Duration since last measurement.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Time, Quantity::Time,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -118,7 +118,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"model_version", "model_version",
"model version.", "model version.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::ModelVersion) .set(VIFRange::ModelVersion)

Wyświetl plik

@ -42,8 +42,8 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Meter status from error flags and tpl status field.", "Meter status from error flags and tpl status field.",
PrintProperty::JSON | PrintProperty::IMPORTANT | DEFAULT_PRINT_PROPERTIES |
PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS, PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::ErrorFlags), .set(VIFRange::ErrorFlags),
@ -64,7 +64,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_consumption", "total_energy_consumption",
"The total heat energy consumption recorded by this meter.", "The total heat energy consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -75,7 +75,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_volume", "total_volume",
"The total heating media volume recorded by this meter.", "The total heating media volume recorded by this meter.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -86,7 +86,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"volume_flow", "volume_flow",
"The current heat media volume flow.", "The current heat media volume flow.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Flow, Quantity::Flow,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -97,7 +97,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"power", "power",
"The current power consumption.", "The current power consumption.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -108,7 +108,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"temperature_difference", "temperature_difference",
"The difference between flow and return media temperatures.", "The difference between flow and return media temperatures.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::AutoSigned, VifScaling::AutoSigned,
FieldMatcher::build() FieldMatcher::build()
@ -119,7 +119,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"set", "set",
"The most recent billing period date.", "The most recent billing period date.",
PrintProperty::JSON | PrintProperty::OPTIONAL | PrintProperty::HIDE, DEFAULT_PRINT_PROPERTIES | PrintProperty::HIDE,
Quantity::PointInTime, Quantity::PointInTime,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -132,7 +132,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"consumption_at_set_date_{storage_counter}", "consumption_at_set_date_{storage_counter}",
"The total water consumption at the historic date.", "The total water consumption at the historic date.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -144,7 +144,7 @@ namespace
addNumericFieldWithCalculatorAndMatcher( addNumericFieldWithCalculatorAndMatcher(
"set_date_{storage_counter}", "set_date_{storage_counter}",
"Unclear! What is the date really?", "Unclear! What is the date really?",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::PointInTime, Quantity::PointInTime,
"set_date - ((storage_counter-1counter) * 1 month)", "set_date - ((storage_counter-1counter) * 1 month)",
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -47,7 +47,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"target", "target",
"The total water consumption recorded at the beginning of this month.", "The total water consumption recorded at the beginning of this month.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -59,7 +59,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"target_date", "target_date",
"Date when target water consumption was recorded.", "Date when target water consumption was recorded.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -70,7 +70,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"target", "target",
"The total water consumption recorded at the beginning of this month.", "The total water consumption recorded at the beginning of this month.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -82,7 +82,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"target_date", "target_date",
"Date when target water consumption was recorded.", "Date when target water consumption was recorded.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -120,7 +120,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Status and error flags.", "Status and error flags.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("02FD17")) .set(DifVifKey("02FD17"))
, ,

Wyświetl plik

@ -43,6 +43,7 @@ namespace
static bool ok = registerDriver([](DriverInfo&di) static bool ok = registerDriver([](DriverInfo&di)
{ {
di.setName("mkradio3"); di.setName("mkradio3");
di.setDefaultFields("name,id,total_m3,target_m3,current_date,prev_date,timestamp");
di.setMeterType(MeterType::WaterMeter); di.setMeterType(MeterType::WaterMeter);
di.addLinkMode(LinkMode::T1); di.addLinkMode(LinkMode::T1);
di.addDetection(MANUFACTURER_TCH, 0x62, 0x74); di.addDetection(MANUFACTURER_TCH, 0x62, 0x74);
@ -56,22 +57,22 @@ namespace
addPrint("total", Quantity::Volume, addPrint("total", Quantity::Volume,
[&](Unit u){ return totalWaterConsumption(u); }, [&](Unit u){ return totalWaterConsumption(u); },
"The total water consumption recorded by this meter.", "The total water consumption recorded by this meter.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("target", Quantity::Volume, addPrint("target", Quantity::Volume,
[&](Unit u){ return targetWaterConsumption(u); }, [&](Unit u){ return targetWaterConsumption(u); },
"The total water consumption recorded at the beginning of this month.", "The total water consumption recorded at the beginning of this month.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("current_date", Quantity::Text, addPrint("current_date", Quantity::Text,
[&](){ return currentDate(); }, [&](){ return currentDate(); },
"Date of current billing period.", "Date of current billing period.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("prev_date", Quantity::Text, addPrint("prev_date", Quantity::Text,
[&](){ return previousDate(); }, [&](){ return previousDate(); },
"Date of previous billing period.", "Date of previous billing period.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
} }
void Driver::processContent(Telegram *t) void Driver::processContent(Telegram *t)
@ -174,5 +175,5 @@ namespace
// Comment: There is a problem in the decoding here, the data stored inside the telegram does not seem to properly encode/decode the year.... // Comment: There is a problem in the decoding here, the data stored inside the telegram does not seem to properly encode/decode the year....
// We should not report a current_date with a full year, if the year is actually not part of the telegram. // We should not report a current_date with a full year, if the year is actually not part of the telegram.
// telegram=|2F446850313233347462A2_069F255900B029310000000306060906030609070606050509050505050407040605070500| // telegram=|2F446850313233347462A2_069F255900B029310000000306060906030609070606050509050505050407040605070500|
// {"media":"warm water","meter":"mkradio3","name":"Duschen","id":"34333231","total_m3":13.8,"target_m3":8.9,"current_date":"2022-04-27T02:00:00Z","prev_date":"2018-12-31T02:00:00Z","timestamp":"1111-11-11T11:11:11Z"} // {"media":"warm water","meter":"mkradio3","name":"Duschen","id":"34333231","total_m3":13.8,"target_m3":8.9,"current_date":"2023-04-27T02:00:00Z","prev_date":"2018-12-31T02:00:00Z","timestamp":"1111-11-11T11:11:11Z"}
// |Duschen;34333231;13.800000;8.900000;2022-04-27T02:00:00Z;2018-12-31T02:00:00Z;1111-11-11 11:11.11 // |Duschen;34333231;13.8;8.9;2023-04-27T02:00:00Z;2018-12-31T02:00:00Z;1111-11-11 11:11.11

Wyświetl plik

@ -37,6 +37,7 @@ namespace
static bool ok = registerDriver([](DriverInfo&di) static bool ok = registerDriver([](DriverInfo&di)
{ {
di.setName("mkradio4"); di.setName("mkradio4");
di.setDefaultFields("name,id,total_m3,target_m3,timestamp");
di.setMeterType(MeterType::WaterMeter); di.setMeterType(MeterType::WaterMeter);
di.addLinkMode(LinkMode::T1); di.addLinkMode(LinkMode::T1);
di.addDetection(MANUFACTURER_TCH, 0x62, 0x95); di.addDetection(MANUFACTURER_TCH, 0x62, 0x95);
@ -52,12 +53,12 @@ namespace
addPrint("total", Quantity::Volume, addPrint("total", Quantity::Volume,
[&](Unit u){ return totalWaterConsumption(u); }, [&](Unit u){ return totalWaterConsumption(u); },
"The total water consumption recorded by this meter.", "The total water consumption recorded by this meter.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("target", Quantity::Volume, addPrint("target", Quantity::Volume,
[&](Unit u){ return targetWaterConsumption(u); }, [&](Unit u){ return targetWaterConsumption(u); },
"The total water consumption recorded at the beginning of this month.", "The total water consumption recorded at the beginning of this month.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
} }
void Driver::processContent(Telegram *t) void Driver::processContent(Telegram *t)
@ -112,4 +113,4 @@ namespace
// Test: Duschagain mkradio4 02410120 NOKEY // Test: Duschagain mkradio4 02410120 NOKEY
// telegram=|2F446850200141029562A2_06702901006017030004000300000000000000000000000000000000000000000000000000| // telegram=|2F446850200141029562A2_06702901006017030004000300000000000000000000000000000000000000000000000000|
// {"media":"warm water","meter":"mkradio4","name":"Duschagain","id":"02410120","total_m3":0.4,"target_m3":0.1,"timestamp":"1111-11-11T11:11:11Z"} // {"media":"warm water","meter":"mkradio4","name":"Duschagain","id":"02410120","total_m3":0.4,"target_m3":0.1,"timestamp":"1111-11-11T11:11:11Z"}
// |Duschagain;02410120;0.400000;0.100000;1111-11-11 11:11.11 // |Duschagain;02410120;0.4;0.1;1111-11-11 11:11.11

Wyświetl plik

@ -44,7 +44,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"target", "target",
"The total water consumption recorded at the end of previous year.", "The total water consumption recorded at the end of previous year.",
PrintProperty::JSON | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -56,7 +56,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"target", "target",
"Date when previous year ended.", "Date when previous year ended.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::PointInTime, Quantity::PointInTime,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -42,7 +42,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Status of meter.", "Status of meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT | PrintProperty::STATUS, DEFAULT_PRINT_PROPERTIES | PrintProperty::STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("02FF20")), .set(DifVifKey("02FF20")),
Translate::Lookup() Translate::Lookup()
@ -58,7 +58,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total", "total",
"The total water consumption recorded by this meter.", "The total water consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -69,7 +69,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"target", "target",
"The total water consumption recorded at the beginning of this month.", "The total water consumption recorded at the beginning of this month.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -81,7 +81,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"flow_temperature", "flow_temperature",
"The water temperature.", "The water temperature.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -93,7 +93,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"external_temperature", "external_temperature",
"The external temperature outside of the meter.", "The external temperature outside of the meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -106,7 +106,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"min_external_temperature", "min_external_temperature",
"The lowest external temperature outside of the meter.", "The lowest external temperature outside of the meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -117,7 +117,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"max_flow", "max_flow",
"The maxium flow recorded during previous period.", "The maxium flow recorded during previous period.",
PrintProperty::FIELD | PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Flow, Quantity::Flow,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -129,7 +129,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"current_status", "current_status",
"Status of meter. This field will go away use status instead.", "Status of meter. This field will go away use status instead.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT | PrintProperty::DEPRECATED, DEFAULT_PRINT_PROPERTIES | PrintProperty::DEPRECATED,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("02FF20")), .set(DifVifKey("02FF20")),
{ {
@ -152,7 +152,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"time_dry", "time_dry",
"Amount of time the meter has been dry.", "Amount of time the meter has been dry.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("02FF20")), .set(DifVifKey("02FF20")),
{ {
@ -179,7 +179,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"time_reversed", "time_reversed",
"Amount of time the meter has been reversed.", "Amount of time the meter has been reversed.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("02FF20")), .set(DifVifKey("02FF20")),
{ {
@ -206,7 +206,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"time_leaking", "time_leaking",
"Amount of time the meter has been leaking.", "Amount of time the meter has been leaking.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("02FF20")), .set(DifVifKey("02FF20")),
{ {
@ -233,7 +233,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"time_bursting", "time_bursting",
"Amount of time the meter has been bursting.", "Amount of time the meter has been bursting.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("02FF20")), .set(DifVifKey("02FF20")),
{ {
@ -272,9 +272,9 @@ namespace
// Test: Vadden multical21 44556677 NOKEY // Test: Vadden multical21 44556677 NOKEY
// telegram=|2D442D2C776655441B168D2083B48D3A20_46887802FF20000004132F4E000092013B3D01A1015B028101E7FF0F03| // telegram=|2D442D2C776655441B168D2083B48D3A20_46887802FF20000004132F4E000092013B3D01A1015B028101E7FF0F03|
// {"media":"cold water","meter":"multical21","name":"Vadden","id":"44556677","status":"OK","total_m3":20.015,"target_m3":null,"flow_temperature_c":2,"external_temperature_c":3,"max_flow_m3h":0.317,"current_status":"","time_dry":"","time_reversed":"","time_leaking":"","time_bursting":"","timestamp":"1111-11-11T11:11:11Z"} // {"media":"cold water","meter":"multical21","name":"Vadden","id":"44556677","status":"OK","total_m3":20.015,"flow_temperature_c":2,"external_temperature_c":3,"max_flow_m3h":0.317,"current_status":"","time_dry":"","time_reversed":"","time_leaking":"","time_bursting":"","timestamp":"1111-11-11T11:11:11Z"}
// |Vadden;44556677;20.015;null;0.317;2;3;OK;1111-11-11 11:11.11 // |Vadden;44556677;20.015;null;0.317;2;3;OK;1111-11-11 11:11.11
// telegram=|21442D2C776655441B168D2079CC8C3A20_F4307912C40DFF00002F4E00003D010203| // telegram=|21442D2C776655441B168D2079CC8C3A20_F4307912C40DFF00002F4E00003D010203|
// {"media":"cold water","meter":"multical21","name":"Vadden","id":"44556677","status":"OK","total_m3":20.015,"target_m3":null,"flow_temperature_c":2,"external_temperature_c":3,"max_flow_m3h":0.317,"current_status":"","time_dry":"","time_reversed":"","time_leaking":"","time_bursting":"","timestamp":"1111-11-11T11:11:11Z"} // {"media":"cold water","meter":"multical21","name":"Vadden","id":"44556677","status":"OK","total_m3":20.015,"flow_temperature_c":2,"external_temperature_c":3,"max_flow_m3h":0.317,"current_status":"","time_dry":"","time_reversed":"","time_leaking":"","time_bursting":"","timestamp":"1111-11-11T11:11:11Z"}
// |Vadden;44556677;20.015;null;0.317;2;3;OK;1111-11-11 11:11.11 // |Vadden;44556677;20.015;null;0.317;2;3;OK;1111-11-11 11:11.11

Wyświetl plik

@ -40,8 +40,8 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Meter status. Reports OK if neither tpl sts nor error flags have bits set.", "Meter status. Reports OK if neither tpl sts nor error flags have bits set.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT | DEFAULT_PRINT_PROPERTIES |
PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS, PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("02FD971D")), .set(DifVifKey("02FD971D")),
Translate::Lookup({ Translate::Lookup({
@ -61,7 +61,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_temperature", "current_temperature",
"The current temperature.", "The current temperature.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -72,7 +72,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_relative_humidity", "current_relative_humidity",
"The current relative humidity.", "The current relative humidity.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::RelativeHumidity, Quantity::RelativeHumidity,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -62,7 +62,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_consumption", "total_energy_consumption",
"The total energy consumption recorded by this meter.", "The total energy consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -73,7 +73,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_production", "total_energy_production",
"The total energy backward (production) recorded by this meter.", "The total energy backward (production) recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -85,7 +85,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_power_consumption", "current_power_consumption",
"The current power consumption.", "The current power consumption.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -96,7 +96,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_power_production", "current_power_production",
"The current power production.", "The current power production.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -41,13 +41,12 @@ namespace
addStringField( addStringField(
"status", "status",
"Meter status from tpl status field.", "Meter status from tpl status field.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT | PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS);
PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS);
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"temperature", "temperature",
"The current temperature.", "The current temperature.",
PrintProperty::JSON | PrintProperty::FIELD, PrintProperty::REQUIRED,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -58,7 +57,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"average_temperature_1h", "average_temperature_1h",
"The average temperature over the last hour.", "The average temperature over the last hour.",
PrintProperty::JSON | PrintProperty::FIELD, PrintProperty::REQUIRED,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -70,7 +69,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"average_temperature_24h", "average_temperature_24h",
"The average temperature over the last 24 hours.", "The average temperature over the last 24 hours.",
PrintProperty::JSON | PrintProperty::FIELD, PrintProperty::REQUIRED,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -82,7 +81,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"relative_humidity", "relative_humidity",
"The current relative humidity.", "The current relative humidity.",
PrintProperty::JSON | PrintProperty::FIELD, PrintProperty::REQUIRED,
Quantity::RelativeHumidity, Quantity::RelativeHumidity,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -93,7 +92,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"relative_humidity_1h", "relative_humidity_1h",
"The average relative humidity over the last hour.", "The average relative humidity over the last hour.",
PrintProperty::JSON | PrintProperty::FIELD, PrintProperty::REQUIRED,
Quantity::RelativeHumidity, Quantity::RelativeHumidity,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -105,7 +104,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"relative_humidity_24h", "relative_humidity_24h",
"The average relative humidity over the last 24 hours.", "The average relative humidity over the last 24 hours.",
PrintProperty::JSON | PrintProperty::FIELD, PrintProperty::REQUIRED,
Quantity::RelativeHumidity, Quantity::RelativeHumidity,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -26,6 +26,7 @@ namespace
static bool ok = registerDriver([](DriverInfo&di) static bool ok = registerDriver([](DriverInfo&di)
{ {
di.setName("pollucomf"); di.setName("pollucomf");
di.setDefaultFields("name,id,status,total_kwh,total_m3,target_kwh,target_m3,timestamp");
di.setMeterType(MeterType::HeatMeter); di.setMeterType(MeterType::HeatMeter);
di.addLinkMode(LinkMode::T1); // default di.addLinkMode(LinkMode::T1); // default
di.addLinkMode(LinkMode::C1); di.addLinkMode(LinkMode::C1);
@ -39,13 +40,13 @@ namespace
addStringField( addStringField(
"status", "status",
"Meter status.", "Meter status.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT | DEFAULT_PRINT_PROPERTIES |
PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS); PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS);
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total", "total",
"The total energy consumption recorded by this meter.", "The total energy consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -56,7 +57,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total", "total",
"The total amount of water that has passed through this meter.", "The total amount of water that has passed through this meter.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -67,7 +68,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"power", "power",
"The active power consumption.", "The active power consumption.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -78,7 +79,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"flow", "flow",
"The flow of water.", "The flow of water.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Flow, Quantity::Flow,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -89,7 +90,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"forward", "forward",
"The forward temperature of the water.", "The forward temperature of the water.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -100,7 +101,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"return", "return",
"The return temperature of the water.", "The return temperature of the water.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -111,7 +112,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"target_date", "target_date",
"The most recent billing period date.", "The most recent billing period date.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -121,7 +122,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"target", "target",
"The energy consumption recorded by this meter at the set date.", "The energy consumption recorded by this meter at the set date.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -133,7 +134,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"target", "target",
"The amount of water that had passed through this meter at the set date.", "The amount of water that had passed through this meter at the set date.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -145,7 +146,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"forward_max", "forward_max",
"The maximum forward temperature of the water.", "The maximum forward temperature of the water.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -157,7 +158,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"return_max", "return_max",
"The maximum return temperature of the water.", "The maximum return temperature of the water.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -169,7 +170,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"flow_max", "flow_max",
"The maximum forward flow of water through this meter.", "The maximum forward flow of water through this meter.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Flow, Quantity::Flow,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -185,5 +186,5 @@ namespace
// Test: Heat pollucomf 14175439 NOKEY // Test: Heat pollucomf 14175439 NOKEY
// Comment: // Comment:
// telegram=|5e44ae4c395417141d047a9f0050252f2f046d2d32d92c0223B701040600000000041331000000032B000000033B000000025a3201025ef2003222000002fd170000426cBf2c440600000000441301000000525a0000525e0000533B000000| // telegram=|5e44ae4c395417141d047a9f0050252f2f046d2d32d92c0223B701040600000000041331000000032B000000033B000000025a3201025ef2003222000002fd170000426cBf2c440600000000441301000000525a0000525e0000533B000000|
// {"media":"heat","meter":"pollucomf","name":"Heat","id":"14175439","status":"OK","total_kwh":0,"total_m3":0.049,"power_kw":0,"flow_m3h":0,"forward_c":30.6,"return_c":24.2,"target_date":"2021-12-31","target_kwh":0,"target_m3":0.001,"forward_max_c":0,"return_max_c":0,"flow_max_m3h":0,"on_time_h":10536,"on_time_at_error_h":0,"meter_datetime":"2022-12-25 18:45","timestamp":"1111-11-11T11:11:11Z"} // {"media":"heat","meter":"pollucomf","name":"Heat","id":"14175439","status":"OK","total_kwh":0,"total_m3":0.049,"power_kw":0,"flow_m3h":0,"forward_c":30.6,"return_c":24.2,"target_date":"2021-12-31","target_kwh":0,"target_m3":0.001,"forward_max_c":0,"return_max_c":0,"flow_max_m3h":0,"on_time_h":10536,"on_time_at_error_h":0,"meter_datetime":"2022-12-25 18:45","timestamp":"1111-11-11T11:11:11Z"}
// |Heat;14175439;OK;0.000000;0.049000;0.000000;0.001000;1111-11-11 11:11.11 // |Heat;14175439;OK;0;0.049;0;0.001;1111-11-11 11:11.11

Wyświetl plik

@ -42,12 +42,12 @@ namespace
addStringField( addStringField(
"status", "status",
"Status and error flags.", "Status and error flags.",
PrintProperty::JSON | PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS); DEFAULT_PRINT_PROPERTIES | PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS);
addStringFieldWithExtractor( addStringFieldWithExtractor(
"set_datetime", "set_datetime",
"Date and time when the previous billing period ended.", "Date and time when the previous billing period ended.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::DateTime) .set(VIFRange::DateTime)
@ -57,7 +57,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"consumption_at_set_date", "consumption_at_set_date",
"The total water consumption at the end of the previous billing period.", "The total water consumption at the end of the previous billing period.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -69,7 +69,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"forward_at_set_date", "forward_at_set_date",
"The total media volume flowing forward at the end of previous billing period.", "The total media volume flowing forward at the end of previous billing period.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -82,7 +82,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"backward_at_set_date", "backward_at_set_date",
"The total media volume flowing backward at the end of the previous billing period.", "The total media volume flowing backward at the end of the previous billing period.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -48,8 +48,8 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Meter status from tpl status field.", "Meter status from tpl status field.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT | DEFAULT_PRINT_PROPERTIES |
PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS, PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("01FD73")), .set(DifVifKey("01FD73")),
Translate::Lookup( Translate::Lookup(
@ -70,7 +70,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_consumption", "current_consumption",
"The current heat cost allocation.", "The current heat cost allocation.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::HCA, Quantity::HCA,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -81,7 +81,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"set_date", "set_date",
"The most recent billing period date.", "The most recent billing period date.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -91,7 +91,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"consumption_at_set_date", "consumption_at_set_date",
"Heat cost allocation at the most recent billing period date.", "Heat cost allocation at the most recent billing period date.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::HCA, Quantity::HCA,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -103,7 +103,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"set_date_1", "set_date_1",
"The most recent billing period date.", "The most recent billing period date.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -113,7 +113,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"consumption_at_set_date_1", "consumption_at_set_date_1",
"Heat cost allocation at the most recent billing period date.", "Heat cost allocation at the most recent billing period date.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::HCA, Quantity::HCA,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -125,7 +125,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"set_date_8", "set_date_8",
"The 8 billing period date.", "The 8 billing period date.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -135,7 +135,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"consumption_at_set_date_8", "consumption_at_set_date_8",
"Heat cost allocation at the 8 billing period date.", "Heat cost allocation at the 8 billing period date.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::HCA, Quantity::HCA,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -147,7 +147,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"set_date_17", "set_date_17",
"The 17 billing period date.", "The 17 billing period date.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -157,7 +157,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"consumption_at_set_date_17", "consumption_at_set_date_17",
"Heat cost allocation at the 17 billing period date.", "Heat cost allocation at the 17 billing period date.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::HCA, Quantity::HCA,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -169,7 +169,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"error_date", "error_date",
"Date when the meter entered an error state.", "Date when the meter entered an error state.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::AtError) .set(MeasurementType::AtError)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -178,7 +178,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"device_date_time", "device_date_time",
"Date and time when the meter sent the telegram.", "Date and time when the meter sent the telegram.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::DateTime) .set(VIFRange::DateTime)
@ -187,7 +187,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"model_version", "model_version",
"model version.", "model version.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::ModelVersion) .set(VIFRange::ModelVersion)
@ -196,7 +196,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"flow_temperature", "flow_temperature",
"Forward media temperature.", "Forward media temperature.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -215,7 +215,7 @@ namespace
// Test: MyElement2 qcaloric 90919293 NOKEY // Test: MyElement2 qcaloric 90919293 NOKEY
// Comment: Test mostly proprietary telegram without values // Comment: Test mostly proprietary telegram without values
// telegram=|49449344939291903408780DFF5F350082180000800007B06EFFFF970000009F2C70020000BE26970000000000010018002E001F002E0023FF210008000500020000002F046D220FA227| // telegram=|49449344939291903408780DFF5F350082180000800007B06EFFFF970000009F2C70020000BE26970000000000010018002E001F002E0023FF210008000500020000002F046D220FA227|
// {"media":"heat cost allocation","meter":"qcaloric","name":"MyElement2","id":"90919293","status":"OK","current_consumption_hca":null,"set_date":null,"consumption_at_set_date_hca":null,"set_date_1":null,"consumption_at_set_date_1_hca":null,"device_date_time":"2021-07-02 15:34","timestamp":"1111-11-11T11:11:11Z"} // {"media":"heat cost allocation","meter":"qcaloric","name":"MyElement2","id":"90919293","status":"OK","device_date_time":"2021-07-02 15:34","timestamp":"1111-11-11T11:11:11Z"}
// |MyElement2;90919293;null;null;null;1111-11-11 11:11.11 // |MyElement2;90919293;null;null;null;1111-11-11 11:11.11
// Comment: Normal telegram that fills in values. // Comment: Normal telegram that fills in values.
@ -237,7 +237,7 @@ namespace
// Comment: Another version of the heat cost allocator. Was known as whe46x, which now is a name alias mapped to qcaloric. // Comment: Another version of the heat cost allocator. Was known as whe46x, which now is a name alias mapped to qcaloric.
// Test: HCA2 whe46x 60366655 NOKEY // Test: HCA2 whe46x 60366655 NOKEY
// telegram=|344465325566366018087A90040000046D1311962C01FD0C03326CFFFF01FD7300025AC2000DFF5F0C0008003030810613080BFFFC| // telegram=|344465325566366018087A90040000046D1311962C01FD0C03326CFFFF01FD7300025AC2000DFF5F0C0008003030810613080BFFFC|
// {"media":"heat cost allocation","meter":"qcaloric","name":"HCA2","id":"60366655","status":"POWER_LOW","current_consumption_hca":null,"set_date":null,"consumption_at_set_date_hca":null,"set_date_1":null,"consumption_at_set_date_1_hca":null,"error_date":"2127-15-31","device_date_time":"2020-12-22 17:19","model_version":"03","flow_temperature_c":19.4,"timestamp":"1111-11-11T11:11:11Z"} // {"media":"heat cost allocation","meter":"qcaloric","name":"HCA2","id":"60366655","status":"POWER_LOW","error_date":"2127-15-31","device_date_time":"2020-12-22 17:19","model_version":"03","flow_temperature_c":19.4,"timestamp":"1111-11-11T11:11:11Z"}
// |HCA2;60366655;null;null;null;1111-11-11 11:11.11 // |HCA2;60366655;null;null;null;1111-11-11 11:11.11
// telegram=|2a4465325566366018087ac3040000046d1617Ba210B6e890000426c9f2c4B6e520600326cffff01fd7300| // telegram=|2a4465325566366018087ac3040000046d1617Ba210B6e890000426c9f2c4B6e520600326cffff01fd7300|

Wyświetl plik

@ -41,7 +41,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Meter status.", "Meter status.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS, DEFAULT_PRINT_PROPERTIES | PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::ErrorFlags), .set(VIFRange::ErrorFlags),
@ -78,7 +78,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_consumption", "total_energy_consumption",
"The total energy consumption recorded by this meter.", "The total energy consumption recorded by this meter.",
PrintProperty::FIELD | PrintProperty::JSON | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -89,7 +89,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"last_month_date", "last_month_date",
"Last day previous month when total energy consumption was recorded.", "Last day previous month when total energy consumption was recorded.",
PrintProperty::FIELD | PrintProperty::JSON | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(StorageNr(17)) .set(StorageNr(17))
@ -99,7 +99,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"last_month_energy_consumption", "last_month_energy_consumption",
"The total energy consumption recorded at the last day of the previous month.", "The total energy consumption recorded at the last day of the previous month.",
PrintProperty::FIELD | PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -111,7 +111,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"last_year_date", "last_year_date",
"Last day previous year when total energy consumption was recorded.", "Last day previous year when total energy consumption was recorded.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(StorageNr(1)) .set(StorageNr(1))
@ -121,7 +121,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"last_year_energy_consumption", "last_year_energy_consumption",
"The total energy consumption recorded at the last day of the previous year.", "The total energy consumption recorded at the last day of the previous year.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -133,7 +133,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"device_date_time", "device_date_time",
"Device date time.", "Device date time.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::DateTime) .set(VIFRange::DateTime)
@ -142,7 +142,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"device_error_date", "device_error_date",
"Device error date.", "Device error date.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::AtError) .set(MeasurementType::AtError)
.set(VIFRange::Date) .set(VIFRange::Date)

Wyświetl plik

@ -51,7 +51,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"device_date_time", "device_date_time",
"Device date time.", "Device date time.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::DateTime) .set(VIFRange::DateTime)
@ -60,7 +60,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_consumption", "total_energy_consumption",
"The total energy consumption recorded by this meter.", "The total energy consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -74,7 +74,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"key_date", "key_date",
"The key (billing) date", "The key (billing) date",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::DateTime) .set(VIFRange::DateTime)
@ -86,7 +86,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"key_date", "key_date",
"The total energy consumption recorded at key (billing) date", "The total energy consumption recorded at key (billing) date",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -100,7 +100,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"prev_month", "prev_month",
"The date of end of last month.", "The date of end of last month.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::DateTime) .set(VIFRange::DateTime)
@ -118,7 +118,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
key, key,
info, info,
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -133,7 +133,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"actuality_duration", "actuality_duration",
"The time between the measurement and the sending of this telegram.", "The time between the measurement and the sending of this telegram.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Time, Quantity::Time,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -144,7 +144,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"time_without_measurement", "time_without_measurement",
"How long the meter has been in an error state and unable to measure values, while powered up.", "How long the meter has been in an error state and unable to measure values, while powered up.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Time, Quantity::Time,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -40,8 +40,8 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Meter error flags. IMPORTANT! Smoke alarm is probably NOT reported here! You MUST check last alarm date and counter!", "Meter error flags. IMPORTANT! Smoke alarm is probably NOT reported here! You MUST check last alarm date and counter!",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT | DEFAULT_PRINT_PROPERTIES |
PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS, PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(VIFRange::ErrorFlags), .set(VIFRange::ErrorFlags),
Translate::Lookup( Translate::Lookup(
@ -61,7 +61,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"last_alarm_date", "last_alarm_date",
"Date when the smoke alarm last triggered.", "Date when the smoke alarm last triggered.",
PrintProperty::FIELD | PrintProperty::JSON | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(StorageNr(6)) .set(StorageNr(6))
@ -71,7 +71,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"alarm", "alarm",
"Number of times the smoke alarm has triggered.", "Number of times the smoke alarm has triggered.",
PrintProperty::FIELD | PrintProperty::JSON | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Counter, Quantity::Counter,
VifScaling::None, VifScaling::None,
FieldMatcher::build() FieldMatcher::build()
@ -81,7 +81,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"message_datetime", "message_datetime",
"Device date time.", "Device date time.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::DateTime) .set(VIFRange::DateTime)
@ -90,7 +90,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"test_button_last_date", "test_button_last_date",
"Date when test button was last pressed.", "Date when test button was last pressed.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(StorageNr(4)) .set(StorageNr(4))
@ -100,7 +100,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"test_button", "test_button",
"Number of times the test button has been pressed.", "Number of times the test button has been pressed.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Counter, Quantity::Counter,
VifScaling::None, VifScaling::None,
FieldMatcher::build() FieldMatcher::build()
@ -110,7 +110,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"transmission", "transmission",
"Transmission counter?", "Transmission counter?",
PrintProperty::FIELD | PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Counter, Quantity::Counter,
VifScaling::None, VifScaling::None,
FieldMatcher::build() FieldMatcher::build()
@ -121,7 +121,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"at_error_date", "at_error_date",
"Date when the device entered an error state.", "Date when the device entered an error state.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::AtError) .set(MeasurementType::AtError)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -130,7 +130,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"some_sort_of_duration", "some_sort_of_duration",
"What does this mean?", "What does this mean?",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Time, Quantity::Time,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -27,6 +27,8 @@ namespace
static bool ok = registerDriver([](DriverInfo&di) static bool ok = registerDriver([](DriverInfo&di)
{ {
di.setName("qualcosonic"); di.setName("qualcosonic");
di.setDefaultFields("name,id,status,total_heat_energy_kwh,total_cooling_energy_kwh,"
"power_kw,target_datetime,target_heat_energy_kwh,target_cooling_energy_kwh,timestamp");
di.setMeterType(MeterType::HeatCoolingMeter); di.setMeterType(MeterType::HeatCoolingMeter);
di.addLinkMode(LinkMode::C1); di.addLinkMode(LinkMode::C1);
di.addDetection(MANUFACTURER_AXI, 0x0d, 0x0b); di.addDetection(MANUFACTURER_AXI, 0x0d, 0x0b);
@ -41,8 +43,8 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Meter status. Includes both meter error field and tpl status field.", "Meter status. Includes both meter error field and tpl status field.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT | DEFAULT_PRINT_PROPERTIES |
PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS, PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(VIFRange::ErrorFlags), .set(VIFRange::ErrorFlags),
Translate::Lookup( Translate::Lookup(
@ -64,7 +66,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_heat_energy", "total_heat_energy",
"The total heating energy consumption recorded by this meter.", "The total heating energy consumption recorded by this meter.",
PrintProperty::FIELD | PrintProperty::JSON | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -76,7 +78,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_cooling_energy", "total_cooling_energy",
"The total cooling energy consumption recorded by this meter.", "The total cooling energy consumption recorded by this meter.",
PrintProperty::FIELD | PrintProperty::JSON | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -88,7 +90,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"power", "power",
"The current power consumption.", "The current power consumption.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::AutoSigned, VifScaling::AutoSigned,
FieldMatcher::build() FieldMatcher::build()
@ -99,7 +101,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"target_datetime", "target_datetime",
"Date and time when the previous billing period ended.", "Date and time when the previous billing period ended.",
PrintProperty::FIELD | PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::DateTime) .set(VIFRange::DateTime)
@ -109,7 +111,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"target_heat_energy", "target_heat_energy",
"The heating energy consumption recorded at the end of the previous billing period.", "The heating energy consumption recorded at the end of the previous billing period.",
PrintProperty::FIELD | PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -122,7 +124,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"target_cooling_energy", "target_cooling_energy",
"The cooling energy consumption recorded at the end of the previous billing period.", "The cooling energy consumption recorded at the end of the previous billing period.",
PrintProperty::FIELD | PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -138,4 +140,4 @@ namespace
// Test: qualco qualcosonic 03016408 NOKEY // Test: qualco qualcosonic 03016408 NOKEY
// telegram=|76440907086401030B0d7a78000000046d030fB726346d0000010134fd170000000004200f13cf0104240f13cf0104863B0000000004863cdc0000000413B5150600042B86f1ffff043B030200000259c002025d2c05026194fd0c780864010384086d3B17Bf258408863B000000008408863c0B000000| // telegram=|76440907086401030B0d7a78000000046d030fB726346d0000010134fd170000000004200f13cf0104240f13cf0104863B0000000004863cdc0000000413B5150600042B86f1ffff043B030200000259c002025d2c05026194fd0c780864010384086d3B17Bf258408863B000000008408863c0B000000|
// {"media":"heat/cooling load","meter":"qualcosonic","name":"qualco","id":"03016408","fabrication_no":"03016408","operating_time_h":8430.013056,"on_time_h":8430.013056,"meter_datetime":"2021-06-23 15:03","meter_datetime_at_error":"2000-01-01 00:00","total_m3":398.773,"flow_temperature_c":7.04,"return_temperature_c":13.24,"flow_return_temperature_difference_c":-6.2,"volume_flow_m3h":0.515,"status":"OK","total_heat_energy_kwh":0,"total_cooling_energy_kwh":220,"power_kw":-3.706,"target_datetime":"2021-05-31 23:59","target_heat_energy_kwh":0,"target_cooling_energy_kwh":11,"timestamp":"1111-11-11T11:11:11Z"} // {"media":"heat/cooling load","meter":"qualcosonic","name":"qualco","id":"03016408","fabrication_no":"03016408","operating_time_h":8430.013056,"on_time_h":8430.013056,"meter_datetime":"2021-06-23 15:03","meter_datetime_at_error":"2000-01-01 00:00","total_m3":398.773,"flow_temperature_c":7.04,"return_temperature_c":13.24,"flow_return_temperature_difference_c":-6.2,"volume_flow_m3h":0.515,"status":"OK","total_heat_energy_kwh":0,"total_cooling_energy_kwh":220,"power_kw":-3.706,"target_datetime":"2021-05-31 23:59","target_heat_energy_kwh":0,"target_cooling_energy_kwh":11,"timestamp":"1111-11-11T11:11:11Z"}
// |qualco;03016408;OK;0.000000;220.000000;-3.706000;2021-05-31 23:59;0.000000;11.000000;1111-11-11 11:11.11 // |qualco;03016408;OK;0;220;-3.706;2021-05-31 23:59;0;11;1111-11-11 11:11.11

Wyświetl plik

@ -52,12 +52,12 @@ namespace
addStringField( addStringField(
"status", "status",
"Meter status tpl status field.", "Meter status tpl status field.",
PrintProperty::JSON | PrintProperty::IMPORTANT | PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS); DEFAULT_PRINT_PROPERTIES | PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS);
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"due_date", "due_date",
"The water consumption at the due date.", "The water consumption at the due date.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -69,7 +69,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"due", "due",
"The due date for billing date.", "The due date for billing date.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::PointInTime, Quantity::PointInTime,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -82,7 +82,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"due_17_date", "due_17_date",
"The water consumption at the 17 due date.", "The water consumption at the 17 due date.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -94,7 +94,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"due_17", "due_17",
"The due date for billing date.", "The due date for billing date.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::PointInTime, Quantity::PointInTime,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -107,7 +107,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"volume_flow", "volume_flow",
"Media volume flow when duration exceeds lower last.", "Media volume flow when duration exceeds lower last.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Flow, Quantity::Flow,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -119,7 +119,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"error", "error",
"The date the error occured at. If no error, reads 2127-15-31 (FFFF).", "The date the error occured at. If no error, reads 2127-15-31 (FFFF).",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::PointInTime, Quantity::PointInTime,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -39,13 +39,13 @@ namespace
addStringField( addStringField(
"status", "status",
"Meter status from tpl status field.", "Meter status from tpl status field.",
PrintProperty::JSON | PrintProperty::IMPORTANT | DEFAULT_PRINT_PROPERTIES |
PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS); PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS);
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_temperature", "current_temperature",
"The current temperature.", "The current temperature.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -56,7 +56,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"average_temperature_1h", "average_temperature_1h",
"The average temperature over the last hour.", "The average temperature over the last hour.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -68,7 +68,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"average_temperature_24h", "average_temperature_24h",
"The average temperature over the last 24 hours.", "The average temperature over the last 24 hours.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -80,7 +80,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"maximum_temperature_1h", "maximum_temperature_1h",
"The maximum temperature over the last hour.", "The maximum temperature over the last hour.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -91,7 +91,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"maximum_temperature_24h", "maximum_temperature_24h",
"The maximum temperature over the last 24 hours.", "The maximum temperature over the last 24 hours.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -103,7 +103,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"minimum_temperature_1h", "minimum_temperature_1h",
"The minimum temperature over the last hour.", "The minimum temperature over the last hour.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -114,7 +114,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"minimum_temperature_24h", "minimum_temperature_24h",
"The minimum temperature over the last 24 hours.", "The minimum temperature over the last 24 hours.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -126,7 +126,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_relative_humidity", "current_relative_humidity",
"The current relative humidity.", "The current relative humidity.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::RelativeHumidity, Quantity::RelativeHumidity,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -137,7 +137,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"average_relative_humidity_1h", "average_relative_humidity_1h",
"The average relative humidity over the last hour.", "The average relative humidity over the last hour.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::RelativeHumidity, Quantity::RelativeHumidity,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -149,7 +149,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"average_relative_humidity_24h", "average_relative_humidity_24h",
"The average relative humidity over the last 24 hours.", "The average relative humidity over the last 24 hours.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::RelativeHumidity, Quantity::RelativeHumidity,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -161,7 +161,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"maximum_relative_humidity_1h", "maximum_relative_humidity_1h",
"The maximum relative humidity over the last hour.", "The maximum relative humidity over the last hour.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::RelativeHumidity, Quantity::RelativeHumidity,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -172,7 +172,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"maximum_relative_humidity_24h", "maximum_relative_humidity_24h",
"The maximum relative humidity over the last 24 hours.", "The maximum relative humidity over the last 24 hours.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::RelativeHumidity, Quantity::RelativeHumidity,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -184,7 +184,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"minimum_relative_humidity_1h", "minimum_relative_humidity_1h",
"The minimum relative humidity over the last hour.", "The minimum relative humidity over the last hour.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::RelativeHumidity, Quantity::RelativeHumidity,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -195,7 +195,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"minimum_relative_humidity_24h", "minimum_relative_humidity_24h",
"The minimum relative humidity over the last 24 hours.", "The minimum relative humidity over the last 24 hours.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::RelativeHumidity, Quantity::RelativeHumidity,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -207,7 +207,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"device", "device",
"The meters date time.", "The meters date time.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::PointInTime, Quantity::PointInTime,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -40,7 +40,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total", "total",
"The total water consumption recorded by this meter.", "The total water consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -51,7 +51,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"meter_datetime", "meter_datetime",
"Date time when meter sent this telegram.", "Date time when meter sent this telegram.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::DateTime)); .set(VIFRange::DateTime));

Wyświetl plik

@ -27,6 +27,7 @@ namespace
static bool ok = registerDriver([](DriverInfo&di) static bool ok = registerDriver([](DriverInfo&di)
{ {
di.setName("sensostar"); di.setName("sensostar");
di.setDefaultFields("name,id,total_kwh,total_water_m3,current_status,reporting_date,energy_consumption_at_reporting_date_kwh,timestamp");
di.setMeterType(MeterType::HeatMeter); di.setMeterType(MeterType::HeatMeter);
di.addLinkMode(LinkMode::C1); di.addLinkMode(LinkMode::C1);
di.addLinkMode(LinkMode::T1); di.addLinkMode(LinkMode::T1);
@ -39,7 +40,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"meter_timestamp", "meter_timestamp",
"Date time for this reading.", "Date time for this reading.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::DateTime) .set(VIFRange::DateTime)
@ -48,7 +49,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total", "total",
"The total energy consumption recorded by this meter.", "The total energy consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -59,7 +60,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"power", "power",
"The active power consumption.", "The active power consumption.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -70,7 +71,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"power_max", "power_max",
"The maximum power consumption over ?period?.", "The maximum power consumption over ?period?.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -81,7 +82,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"flow_water", "flow_water",
"The flow of water.", "The flow of water.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Flow, Quantity::Flow,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -92,7 +93,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"flow_water_max", "flow_water_max",
"The maximum forward flow of water over a ?period?.", "The maximum forward flow of water over a ?period?.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Flow, Quantity::Flow,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -103,7 +104,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"forward", "forward",
"The forward temperature of the water.", "The forward temperature of the water.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -114,7 +115,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"return", "return",
"The return temperature of the water.", "The return temperature of the water.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -125,7 +126,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"difference", "difference",
"The temperature difference forward-return for the water.", "The temperature difference forward-return for the water.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::AutoSigned, VifScaling::AutoSigned,
FieldMatcher::build() FieldMatcher::build()
@ -136,7 +137,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_water", "total_water",
"The total amount of water that has passed through this meter.", "The total amount of water that has passed through this meter.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -147,7 +148,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"current_status", "current_status",
"Status and error flags.", "Status and error flags.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(VIFRange::ErrorFlags), .set(VIFRange::ErrorFlags),
{ {
@ -175,7 +176,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"reporting_date", "reporting_date",
"The reporting date of the last billing period.", "The reporting date of the last billing period.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -185,7 +186,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"energy_consumption_at_reporting_date", "energy_consumption_at_reporting_date",
"The energy consumption at the last billing period date.", "The energy consumption at the last billing period date.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -202,7 +203,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
name, name,
info, info,
PrintProperty::JSON| PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -217,10 +218,10 @@ namespace
// Comment: // Comment:
// telegram=|68B3B36808007257004820c51400046c100000047839803801040600000000041300000000042B00000000142B00000000043B00000000143B00000000025B1400025f15000261daff02235c00046d2c2ddc24440600000000441300000000426c000001fd171003fd0c05000084200600000000c420060000000084300600000000c430060000000084401300000000c44013000000008480401300000000c48040130000000084c0401300000000c4c0401300000000a216| // 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"} // {"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"}
// |Heat;20480057;0.000000;0.000000;ERROR_FLOW_MEASUREMENT_SYSTEM_ERROR;2000-00-00;0.000000;1111-11-11 11:11.11 // |Heat;20480057;0;0;ERROR_FLOW_MEASUREMENT_SYSTEM_ERROR;2000-00-00;0;1111-11-11 11:11.11
// Test: WMZ sensostar 02752560 NOKEY // Test: WMZ sensostar 02752560 NOKEY
// Comment: from "Sensostar U" // Comment: from "Sensostar U"
//telegram=a444c5146025750200047ac20000202f2f046d2e26c62a040643160000041310f0050001fd1700426cbf2c4406570e00008401061f160000840206f6150000840306f5150000840406f3150000840506ea150000840606bf1500008407065214000084080692120000840906c5100000840a06570e0000840b06ca0b0000840c06da090000840d06ca080000840e06c8080000840f06c608000003fd0c05010002fd0b2111 //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"} //{"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.000000;389.136000;OK;1111-11-11 11:11.11 //WMZ;02752560;5699;389.136000;OK;1111-11-11 11:11.11

Wyświetl plik

@ -28,6 +28,9 @@ namespace
static bool ok = registerDriver([](DriverInfo&di) static bool ok = registerDriver([](DriverInfo&di)
{ {
di.setName("sharky"); di.setName("sharky");
di.setDefaultFields("name,id,total_energy_consumption_kwh,total_energy_consumption_tariff1_kwh,total_volume_m3,"
"total_volume_tariff2_m3,volume_flow_m3h,power_kw,flow_temperature_c,"
"return_temperature_c,temperature_difference_c,timestamp");
di.setMeterType(MeterType::HeatMeter); di.setMeterType(MeterType::HeatMeter);
di.addLinkMode(LinkMode::T1); di.addLinkMode(LinkMode::T1);
di.addDetection(MANUFACTURER_HYD, 0x04, 0x20); di.addDetection(MANUFACTURER_HYD, 0x04, 0x20);
@ -39,7 +42,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_consumption", "total_energy_consumption",
"The total heat energy consumption recorded by this meter.", "The total heat energy consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -50,7 +53,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_consumption_tariff1", "total_energy_consumption_tariff1",
"The total heat energy consumption recorded by this meter on tariff 1.", "The total heat energy consumption recorded by this meter on tariff 1.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -62,7 +65,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_volume", "total_volume",
"The total heating media volume recorded by this meter.", "The total heating media volume recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -73,7 +76,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_volume_tariff2", "total_volume_tariff2",
"The total heating media volume recorded by this meter on tariff 2.", "The total heating media volume recorded by this meter on tariff 2.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -85,7 +88,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"volume_flow", "volume_flow",
"The current heat media volume flow.", "The current heat media volume flow.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Flow, Quantity::Flow,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -96,7 +99,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"power", "power",
"The current power consumption.", "The current power consumption.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -107,7 +110,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"flow_temperature", "flow_temperature",
"The current forward heat media temperature.", "The current forward heat media temperature.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -118,7 +121,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"return_temperature", "return_temperature",
"The current return heat media temperature.", "The current return heat media temperature.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -129,7 +132,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"temperature_difference", "temperature_difference",
"The current return heat media temperature.", "The current return heat media temperature.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::AutoSigned, VifScaling::AutoSigned,
FieldMatcher::build() FieldMatcher::build()
@ -142,4 +145,4 @@ namespace
// Test: Heat sharky ANYID NOKEY // Test: Heat sharky ANYID NOKEY
// telegram=|534424232004256092687A370045752235854DEEEA5939FAD81C25FEEF5A23C38FB9168493C563F08DB10BAF87F660FBA91296BA2397E8F4220B86D3A192FB51E0BFCF24DCE72118E0C75A9E89F43BDFE370824B| // telegram=|534424232004256092687A370045752235854DEEEA5939FAD81C25FEEF5A23C38FB9168493C563F08DB10BAF87F660FBA91296BA2397E8F4220B86D3A192FB51E0BFCF24DCE72118E0C75A9E89F43BDFE370824B|
// {"media":"heat","meter":"sharky","name":"Heat","id":"68926025","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,"power_kw":0,"flow_temperature_c":42.3,"return_temperature_c":28.1,"temperature_difference_c":14.1,"timestamp":"1111-11-11T11:11:11Z"} // {"media":"heat","meter":"sharky","name":"Heat","id":"68926025","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,"power_kw":0,"flow_temperature_c":42.3,"return_temperature_c":28.1,"temperature_difference_c":14.1,"timestamp":"1111-11-11T11:11:11Z"}
// |Heat;68926025;2651.000000;0.000000;150.347000;0.018000;0.000000;0.000000;42.300000;28.100000;14.100000;1111-11-11 11:11.11 // |Heat;68926025;2651;0;150.347;0.018;0;0;42.3;28.1;14.1;1111-11-11 11:11.11

Wyświetl plik

@ -45,7 +45,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_consumption", "total_energy_consumption",
"The total energy consumption recorded by this meter.", "The total energy consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -56,7 +56,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_cooling_consumption", "total_cooling_consumption",
"The total cooling energy consumption recorded by this meter.", "The total cooling energy consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -68,7 +68,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_volume", "total_volume",
"The total volume recorded by this meter.", "The total volume recorded by this meter.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -79,7 +79,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_cooling_volume", "total_cooling_volume",
"The total cooling volume recorded by this meter.", "The total cooling volume recorded by this meter.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -91,7 +91,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"volume_flow", "volume_flow",
"The current flow.", "The current flow.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Flow, Quantity::Flow,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -102,7 +102,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"power", "power",
"The power.", "The power.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::AutoSigned, VifScaling::AutoSigned,
FieldMatcher::build() FieldMatcher::build()
@ -113,7 +113,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"flow_temperature", "flow_temperature",
"The flow temperature.", "The flow temperature.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -124,7 +124,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"return_temperature", "return_temperature",
"The return temperature.", "The return temperature.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -135,7 +135,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"operating_time", "operating_time",
"How long the meter has been collecting data.", "How long the meter has been collecting data.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Time, Quantity::Time,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -146,7 +146,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"operating_time_in_error", "operating_time_in_error",
"How long the meter has been in an error state and not collected data.", "How long the meter has been in an error state and not collected data.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Time, Quantity::Time,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -158,7 +158,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"energy_at_set_date", "energy_at_set_date",
"The total energy consumption recorded by this meter at the set date.", "The total energy consumption recorded by this meter at the set date.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -170,7 +170,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"cooling_at_set_date", "cooling_at_set_date",
"The total cooling energy consumption recorded by this meter at the set date.", "The total cooling energy consumption recorded by this meter at the set date.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -183,7 +183,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"set", "set",
"The last billing set date.", "The last billing set date.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::PointInTime, Quantity::PointInTime,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -41,7 +41,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_consumption", "current_consumption",
"The current heat cost allocation for this meter.", "The current heat cost allocation for this meter.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::HCA, Quantity::HCA,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -52,7 +52,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"set_date", "set_date",
"The most recent billing period date.", "The most recent billing period date.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -62,7 +62,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"consumption_at_set_date", "consumption_at_set_date",
"Heat cost allocation at the most recent billing period date.", "Heat cost allocation at the most recent billing period date.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::HCA, Quantity::HCA,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -74,7 +74,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_temp", "current_temp",
"The current temperature of the heating element.", "The current temperature of the heating element.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -85,7 +85,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_room_temp", "current_room_temp",
"The current room temperature.", "The current room temperature.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -96,7 +96,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"max_temp", "max_temp",
"The maximum temperature so far during this billing period.", "The maximum temperature so far during this billing period.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -108,7 +108,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"max_temp_previous_period", "max_temp_previous_period",
"The maximum temperature during the previous billing period.", "The maximum temperature during the previous billing period.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -120,7 +120,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"device_date_time", "device_date_time",
"Date and time when the meter sent the telegram.", "Date and time when the meter sent the telegram.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::DateTime) .set(VIFRange::DateTime)

Wyświetl plik

@ -43,7 +43,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Status of meter.", "Status of meter.",
PrintProperty::JSON | PrintProperty::IMPORTANT | PrintProperty::STATUS | PrintProperty::JOIN_TPL_STATUS, DEFAULT_PRINT_PROPERTIES | PrintProperty::STATUS | PrintProperty::INCLUDE_TPL_STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::ErrorFlags), .set(VIFRange::ErrorFlags),

Wyświetl plik

@ -65,7 +65,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"temperature", "temperature",
"Current water temperature recorded by this meter.", "Current water temperature recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -75,7 +75,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"current_flow", "current_flow",
"The current water flow.", "The current water flow.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Flow, Quantity::Flow,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -85,7 +85,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"volume_year_period", "volume_year_period",
"Volume up to end of last year-period.", "Volume up to end of last year-period.",
PrintProperty::JSON | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -97,7 +97,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"reverse_volume_year_period", "reverse_volume_year_period",
"Reverse volume in this year-period (?)", "Reverse volume in this year-period (?)",
PrintProperty::JSON | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -111,7 +111,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"meter_year_period_start_date", "meter_year_period_start_date",
"Meter date for year-period start.", "Meter date for year-period start.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -121,7 +121,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"volume_month_period", "volume_month_period",
"Volume up to end of last month-period.", "Volume up to end of last month-period.",
PrintProperty::JSON | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -133,7 +133,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"meter_month_period_start_datetime", "meter_month_period_start_datetime",
"Meter timestamp for month-period start.", "Meter timestamp for month-period start.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::DateTime) .set(VIFRange::DateTime)
@ -143,7 +143,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"battery", "battery",
"Remaining battery life in years.", "Remaining battery life in years.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Time, Quantity::Time,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -39,6 +39,7 @@ namespace
static bool ok = registerDriver([](DriverInfo&di) static bool ok = registerDriver([](DriverInfo&di)
{ {
di.setName("tsd2"); di.setName("tsd2");
di.setDefaultFields("name,id,status,prev_date,timestamp");
di.setMeterType(MeterType::WaterMeter); di.setMeterType(MeterType::WaterMeter);
di.addLinkMode(LinkMode::T1); di.addLinkMode(LinkMode::T1);
di.addDetection(MANUFACTURER_TCH, 0xf0, 0x76); di.addDetection(MANUFACTURER_TCH, 0xf0, 0x76);
@ -57,12 +58,12 @@ namespace
addPrint("status", Quantity::Text, addPrint("status", Quantity::Text,
[&](){ return status(); }, [&](){ return status(); },
"The current status: OK, SMOKE or ERROR.", "The current status: OK, SMOKE or ERROR.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
addPrint("prev_date", Quantity::Text, addPrint("prev_date", Quantity::Text,
[&](){ return previousDate(); }, [&](){ return previousDate(); },
"Date of previous billing period.", "Date of previous billing period.",
PrintProperty::FIELD | PrintProperty::JSON); DEFAULT_PRINT_PROPERTIES);
} }
#define INFO_CODE_SMOKE 0x0001 #define INFO_CODE_SMOKE 0x0001

Wyświetl plik

@ -27,6 +27,7 @@ namespace
static bool ok = registerDriver([](DriverInfo&di) static bool ok = registerDriver([](DriverInfo&di)
{ {
di.setName("ultraheat"); di.setName("ultraheat");
di.setDefaultFields("name,id,heat_kwh,timestamp");
di.setMeterType(MeterType::HeatMeter); di.setMeterType(MeterType::HeatMeter);
di.addDetection(MANUFACTURER_LUG, 0x04, 0x04); di.addDetection(MANUFACTURER_LUG, 0x04, 0x04);
di.setConstructor([](MeterInfo& mi, DriverInfo& di){ return shared_ptr<Meter>(new Driver(mi, di)); }); di.setConstructor([](MeterInfo& mi, DriverInfo& di){ return shared_ptr<Meter>(new Driver(mi, di)); });
@ -37,7 +38,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"heat", "heat",
"The total heat energy consumption recorded by this meter.", "The total heat energy consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -48,7 +49,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"volume", "volume",
"The total heating media volume recorded by this meter.", "The total heating media volume recorded by this meter.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -59,7 +60,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"power", "power",
"The current power consumption.", "The current power consumption.",
PrintProperty::JSON , DEFAULT_PRINT_PROPERTIES,
Quantity::Power, Quantity::Power,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -70,7 +71,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"flow", "flow",
"The current heat media volume flow.", "The current heat media volume flow.",
PrintProperty::JSON , DEFAULT_PRINT_PROPERTIES,
Quantity::Flow, Quantity::Flow,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -81,7 +82,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"flow", "flow",
"The current forward heat media temperature.", "The current forward heat media temperature.",
PrintProperty::JSON , DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -92,7 +93,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"return", "return",
"The current return heat media temperature.", "The current return heat media temperature.",
PrintProperty::JSON , DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -26,6 +26,7 @@ namespace
static bool ok = registerDriver([](DriverInfo&di) static bool ok = registerDriver([](DriverInfo&di)
{ {
di.setName("ultrimis"); di.setName("ultrimis");
di.setDefaultFields("name,id,total_m3,target_m3,current_status,total_backward_flow_m3,timestamp");
di.setMeterType(MeterType::WaterMeter); di.setMeterType(MeterType::WaterMeter);
di.addLinkMode(LinkMode::T1); di.addLinkMode(LinkMode::T1);
di.addDetection(MANUFACTURER_APA, 0x16, 0x01); di.addDetection(MANUFACTURER_APA, 0x16, 0x01);
@ -37,7 +38,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total", "total",
"The total water consumption recorded by this meter.", "The total water consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -48,7 +49,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"target", "target",
"The total water consumption recorded at the beginning of this month.", "The total water consumption recorded at the beginning of this month.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -60,7 +61,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"current_status", "current_status",
"Status and error flags.", "Status and error flags.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("03FD17")), .set(DifVifKey("03FD17")),
{ {
@ -89,7 +90,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_backward_flow", "total_backward_flow",
"The total backward water volume recorded by this meter.", "The total backward water volume recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -102,4 +103,4 @@ namespace
// Comment: // Comment:
// telegram=|2E4401069897969501167A4B0320052F2F_0413320C000003FD1700000044132109000004933C000000002F2F2F2F2F| // telegram=|2E4401069897969501167A4B0320052F2F_0413320C000003FD1700000044132109000004933C000000002F2F2F2F2F|
// {"media":"cold water","meter":"ultrimis","name":"Water","id":"95969798","total_m3":3.122,"target_m3":2.337,"current_status":"OK","total_backward_flow_m3":0,"timestamp":"1111-11-11T11:11:11Z"} // {"media":"cold water","meter":"ultrimis","name":"Water","id":"95969798","total_m3":3.122,"target_m3":2.337,"current_status":"OK","total_backward_flow_m3":0,"timestamp":"1111-11-11T11:11:11Z"}
// |Water;95969798;3.122000;2.337000;OK;0.000000;1111-11-11 11:11.11 // |Water;95969798;3.122;2.337;OK;0;1111-11-11 11:11.11

Wyświetl plik

@ -42,7 +42,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Status of meter?", "Status of meter?",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT | PrintProperty::STATUS, DEFAULT_PRINT_PROPERTIES | PrintProperty::STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("02FD74")), .set(DifVifKey("02FD74")),
{ {
@ -61,7 +61,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"other", "other",
"Other status of meter?", "Other status of meter?",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT | PrintProperty::STATUS, DEFAULT_PRINT_PROPERTIES | PrintProperty::STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(DifVifKey("017F")), .set(DifVifKey("017F")),
{ {
@ -80,7 +80,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"total_date_time", "total_date_time",
"Timestamp for this total measurement.", "Timestamp for this total measurement.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::DateTime) .set(VIFRange::DateTime)
@ -90,7 +90,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total", "total",
"The total gas consumption recorded by this meter.", "The total gas consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -102,7 +102,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"target_date_time", "target_date_time",
"Timestamp for gas consumption recorded at the beginning of this month.", "Timestamp for gas consumption recorded at the beginning of this month.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::DateTime) .set(VIFRange::DateTime)
@ -112,7 +112,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"target", "target",
"The total gas consumption recorded by this meter at the beginning of this month.", "The total gas consumption recorded by this meter at the beginning of this month.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -125,7 +125,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"version", "version",
"Model version.", "Model version.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::ModelVersion) .set(VIFRange::ModelVersion)
@ -134,7 +134,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"supplier_info", "supplier_info",
"Supplier info?", "Supplier info?",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::SpecialSupplierInformation) .set(VIFRange::SpecialSupplierInformation)
@ -143,7 +143,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"parameter_set", "parameter_set",
"Meter configued with this parameter set?", "Meter configued with this parameter set?",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::ParameterSet) .set(VIFRange::ParameterSet)
@ -152,7 +152,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"meter_timestamp", "meter_timestamp",
"Timestamp when this measurement was sent.", "Timestamp when this measurement was sent.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::DateTime) .set(VIFRange::DateTime)

Wyświetl plik

@ -29,6 +29,7 @@ struct MeterUnknown : public virtual MeterCommonImplementation
static bool ok = registerDriver([](DriverInfo&di) static bool ok = registerDriver([](DriverInfo&di)
{ {
di.setName("unknown"); di.setName("unknown");
di.setDefaultFields("name,id,timestamp");
di.setMeterType(MeterType::UnknownMeter); di.setMeterType(MeterType::UnknownMeter);
di.setConstructor([](MeterInfo& mi, DriverInfo& di){ return shared_ptr<Meter>(new MeterUnknown(mi, di)); }); di.setConstructor([](MeterInfo& mi, DriverInfo& di){ return shared_ptr<Meter>(new MeterUnknown(mi, di)); });
}); });

Wyświetl plik

@ -42,7 +42,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"target", "target",
"Total energy consumption at the end of the year", "Total energy consumption at the end of the year",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -54,7 +54,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"target", "target",
"Date when previous year ended.", "Date when previous year ended.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::PointInTime, Quantity::PointInTime,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -29,6 +29,7 @@ namespace
static bool ok = registerDriver([](DriverInfo&di) static bool ok = registerDriver([](DriverInfo&di)
{ {
di.setName("vario451"); di.setName("vario451");
di.setDefaultFields("name,id,total_kwh,current_kwh,previous_kwh,timestamp");
di.setMeterType(MeterType::WaterMeter); di.setMeterType(MeterType::WaterMeter);
di.addLinkMode(LinkMode::C1); di.addLinkMode(LinkMode::C1);
di.addLinkMode(LinkMode::T1); di.addLinkMode(LinkMode::T1);
@ -41,17 +42,17 @@ namespace
{ {
addNumericField("total", addNumericField("total",
Quantity::Energy, Quantity::Energy,
PrintProperty::FIELD | PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
"The total energy consumption recorded by this meter."); "The total energy consumption recorded by this meter.");
addNumericField("current", addNumericField("current",
Quantity::Energy, Quantity::Energy,
PrintProperty::FIELD | PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
"Energy consumption so far in this billing period."); "Energy consumption so far in this billing period.");
addNumericField("previous", addNumericField("previous",
Quantity::Energy, Quantity::Energy,
PrintProperty::FIELD | PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
"Energy consumption in previous billing period."); "Energy consumption in previous billing period.");
} }

Wyświetl plik

@ -40,7 +40,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_energy_consumption", "total_energy_consumption",
"The total energy consumption recorded by this meter.", "The total energy consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -51,7 +51,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"energy_at_old_date", "energy_at_old_date",
"The total energy consumption recorded when?", "The total energy consumption recorded when?",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -63,7 +63,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"old", "old",
"The last billing old date?", "The last billing old date?",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::PointInTime, Quantity::PointInTime,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -75,7 +75,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"energy_at_set_date", "energy_at_set_date",
"The total energy consumption recorded by this meter at the due date.", "The total energy consumption recorded by this meter at the due date.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::Energy, Quantity::Energy,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -87,7 +87,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"set", "set",
"The last billing set date.", "The last billing set date.",
PrintProperty::JSON, DEFAULT_PRINT_PROPERTIES,
Quantity::PointInTime, Quantity::PointInTime,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -45,7 +45,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"status", "status",
"Status and error flags.", "Status and error flags.",
PrintProperty::JSON | PrintProperty::JOIN_TPL_STATUS | PrintProperty::STATUS, DEFAULT_PRINT_PROPERTIES | PrintProperty::INCLUDE_TPL_STATUS | PrintProperty::STATUS,
FieldMatcher::build() FieldMatcher::build()
.set(VIFRange::ErrorFlags), .set(VIFRange::ErrorFlags),
{ {
@ -73,7 +73,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"meter", "meter",
"Device date time.", "Device date time.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::PointInTime, Quantity::PointInTime,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -84,7 +84,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total", "total",
"The total water consumption recorded by this meter.", "The total water consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -95,7 +95,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_backwards", "total_backwards",
"The total backward water volume recorded by this meter.", "The total backward water volume recorded by this meter.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -107,7 +107,7 @@ namespace
addStringFieldWithExtractorAndLookup( addStringFieldWithExtractorAndLookup(
"current_status", "current_status",
"Status and error flags. (Deprecated use status instead.)", "Status and error flags. (Deprecated use status instead.)",
PrintProperty::JSON | PrintProperty::JOIN_TPL_STATUS | PrintProperty::STATUS | PrintProperty::DEPRECATED, DEFAULT_PRINT_PROPERTIES | PrintProperty::INCLUDE_TPL_STATUS | PrintProperty::STATUS | PrintProperty::DEPRECATED,
FieldMatcher::build() FieldMatcher::build()
.set(VIFRange::ErrorFlags), .set(VIFRange::ErrorFlags),
{ {
@ -135,7 +135,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"meter_version", "meter_version",
"Meter model/version.", "Meter model/version.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::ModelVersion) .set(VIFRange::ModelVersion)
@ -144,7 +144,7 @@ namespace
addStringFieldWithExtractor( addStringFieldWithExtractor(
"parameter_set", "parameter_set",
"Parameter set.", "Parameter set.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::ParameterSet) .set(VIFRange::ParameterSet)
@ -153,7 +153,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"battery", "battery",
"The battery voltage.", "The battery voltage.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Voltage, Quantity::Voltage,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -164,7 +164,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"set", "set",
"The most recent billing period date.", "The most recent billing period date.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::PointInTime, Quantity::PointInTime,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -177,7 +177,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"consumption_at_set_date", "consumption_at_set_date",
"The total water consumption at the most recent billing period date.", "The total water consumption at the most recent billing period date.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -189,7 +189,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"consumption_at_history_{storage_counter - 1 counter}", "consumption_at_history_{storage_counter - 1 counter}",
"The total water consumption at the historic date.", "The total water consumption at the historic date.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -201,7 +201,7 @@ namespace
addNumericFieldWithCalculatorAndMatcher( addNumericFieldWithCalculatorAndMatcher(
"history_{storage_counter - 1 counter}", "history_{storage_counter - 1 counter}",
"The historic date.", "The historic date.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::PointInTime, Quantity::PointInTime,
"meter_datetime - ((storage_counter-1counter) * 1 month)", "meter_datetime - ((storage_counter-1counter) * 1 month)",
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -40,7 +40,7 @@ namespace
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total", "total",
"The total water consumption recorded by this meter.", "The total water consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -265,7 +265,7 @@ void MeterCommonImplementation::addExtraCalculatedField(string ecf)
addNumericFieldWithCalculator( addNumericFieldWithCalculator(
vname, vname,
"Calculated: "+ecf, "Calculated: "+ecf,
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
quantity, quantity,
parts[1], parts[1],
unit unit
@ -985,46 +985,6 @@ void MeterCommonImplementation::triggerUpdate(Telegram *t)
t->handled = true; t->handled = true;
} }
string concatAllFields(Meter *m, Telegram *t, char c, vector<FieldInfo> &fields, bool hr,
vector<string> *extra_constant_fields)
{
string s;
s = "";
s += m->name() + c;
if (t->ids.size() > 0)
{
s += t->ids.back() + c;
}
else
{
s += c;
}
for (FieldInfo &fi : fields)
{
if (fi.printProperties().hasFIELD())
{
if (fi.xuantity() == Quantity::Text)
{
s += m->getStringValue(&fi);
}
else
{
Unit u = fi.displayUnit();
double v = m->getNumericValue(&fi, u);
if (hr) {
s += valueToString(v, u);
s += " "+unitToStringHR(u);
} else {
s += to_string(v);
}
}
s += c;
}
}
s += m->datetimeOfUpdateHumanReadable();
return s;
}
string findField(string key, vector<string> *extra_constant_fields) string findField(string key, vector<string> *extra_constant_fields)
{ {
key = key+"="; key = key+"=";
@ -1166,16 +1126,9 @@ string concatFields(Meter *m, Telegram *t, char c, vector<FieldInfo> &prints, bo
{ {
if (selected_fields == NULL || selected_fields->size() == 0) if (selected_fields == NULL || selected_fields->size() == 0)
{ {
// No global override, but is there a meter driver setting? selected_fields = &m->selectedFields();
if (m->selectedFields().size() > 0)
{
selected_fields = &m->selectedFields();
}
else
{
return concatAllFields(m, t, c, prints, human_readable, extra_constant_fields);
}
} }
string buf = ""; string buf = "";
for (string field : *selected_fields) for (string field : *selected_fields)
@ -1363,7 +1316,7 @@ void MeterCommonImplementation::processFieldExtractors(Telegram *t)
{ {
fi.performExtraction(this, t, NULL); fi.performExtraction(this, t, NULL);
} }
else if (founds.count(&fi) == 0 && fi.printProperties().hasJOINTPLSTATUS()) else if (founds.count(&fi) == 0 && fi.printProperties().hasINCLUDETPLSTATUS())
{ {
// This is a status field and it joins the tpl status but it also // This is a status field and it joins the tpl status but it also
// has a potential dve match, which did not trigger. Now // has a potential dve match, which did not trigger. Now
@ -1532,7 +1485,7 @@ string MeterCommonImplementation::getStringValue(FieldInfo *fi)
// joined into this status field. // joined into this status field.
for (FieldInfo &f : field_infos_) for (FieldInfo &f : field_infos_)
{ {
if (f.printProperties().hasJOININTOSTATUS()) if (f.printProperties().hasINJECTINTOSTATUS())
{ {
string more = getStringValue(&f); string more = getStringValue(&f);
string joined = joinStatusOKStrings(value, more); string joined = joinStatusOKStrings(value, more);
@ -1780,64 +1733,62 @@ void MeterCommonImplementation::printMeter(Telegram *t,
for (FieldInfo& fi : field_infos_) for (FieldInfo& fi : field_infos_)
{ {
if (fi.printProperties().hasJSON() && !fi.printProperties().hasHIDE()) if (fi.printProperties().hasHIDE()) continue;
{
// The field should be printed in the json. (Most usually should.)
for (auto& i : t->dv_entries)
{
// Check each telegram dv entry.
DVEntry *dve = &i.second.second;
// Has the entry been matches to this field, then print it as json.
if (dve->hasFieldInfo(&fi))
{
assert(founds[&fi].count(dve) == 0);
founds[&fi].insert(dve); // The field should be printed in the json. (Most usually should.)
string field_name = fi.generateFieldNameNoUnit(dve); for (auto& i : t->dv_entries)
found_vnames.insert(field_name); {
} // Check each telegram dv entry.
DVEntry *dve = &i.second.second;
// Has the entry been matches to this field, then print it as json.
if (dve->hasFieldInfo(&fi))
{
assert(founds[&fi].count(dve) == 0);
founds[&fi].insert(dve);
string field_name = fi.generateFieldNameNoUnit(dve);
found_vnames.insert(field_name);
} }
} }
} }
for (FieldInfo& fi : field_infos_) for (FieldInfo& fi : field_infos_)
{ {
if (fi.printProperties().hasJSON() && !fi.printProperties().hasHIDE()) if (fi.printProperties().hasHIDE()) continue;
if (founds.count(&fi) != 0)
{ {
if (founds.count(&fi) != 0) // This field info has matched against some dventries.
for (DVEntry *dve : founds[&fi])
{ {
// This field info has matched against some dventries. debug("(meters) render field %s(%s %s)[%d] with dventry @%d key %s data %s\n",
for (DVEntry *dve : founds[&fi]) fi.vname().c_str(), toString(fi.xuantity()), unitToStringLowerCase(fi.displayUnit()).c_str(), fi.index(),
{ dve->offset,
debug("(meters) render field %s(%s %s)[%d] with dventry @%d key %s data %s\n", dve->dif_vif_key.str().c_str(),
fi.vname().c_str(), toString(fi.xuantity()), unitToStringLowerCase(fi.displayUnit()).c_str(), fi.index(), dve->value.c_str());
dve->offset, string out = fi.renderJson(this, dve);
dve->dif_vif_key.str().c_str(), debug("(meters) %s\n", out.c_str());
dve->value.c_str()); s += indent+out+","+newline;
string out = fi.renderJson(this, dve);
debug("(meters) %s\n", out.c_str());
s += indent+out+","+newline;
}
} }
else }
else
{
// Ok, no value found in received telegram.
// Print field anyway if it is required,
// or if a value has been received before and this field has not been received using a different rule.
// Why this complicated rule?
// E.g. the minmoess mbus seems to use storage 1 for target_m3 but the wmbus version uses storage 8.
// I.e. we have two rules that store into target_m3, this check will prevent target_m3 from being printed twice.
if (fi.printProperties().hasREQUIRED() || (found_vnames.count(fi.vname()) == 0 && hasValue(&fi)))
{ {
// Ok, no value found in received telegram. // No telegram entries found, but this field should be printed anyway.
// Print field anyway, if it is not OPTIONAL // It will be printed with any value received from a previous telegram.
// or if a value has been received before and this field has not been received using a different rule. // Or if no value has been received, null.
// Why this complicated rule? debug("(meters) render field %s(%s)[%d] without dventry\n",
// E.g. the minmoess mbus seems to use storage 1 for target_m3 but the wmbus version uses storage 8. fi.vname().c_str(), toString(fi.xuantity()), fi.index());
// I.e. we have two rules that store into target_m3, this check will prevent target_m3 from being printed twice. string out = fi.renderJson(this, NULL);
if (!fi.printProperties().hasOPTIONAL() || (found_vnames.count(fi.vname()) == 0 && hasValue(&fi))) debug("(meters) %s\n", out.c_str());
{ s += indent+out+","+newline;
// No telegram entries found, but this field should be printed anyway.
// It will be printed with any value received from a previous telegram.
// Or if no value has been received, null.
debug("(meters) render field %s(%s)[%d] without dventry\n",
fi.vname().c_str(), toString(fi.xuantity()), fi.index());
string out = fi.renderJson(this, NULL);
debug("(meters) %s\n", out.c_str());
s += indent+out+","+newline;
}
} }
} }
} }
@ -1888,21 +1839,20 @@ void MeterCommonImplementation::printMeter(Telegram *t,
for (FieldInfo& fi : field_infos_) for (FieldInfo& fi : field_infos_)
{ {
if (fi.printProperties().hasJSON() && !fi.printProperties().hasHIDE()) if (fi.printProperties().hasHIDE()) continue;
string display_unit_s = unitToStringUpperCase(fi.displayUnit());
string var = fi.vname();
std::transform(var.begin(), var.end(), var.begin(), ::toupper);
if (fi.xuantity() == Quantity::Text)
{ {
string display_unit_s = unitToStringUpperCase(fi.displayUnit()); string envvar = "METER_"+var+"="+getStringValue(&fi);
string var = fi.vname(); envs->push_back(envvar);
std::transform(var.begin(), var.end(), var.begin(), ::toupper); }
if (fi.xuantity() == Quantity::Text) else
{ {
string envvar = "METER_"+var+"="+getStringValue(&fi); string envvar = "METER_"+var+"_"+display_unit_s+"="+valueToString(getNumericValue(&fi, fi.displayUnit()), fi.displayUnit());
envs->push_back(envvar); envs->push_back(envvar);
}
else
{
string envvar = "METER_"+var+"_"+display_unit_s+"="+valueToString(getNumericValue(&fi, fi.displayUnit()), fi.displayUnit());
envs->push_back(envvar);
}
} }
} }
@ -2380,7 +2330,7 @@ bool FieldInfo::extractString(Meter *m, Telegram *t, DVEntry *dve)
if (!hasMatcher()) if (!hasMatcher())
{ {
// There is no matcher, only use case is to capture JOIN_TPL_STATUS. // There is no matcher, only use case is to capture JOIN_TPL_STATUS.
if (print_properties_.hasJOINTPLSTATUS()) if (print_properties_.hasINCLUDETPLSTATUS())
{ {
string status = add_tpl_status("OK", m, t); string status = add_tpl_status("OK", m, t);
m->setStringValue(this, status); m->setStringValue(this, status);
@ -2400,7 +2350,7 @@ bool FieldInfo::extractString(Meter *m, Telegram *t, DVEntry *dve)
// No entry was found. // No entry was found.
if (!ok) { if (!ok) {
// Nothing found, however check if capturing JOIN_TPL_STATUS. // Nothing found, however check if capturing JOIN_TPL_STATUS.
if (print_properties_.hasJOINTPLSTATUS()) if (print_properties_.hasINCLUDETPLSTATUS())
{ {
string status = add_tpl_status("OK", m, t); string status = add_tpl_status("OK", m, t);
m->setStringValue(this, status); m->setStringValue(this, status);
@ -2414,7 +2364,7 @@ bool FieldInfo::extractString(Meter *m, Telegram *t, DVEntry *dve)
if (t->dv_entries.count(key) == 0) if (t->dv_entries.count(key) == 0)
{ {
// Nothing found, however check if capturing JOIN_TPL_STATUS. // Nothing found, however check if capturing JOIN_TPL_STATUS.
if (print_properties_.hasJOINTPLSTATUS()) if (print_properties_.hasINCLUDETPLSTATUS())
{ {
string status = add_tpl_status("OK", m, t); string status = add_tpl_status("OK", m, t);
m->setStringValue(this, status); m->setStringValue(this, status);
@ -2431,7 +2381,7 @@ bool FieldInfo::extractString(Meter *m, Telegram *t, DVEntry *dve)
string field_name = generateFieldNameNoUnit(dve); string field_name = generateFieldNameNoUnit(dve);
uint64_t extracted_bits {}; uint64_t extracted_bits {};
if (lookup_.hasLookups() || (print_properties_.hasJOINTPLSTATUS())) if (lookup_.hasLookups() || (print_properties_.hasINCLUDETPLSTATUS()))
{ {
string translated_bits = ""; string translated_bits = "";
// The field has lookups, or the print property JOIN_TPL_STATUS is set, // The field has lookups, or the print property JOIN_TPL_STATUS is set,
@ -2442,7 +2392,7 @@ bool FieldInfo::extractString(Meter *m, Telegram *t, DVEntry *dve)
found = true; found = true;
} }
if (print_properties_.hasJOINTPLSTATUS()) if (print_properties_.hasINCLUDETPLSTATUS())
{ {
translated_bits = add_tpl_status(translated_bits, m, t); translated_bits = add_tpl_status(translated_bits, m, t);
} }
@ -2621,7 +2571,7 @@ void MeterCommonImplementation::addOptionalCommonFields(string field_names)
addStringFieldWithExtractor( addStringFieldWithExtractor(
"fabrication_no", "fabrication_no",
"Fabrication number.", "Fabrication number.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::FabricationNo) .set(VIFRange::FabricationNo)
@ -2633,7 +2583,7 @@ void MeterCommonImplementation::addOptionalCommonFields(string field_names)
addStringFieldWithExtractor( addStringFieldWithExtractor(
"enhanced_id", "enhanced_id",
"Enhanced identification number.", "Enhanced identification number.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::EnhancedIdentification) .set(VIFRange::EnhancedIdentification)
@ -2645,7 +2595,7 @@ void MeterCommonImplementation::addOptionalCommonFields(string field_names)
addStringFieldWithExtractor( addStringFieldWithExtractor(
"software_version", "software_version",
"Software version.", "Software version.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::SoftwareVersion) .set(VIFRange::SoftwareVersion)
@ -2657,7 +2607,7 @@ void MeterCommonImplementation::addOptionalCommonFields(string field_names)
addStringFieldWithExtractor( addStringFieldWithExtractor(
"model_version", "model_version",
"Meter model version.", "Meter model version.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::ModelVersion) .set(VIFRange::ModelVersion)
@ -2669,7 +2619,7 @@ void MeterCommonImplementation::addOptionalCommonFields(string field_names)
addStringFieldWithExtractor( addStringFieldWithExtractor(
"parameter_set", "parameter_set",
"Parameter set for this meter.", "Parameter set for this meter.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::ParameterSet) .set(VIFRange::ParameterSet)
@ -2681,7 +2631,7 @@ void MeterCommonImplementation::addOptionalCommonFields(string field_names)
addStringFieldWithExtractor( addStringFieldWithExtractor(
"customer", "customer",
"Customer name.", "Customer name.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Customer) .set(VIFRange::Customer)
@ -2693,7 +2643,7 @@ void MeterCommonImplementation::addOptionalCommonFields(string field_names)
addStringFieldWithExtractor( addStringFieldWithExtractor(
"location", "location",
"Meter installed at this customer location.", "Meter installed at this customer location.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Location) .set(VIFRange::Location)
@ -2705,7 +2655,7 @@ void MeterCommonImplementation::addOptionalCommonFields(string field_names)
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"operating_time", "operating_time",
"How long the meter has been collecting data.", "How long the meter has been collecting data.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Time, Quantity::Time,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -2719,7 +2669,7 @@ void MeterCommonImplementation::addOptionalCommonFields(string field_names)
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"on_time", "on_time",
"How long the meter has been powered up.", "How long the meter has been powered up.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Time, Quantity::Time,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -2733,7 +2683,7 @@ void MeterCommonImplementation::addOptionalCommonFields(string field_names)
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"on_time_at_error", "on_time_at_error",
"How long the meter has been in an error state while powered up.", "How long the meter has been in an error state while powered up.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Time, Quantity::Time,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -2747,7 +2697,7 @@ void MeterCommonImplementation::addOptionalCommonFields(string field_names)
addStringFieldWithExtractor( addStringFieldWithExtractor(
"meter_date", "meter_date",
"Date when the meter sent the telegram.", "Date when the meter sent the telegram.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -2759,7 +2709,7 @@ void MeterCommonImplementation::addOptionalCommonFields(string field_names)
addStringFieldWithExtractor( addStringFieldWithExtractor(
"meter_date_at_error", "meter_date_at_error",
"Date when the meter was in error.", "Date when the meter was in error.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::AtError) .set(MeasurementType::AtError)
.set(VIFRange::Date) .set(VIFRange::Date)
@ -2771,7 +2721,7 @@ void MeterCommonImplementation::addOptionalCommonFields(string field_names)
addStringFieldWithExtractor( addStringFieldWithExtractor(
"meter_datetime", "meter_datetime",
"Date and time when the meter sent the telegram.", "Date and time when the meter sent the telegram.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::Instantaneous) .set(MeasurementType::Instantaneous)
.set(VIFRange::DateTime) .set(VIFRange::DateTime)
@ -2783,7 +2733,7 @@ void MeterCommonImplementation::addOptionalCommonFields(string field_names)
addStringFieldWithExtractor( addStringFieldWithExtractor(
"meter_datetime_at_error", "meter_datetime_at_error",
"Date and time when the meter was in error.", "Date and time when the meter was in error.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
FieldMatcher::build() FieldMatcher::build()
.set(MeasurementType::AtError) .set(MeasurementType::AtError)
.set(VIFRange::DateTime) .set(VIFRange::DateTime)
@ -2802,7 +2752,7 @@ void MeterCommonImplementation::addOptionalFlowRelatedFields(string field_names)
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total", "total",
"The total media volume consumption recorded by this meter.", "The total media volume consumption recorded by this meter.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -2816,7 +2766,7 @@ void MeterCommonImplementation::addOptionalFlowRelatedFields(string field_names)
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_forward", "total_forward",
"The total media volume flowing forward.", "The total media volume flowing forward.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -2831,7 +2781,7 @@ void MeterCommonImplementation::addOptionalFlowRelatedFields(string field_names)
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"total_backward", "total_backward",
"The total media volume flowing backward.", "The total media volume flowing backward.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Volume, Quantity::Volume,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -2846,7 +2796,7 @@ void MeterCommonImplementation::addOptionalFlowRelatedFields(string field_names)
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"flow_temperature", "flow_temperature",
"Forward media temperature.", "Forward media temperature.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -2860,7 +2810,7 @@ void MeterCommonImplementation::addOptionalFlowRelatedFields(string field_names)
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"return_temperature", "return_temperature",
"Return media temperature.", "Return media temperature.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -2874,7 +2824,7 @@ void MeterCommonImplementation::addOptionalFlowRelatedFields(string field_names)
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"flow_return_temperature_difference", "flow_return_temperature_difference",
"The difference between flow and return media temperatures.", "The difference between flow and return media temperatures.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Temperature, Quantity::Temperature,
VifScaling::AutoSigned, VifScaling::AutoSigned,
FieldMatcher::build() FieldMatcher::build()
@ -2888,7 +2838,7 @@ void MeterCommonImplementation::addOptionalFlowRelatedFields(string field_names)
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"volume_flow", "volume_flow",
"Media volume flow.", "Media volume flow.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Flow, Quantity::Flow,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()
@ -2902,7 +2852,7 @@ void MeterCommonImplementation::addOptionalFlowRelatedFields(string field_names)
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"access", "access",
"Meter access counter.", "Meter access counter.",
PrintProperty::JSON | PrintProperty::OPTIONAL, DEFAULT_PRINT_PROPERTIES,
Quantity::Counter, Quantity::Counter,
VifScaling::None, VifScaling::None,
FieldMatcher::build() FieldMatcher::build()
@ -2921,7 +2871,7 @@ void MeterCommonImplementation::addHCARelatedFields(string field_names)
addNumericFieldWithExtractor( addNumericFieldWithExtractor(
"consumption", "consumption",
"The current heat cost allocation for this meter.", "The current heat cost allocation for this meter.",
PrintProperty::JSON | PrintProperty::FIELD, DEFAULT_PRINT_PROPERTIES,
Quantity::HCA, Quantity::HCA,
VifScaling::Auto, VifScaling::Auto,
FieldMatcher::build() FieldMatcher::build()

Wyświetl plik

@ -237,37 +237,31 @@ const char* toString(VifScaling s);
enum PrintProperty enum PrintProperty
{ {
JSON = 1, // This field should be printed when using --format=json REQUIRED = 1, // If no data has arrived, then print this field anyway with NaN or null.
FIELD = 2, // This field should be printed when using --format=field DEPRECATED = 2, // This field is about to be removed or changed in a newer driver, which will have a new name.
IMPORTANT = 4, // The most important field. STATUS = 4, // This is >the< status field and it should read OK of not error flags are set.
OPTIONAL = 8, // If no data has arrived, then do not include this field in the json output. INCLUDE_TPL_STATUS = 8, // This text field also includes the tpl status decoding. multiple OK:s collapse to a single OK.
REQUIRED = 16, // If no data has arrived, then print this field anyway with NaN or null. INJECT_INTO_STATUS = 16, // This text field is injected into the already defined status field. multiple OK:s collapse.
DEPRECATED = 32, // This field is about to be removed or changed in a newer driver, which will have a new name. HIDE = 32 // This field is only used in calculations, do not print it!
STATUS = 64, // This is >the< status field and it should read OK of not error flags are set.
JOIN_TPL_STATUS = 128, // This text field also includes the tpl status decoding. multiple OK:s collapse to a single OK.
JOIN_INTO_STATUS = 256, // This text field is injected into the already defined status field. multiple OK:s collapse.
OFFICIAL = 512, // This field is listed as an official field for the driver.
HIDE = 1024 // This field is only used in calculations, do not print it!
}; };
struct PrintProperties struct PrintProperties
{ {
PrintProperties(int x) : props_(x) {} PrintProperties(int x) : props_(x) {}
bool hasJSON() { return props_ & PrintProperty::JSON; } bool hasREQUIRED() { return props_ & PrintProperty::REQUIRED; }
bool hasHIDE() { return props_ & PrintProperty::HIDE; }
bool hasFIELD() { return props_ & PrintProperty::FIELD; }
bool hasIMPORTANT() { return props_ & PrintProperty::IMPORTANT; }
bool hasOPTIONAL() { return props_ & PrintProperty::OPTIONAL; }
bool hasDEPRECATED() { return props_ & PrintProperty::DEPRECATED; } bool hasDEPRECATED() { return props_ & PrintProperty::DEPRECATED; }
bool hasSTATUS() { return props_ & PrintProperty::STATUS; } bool hasSTATUS() { return props_ & PrintProperty::STATUS; }
bool hasJOINTPLSTATUS() { return props_ & PrintProperty::JOIN_TPL_STATUS; } bool hasINCLUDETPLSTATUS() { return props_ & PrintProperty::INCLUDE_TPL_STATUS; }
bool hasJOININTOSTATUS() { return props_ & PrintProperty::JOIN_INTO_STATUS; } bool hasINJECTINTOSTATUS() { return props_ & PrintProperty::INJECT_INTO_STATUS; }
bool hasHIDE() { return props_ & PrintProperty::HIDE; }
private: private:
int props_; int props_;
}; };
#define DEFAULT_PRINT_PROPERTIES 0
struct FieldInfo struct FieldInfo
{ {
~FieldInfo(); ~FieldInfo();

Wyświetl plik

@ -52,14 +52,6 @@ Using driver : multical21 00/00
"meter":"multical21", "meter":"multical21",
"name":"", "name":"",
"id":"76348799", "id":"76348799",
"status":null,
"total_m3":null,
"target_m3":null,
"current_status":null,
"time_dry":null,
"time_reversed":null,
"time_leaking":null,
"time_bursting":null,
"timestamp":"1111-11-11T11:11:11Z" "timestamp":"1111-11-11T11:11:11Z"
} }
EOF EOF
@ -97,14 +89,6 @@ Using driver : multical21 00/00
"meter":"multical21", "meter":"multical21",
"name":"", "name":"",
"id":"76348799", "id":"76348799",
"status":null,
"total_m3":null,
"target_m3":null,
"current_status":null,
"time_dry":null,
"time_reversed":null,
"time_leaking":null,
"time_bursting":null,
"timestamp":"1111-11-11T11:11:11Z" "timestamp":"1111-11-11T11:11:11Z"
} }
EOF EOF