Issue with Corrected Energy Readings and -0 [BUG]

Hey guys,

I have noticed that if you correct an bad energy reading that was a negative reading to 0 it causes that value to be -0 when it should be 0. It’s causing the bar graphs on the energy dashboard to display shifted up. Not a huge deal but not sure this is supposed to happen either. Just a guess but it looks like the energy boards bar graph logic is looking for a negative sign on any of its value to determine if it needs to show the negative graph and then give that -value a buffer just a bit below it for some padding.

Small little bug but maybe there should be no such thing as a -0? Feel like the code for the graph is doing what it should be doing and never expects a -0. So the calculations on an adjusted static should be checked for -0

It only seems to happen if there was 0 usage for that hour… if there are any other reading of course its positive. I can correct the reading to 0.01 if I want to to make it positive but it is repeatable! I did look through the statistics for that hour and none of the readings are set to -0. I have not tried one by one to set them to 0. Next time it happens I am going to look in the database to see if I can find it

Does anyone know the correct GitHub to report this to? there are so many I am running HAOS in a docker container on TrueNas if that matters

This seems to be right Expand the "related" function when looking at an entity so it also shows which helpers use it - #2 by Sir_Goodenough

1 Like