diff --git a/simulations/simulation_c1.txt b/simulations/simulation_c1.txt index d465c44..a4b4439 100644 --- a/simulations/simulation_c1.txt +++ b/simulations/simulation_c1.txt @@ -31,4 +31,4 @@ telegram=|1E442D2C0771941501027AB3001080|04833B08340500| # Test QCaloric C1 telegrams telegram=|314493441234567835087a740000200b6e2701004b6e450100426c5f2ccb086e790000c2086c7f21326cffff046d200b7422| -{"media":"heat cost allocation","meter":"qcaloric","name":"MyElement","id":"78563412","current_consumption_hca":127,"set_date":"2018-12-31","consumption_at_set_date_hca":145,"set_date_17":"2019-01-31","consumption_at_set_date_17_hca":79,"error_date":"2127-15-31","device_date_time":"2019-02-20 11:32","timestamp":"1111-11-11T11:11:11Z"} +{"media":"heat cost allocation","meter":"qcaloric","name":"MyElement","id":"78563412","current_consumption_hca":127,"set_date":"2018-12-31","consumption_at_set_date_hca":145,"set_date_1":"2018-12-31","consumption_at_set_date_1_hca":145,"set_date_17":"2019-01-31","consumption_at_set_date_17_hca":79,"error_date":"2127-15-31","device_date_time":"2019-02-20 11:32","timestamp":"1111-11-11T11:11:11Z"} diff --git a/simulations/simulation_multiple_qcalorics.txt b/simulations/simulation_multiple_qcalorics.txt index a18cff6..70d046f 100644 --- a/simulations/simulation_multiple_qcalorics.txt +++ b/simulations/simulation_multiple_qcalorics.txt @@ -1,6 +1,6 @@ telegram=|314493441234567835087a740000200b6e2701004b6e450100426c5f2ccb086e790000c2086c7f21326cffff046d200b7422| -{"media":"heat cost allocation","meter":"qcaloric","name":"Element","id":"78563412","current_consumption_hca":127,"set_date":"2018-12-31","consumption_at_set_date_hca":145,"set_date_17":"2019-01-31","consumption_at_set_date_17_hca":79,"error_date":"2127-15-31","device_date_time":"2019-02-20 11:32","timestamp":"1111-11-11T11:11:11Z"} +{"media":"heat cost allocation","meter":"qcaloric","name":"Element","id":"78563412","current_consumption_hca":127,"set_date":"2018-12-31","consumption_at_set_date_hca":145,"set_date_1":"2018-12-31","consumption_at_set_date_1_hca":145,"set_date_17":"2019-01-31","consumption_at_set_date_17_hca":79,"error_date":"2127-15-31","device_date_time":"2019-02-20 11:32","timestamp":"1111-11-11T11:11:11Z"} telegram=|314493441334567835087a740000200b6e2701004b6e450100426c5f2ccb086e790000c2086c7f21326cffff046d200b7422| -{"media":"heat cost allocation","meter":"qcaloric","name":"Element","id":"78563413","current_consumption_hca":127,"set_date":"2018-12-31","consumption_at_set_date_hca":145,"set_date_17":"2019-01-31","consumption_at_set_date_17_hca":79,"error_date":"2127-15-31","device_date_time":"2019-02-20 11:32","timestamp":"1111-11-11T11:11:11Z"} +{"media":"heat cost allocation","meter":"qcaloric","name":"Element","id":"78563413","current_consumption_hca":127,"set_date":"2018-12-31","consumption_at_set_date_hca":145,"set_date_1":"2018-12-31","consumption_at_set_date_1_hca":145,"set_date_17":"2019-01-31","consumption_at_set_date_17_hca":79,"error_date":"2127-15-31","device_date_time":"2019-02-20 11:32","timestamp":"1111-11-11T11:11:11Z"} telegram=|314493441434568835087a740000200b6e2701004b6e450100426c5f2ccb086e790000c2086c7f21326cffff046d200b7422| -{"media":"heat cost allocation","meter":"qcaloric","name":"Element","id":"88563414","current_consumption_hca":127,"set_date":"2018-12-31","consumption_at_set_date_hca":145,"set_date_17":"2019-01-31","consumption_at_set_date_17_hca":79,"error_date":"2127-15-31","device_date_time":"2019-02-20 11:32","timestamp":"1111-11-11T11:11:11Z"} +{"media":"heat cost allocation","meter":"qcaloric","name":"Element","id":"88563414","current_consumption_hca":127,"set_date":"2018-12-31","consumption_at_set_date_hca":145,"set_date_1":"2018-12-31","consumption_at_set_date_1_hca":145,"set_date_17":"2019-01-31","consumption_at_set_date_17_hca":79,"error_date":"2127-15-31","device_date_time":"2019-02-20 11:32","timestamp":"1111-11-11T11:11:11Z"} diff --git a/simulations/simulation_t1.txt b/simulations/simulation_t1.txt index 1ca5a13..0f45937 100644 --- a/simulations/simulation_t1.txt +++ b/simulations/simulation_t1.txt @@ -38,4 +38,4 @@ telegram=|374468506549235827C3A2|129F25383300A8622600008200800A2AF86211517555287 # Test EurisII T1 telegrams telegram=|7644C52501880188550872|01880188C5255508010000002F2F0B6E332211426E110182016E1102C2016E110382026E1104C2026E110582036E1106C2036E110782046E1108C2046E110982056E1110C2056E111182066E1112C2066E111382076E1114C2076E111582086E1116C2086E111702FD172100| -{"media":"heat cost allocation","meter":"eurisii","name":"HeatMeter","id":"88018801","current_consumption_hca":112233,"consumption_at_set_date_hca":273,"set_date":"","consumption_at_set_date_2_hca":529,"consumption_at_set_date_3_hca":785,"consumption_at_set_date_4_hca":1041,"consumption_at_set_date_5_hca":1297,"consumption_at_set_date_6_hca":1553,"consumption_at_set_date_7_hca":1809,"consumption_at_set_date_8_hca":2065,"consumption_at_set_date_9_hca":2321,"consumption_at_set_date_10_hca":4113,"consumption_at_set_date_11_hca":4369,"consumption_at_set_date_12_hca":4625,"consumption_at_set_date_13_hca":4881,"consumption_at_set_date_14_hca":5137,"consumption_at_set_date_15_hca":5393,"consumption_at_set_date_16_hca":5649,"consumption_at_set_date_17_hca":5905,"error_flags":"MEASUREMENT RESET","timestamp":"1111-11-11T11:11:11Z"} +{"media":"heat cost allocation","meter":"eurisii","name":"HeatMeter","id":"88018801","current_consumption_hca":112233,"set_date":"","consumption_at_set_date_hca":273,"consumption_at_set_date_1_hca":273,"consumption_at_set_date_2_hca":529,"consumption_at_set_date_3_hca":785,"consumption_at_set_date_4_hca":1041,"consumption_at_set_date_5_hca":1297,"consumption_at_set_date_6_hca":1553,"consumption_at_set_date_7_hca":1809,"consumption_at_set_date_8_hca":2065,"consumption_at_set_date_9_hca":2321,"consumption_at_set_date_10_hca":4113,"consumption_at_set_date_11_hca":4369,"consumption_at_set_date_12_hca":4625,"consumption_at_set_date_13_hca":4881,"consumption_at_set_date_14_hca":5137,"consumption_at_set_date_15_hca":5393,"consumption_at_set_date_16_hca":5649,"consumption_at_set_date_17_hca":5905,"error_flags":"MEASUREMENT RESET","timestamp":"1111-11-11T11:11:11Z"} diff --git a/src/meter_eurisii.cc b/src/meter_eurisii.cc index f59d904..9a81240 100644 --- a/src/meter_eurisii.cc +++ b/src/meter_eurisii.cc @@ -57,17 +57,17 @@ MeterEurisII::MeterEurisII(WMBus *bus, MeterInfo &mi) : "The current heat cost allocation.", true, true); - addPrint("consumption_at_set_date", Quantity::HCA, - [&](Unit u){ return consumption_at_set_date_hca_[0]; }, - "Heat cost allocation at the most recent billing period date.", - false, true); - addPrint("set_date", Quantity::Text, [&](){ return setDate(); }, "The most recent billing period date.", true, true); - for (int i=2; i<=17; ++i) + addPrint("consumption_at_set_date", Quantity::HCA, + [&](Unit u){ return consumption_at_set_date_hca_[0]; }, + "Heat cost allocation at the most recent billing period date.", + false, true); + + for (int i=1; i<=17; ++i) { string msg, info; strprintf(msg, "consumption_at_set_date_%d", i); diff --git a/src/meter_qcaloric.cc b/src/meter_qcaloric.cc index d6c9f5c..88236b5 100644 --- a/src/meter_qcaloric.cc +++ b/src/meter_qcaloric.cc @@ -71,6 +71,16 @@ MeterQCaloric::MeterQCaloric(WMBus *bus, MeterInfo &mi) : "Heat cost allocation at the most recent billing period date.", true, true); + addPrint("set_date_1", Quantity::Text, + [&](){ return setDate(); }, + "The 1 billing period date.", + false, true); + + addPrint("consumption_at_set_date_1", Quantity::HCA, + [&](Unit u){ return consumptionAtSetDate(u); }, + "Heat cost allocation at the 1 billing period date.", + false, true); + addPrint("set_date_17", Quantity::Text, [&](){ return set_date_17_; }, "The 17 billing period date.",