Hello,
since @pierre-gilles is off during the end-of-year holidays, I’m creating this thread as a reminder.
After several tests, I confirm that the units of the features for the MQTT indexes are not taken into account in the energy monitoring calculation.
Even when I set Wh or kWh (knowing that my indexes are in Wh), the calculation result remains identical in both cases:
From what I see with my other devices that report energy consumption in kWh, the results are correct.
@mutmut, I’ve created a branch common to all the changes, including these, so you can test. You just need to update the same image, I built it with the same name: docker pull terdious/gladys:dev-energy-calculate
It works perfectly for me on an HPJR index test: my meter readings are in Wh and I get good results for the consumption and cost calculations.
And if I go back to 2025, I have some weird things for November:
January, February and December are OK for the days and the values (checked against my detailed actual consumption).
According to the logs, I had a counter reset and then 800 kWh arrived
What caused this reset?
I didn’t stop or restart Gladys during the calculation for that period, only on 2025-03-28 for tests with the task logs.
That’s indeed strange. And it’s a very round number, and the indication of a negative value/reset is at 12:00 (important as info?). Could you check by adding a curve next to this feature’s energy to compare? A three-month view should be telling in this case, but indeed it looks like a reset to 0 or at least a negative value…
The best would be a small DB query on the corresponding date (November 11) to see if it really matches? And how do we handle the values before that…
My index doesn’t move in November, which is normal since the first red Tempo day was 29/12/25.
I’ll look at the tutorial by @pierre-gilles to extract the data from the db for each of my Tempo indexes.
EDIT :
I just retrieved the values from 11/11/25 to check what happened and I have an erroneous value that was recorded (800 kWh too much) so the visual is correct
Is there a way to change/delete this value?