From 59cac5917f6707a7964a550eebe4a2095cd52bf5 Mon Sep 17 00:00:00 2001 From: wonsky007 <98755579+wonsky007@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:03:50 +0100 Subject: [PATCH 1/2] Update driver.h corrected units, previously returned value was not divided by 100,000 expample: returned value was 8430354.000 kWh instead of 84.303544 kWh --- driver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver.h b/driver.h index 5131b45..1d56957 100755 --- a/driver.h +++ b/driver.h @@ -107,7 +107,7 @@ struct Driver i += 2; usage = bcd_2_int(telegram, i, 4); // in kWh - ret_val = usage / 3.6; + ret_val = usage / 3.6 / 100000.0; ESP_LOGVV(TAG, "Found register '0C09' with '%d'->'%f'", usage, ret_val.value()); break; } From 04cdb4302bd0b856c1a938ecedee6f9236e1bc9e Mon Sep 17 00:00:00 2001 From: wonsky007 <98755579+wonsky007@users.noreply.github.com> Date: Wed, 20 Dec 2023 13:26:03 +0100 Subject: [PATCH 2/2] Update driver.h cosmetic change in calculation ret_val for 0C09 --- driver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver.h b/driver.h index 1d56957..7ea4af5 100755 --- a/driver.h +++ b/driver.h @@ -107,7 +107,7 @@ struct Driver i += 2; usage = bcd_2_int(telegram, i, 4); // in kWh - ret_val = usage / 3.6 / 100000.0; + ret_val = usage / 360000; ESP_LOGVV(TAG, "Found register '0C09' with '%d'->'%f'", usage, ret_val.value()); break; }