briancmpbll / home_assistant_custom_envoy

173 stars 76 forks source link

Battery Energy Charged / Discharged Value accuracy #136

Closed cmack66 closed 10 months ago

cmack66 commented 11 months ago

When I look at the values provided for battery energy charged or discharged I see values in the range of 102 Wh or below. This does not make sense, is this what others see? I have an IQ10 which will charge/ discharge at a max of 3.8 KWh. Is this suppose to be a percentage values perhaps?

catsmanac commented 11 months ago

Those numbers are changes in 'Current Battery Capacity' between readings. Capacity going up shown in 'Battery Energy Charged' and going down in 'Battery Energy Discharged'. Don't know how often the Gateway updates from the battery, but since it's more often then 1/hour it will be a lower number as the 3.8KWh is for a full hour.

cmack66 commented 11 months ago

Seems the updates to battery charged discahrged are very sporadic and almost unusable for me . Sometimes it goes several minutes without being updated. and if it is cumulative Wh and there is no set time interval hard to use to make the value consistent to use in automations.

catsmanac commented 11 months ago

In your log of other day (13 Aug) that spans ~20 min between 08:44 - 09:03 I see the percentFull / 'Total Battery Percentage' increasing van 59 to 69 % for all 3 batteries and encharge_capacity is 3360 for all 3. I guess that represents a charge 10% of 3360 = 336Wh in 20 min for each battery.

Looking at the code I see it basing the charge/discharge amount on the battery capacity which is probably hardly changing like you observe. I wonder it should use the change in percentage and battery capacity to calculate the charge/discharge amount. Can you confirm that 'Current Battery Capacity' is pretty constant for all 3 batteries?

@briancmpbll what was the intent when you added this?

cmack66 commented 11 months ago

Current battery capacity looks very consistent and updates regularly from what I see on all 3 batteries and the aggregate total battery percent follows as well.