From 1ad30e4da8e9ce5b56407c07cd7739237a0a1624 Mon Sep 17 00:00:00 2001 From: SzczepanLeon <75840303+SzczepanLeon@users.noreply.github.com> Date: Sun, 25 Feb 2024 19:28:43 +0100 Subject: [PATCH] Disable compressed frames in flowiq2200 --- driver_flowiq2200.h | 79 +++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/driver_flowiq2200.h b/driver_flowiq2200.h index b7cebef..348b2e4 100644 --- a/driver_flowiq2200.h +++ b/driver_flowiq2200.h @@ -34,6 +34,7 @@ struct Flowiq2200: Driver // CRC status prev maxF 06FF1B date T1 T2 flow total // 0001 1718 1920212223 24252627 28293031 3233 343536373839 4041 42 43 4445 46474849 50 // 3244 ... FDC3 7905099CE6 00000000 7CE20300 7C05 06600006D000 0132 0B 11 0000 79E70300 0F +// see https://github.com/SzczepanLeon/esphome-components/issues/86 private: esphome::optional get_total_water_m3(std::vector &telegram) { @@ -43,14 +44,14 @@ struct Flowiq2200: Driver if (tpl_ci_field == 0x78) { ret_val = this->get_0413(telegram); } - else if ((tpl_ci_field == 0x79) && (l_field > 49)) { - uint32_t usage{0}; - uint8_t i = 46; - usage = (((uint32_t)telegram[i+3] << 24) | ((uint32_t)telegram[i+2] << 16) | - ((uint32_t)telegram[i+1] << 8) | ((uint32_t)telegram[i+0])); - ret_val = usage / 1000.0; - ESP_LOGVV(TAG, "Found total_water with '%d'->'%f'", usage, ret_val.value()); - } + // else if ((tpl_ci_field == 0x79) && (l_field > 49)) { + // uint32_t usage{0}; + // uint8_t i = 46; + // usage = (((uint32_t)telegram[i+3] << 24) | ((uint32_t)telegram[i+2] << 16) | + // ((uint32_t)telegram[i+1] << 8) | ((uint32_t)telegram[i+0])); + // ret_val = usage / 1000.0; + // ESP_LOGVV(TAG, "Found total_water with '%d'->'%f'", usage, ret_val.value()); + // } return ret_val; }; @@ -61,14 +62,14 @@ struct Flowiq2200: Driver if (tpl_ci_field == 0x78) { ret_val = this->get_4413(telegram); } - else if ((tpl_ci_field == 0x79) && (l_field > 49)) { - uint32_t usage{0}; - uint8_t i = 28; - usage = (((uint32_t)telegram[i+3] << 24) | ((uint32_t)telegram[i+2] << 16) | - ((uint32_t)telegram[i+1] << 8) | ((uint32_t)telegram[i+0])); - ret_val = usage / 1000.0; - ESP_LOGVV(TAG, "Found target_water with '%d'->'%f'", usage, ret_val.value()); - } + // else if ((tpl_ci_field == 0x79) && (l_field > 49)) { + // uint32_t usage{0}; + // uint8_t i = 28; + // usage = (((uint32_t)telegram[i+3] << 24) | ((uint32_t)telegram[i+2] << 16) | + // ((uint32_t)telegram[i+1] << 8) | ((uint32_t)telegram[i+0])); + // ret_val = usage / 1000.0; + // ESP_LOGVV(TAG, "Found target_water with '%d'->'%f'", usage, ret_val.value()); + // } return ret_val; }; @@ -79,14 +80,14 @@ struct Flowiq2200: Driver if (tpl_ci_field == 0x78) { ret_val = this->get_04FF23(telegram); } - else if ((tpl_ci_field == 0x79) && (l_field > 49)) { - uint32_t status{0}; - uint8_t i = 24; - status = (((uint32_t)telegram[i+3] << 24) | ((uint32_t)telegram[i+2] << 16) | - ((uint32_t)telegram[i+1] << 8) | ((uint32_t)telegram[i+0])); - ret_val = (double)status; - ESP_LOGVV(TAG, "Found status with '%08X'", status); - } + // else if ((tpl_ci_field == 0x79) && (l_field > 49)) { + // uint32_t status{0}; + // uint8_t i = 24; + // status = (((uint32_t)telegram[i+3] << 24) | ((uint32_t)telegram[i+2] << 16) | + // ((uint32_t)telegram[i+1] << 8) | ((uint32_t)telegram[i+0])); + // ret_val = (double)status; + // ESP_LOGVV(TAG, "Found status with '%08X'", status); + // } return ret_val; }; @@ -97,13 +98,13 @@ struct Flowiq2200: Driver if (tpl_ci_field == 0x78) { ret_val = this->get_023B(telegram); } - else if ((tpl_ci_field == 0x79) && (l_field > 49)) { - uint32_t flow{0}; - uint8_t i = 44; - flow = (((uint32_t)telegram[i+1] << 8) | ((uint32_t)telegram[i+0])); - ret_val = (double)flow; - ESP_LOGVV(TAG, "Found volume_flow with '%d'->'%f'", flow, ret_val.value()); - } + // else if ((tpl_ci_field == 0x79) && (l_field > 49)) { + // uint32_t flow{0}; + // uint8_t i = 44; + // flow = (((uint32_t)telegram[i+1] << 8) | ((uint32_t)telegram[i+0])); + // ret_val = (double)flow; + // ESP_LOGVV(TAG, "Found volume_flow with '%d'->'%f'", flow, ret_val.value()); + // } return ret_val; }; @@ -114,14 +115,14 @@ struct Flowiq2200: Driver if (tpl_ci_field == 0x78) { ret_val = this->get_523B(telegram); } - else if ((tpl_ci_field == 0x79) && (l_field > 49)) { - uint32_t flow{0}; - uint8_t i = 32; - flow = (((uint32_t)telegram[i+1] << 8) | ((uint32_t)telegram[i+0])); - ret_val = (double)flow; - ESP_LOGVV(TAG, "Found max_flow with '%d'->'%f'", flow, ret_val.value()); - } + // else if ((tpl_ci_field == 0x79) && (l_field > 49)) { + // uint32_t flow{0}; + // uint8_t i = 32; + // flow = (((uint32_t)telegram[i+1] << 8) | ((uint32_t)telegram[i+0])); + // ret_val = (double)flow; + // ESP_LOGVV(TAG, "Found max_flow with '%d'->'%f'", flow, ret_val.value()); + // } return ret_val; }; -}; \ No newline at end of file +};