Hello there, I have a HA running on a raspberry pi3 since a few years. Some time ago, I added to my home some nodon SIN 4 FP 21 devices to drive my heaters. One of them had a "glitch" where summed energy was multiplied by 1000. I have found some entries in the sql database to correct historic data (in statistics_short_term and statistics tables), and have written some commands to correct these, but when I restart home assistant, I always get the old value for last summed energy value, on this heater. Where should I look for to correct the summation once and for all please?
#Where to correct a summation value?
1 messages · Page 1 of 1 (latest)
You can correct improper entries in dev tools -> statistics
Wow you just made me discover a marvellous way to deal with statistics! Thank you SO MUCH!
Hmmm looks like this did not do the trick, my history still shows a bump from 67kWh to 67000kWh on that day 😦
(and the last summation value still shows the same value as before)
Where can this be stored?
In fact, the "state" value still is wrong after correcting the "sum" value. I have corrected both fields in the sql tables (statistics & statistics_short_term), but the entity still shows the wrong value... and I can't find where it is stored.
okay, got it, that was in the dev tools->states, where I needed to put the right value for the summation. So this is now corrected. Thanks @rancid path 🙂
In fact, plenty of text (varchar(255)) values are stored for these in table "states", which might also need correction... 😦
did you figure it out or? you just need to find the dates/times that the increase happened and correct those entries
Nope, that did not work. I believe the sensor has a wrong value stored in itself (might have happened when I updated the firmware of the module...). So I'll have to reset it to get something "consistent"... 😦
what kind of sensor is this / it was a random one time increase that messed up your sensor value but since then its been changing/increasing normally, right?
This is a nodon SIN 4 FP 21 (pilot wire control/energy consumption device). And yes, this was a one time event, when the value jumped from 67kWh to 67000kWh. I believe it might have happened when the firmware got updated... but that's just a guess, I have no idea what really caused the issue.
you should be able to click this button right here
I did this, but the value is still wrong 😦
wdym the value is wrong? you find the problem entry, click on it, change the value, click adjust
can you not find the value or?
and depsite my efforts to correct it (I have even tried to write the value in the device' counter from the ZHA device attributes), it keeps showing the old one.
you change it, click adjust, and then the value for the exact same timeframe is what it was before you clicked adjust?
(that's the "summation delivered" attribute)
it briefly shows the value I put, then next sensor read shows the old value incremented by the consumption change.
so I'm pretty sure the value comes from the sensor itself
perhaps its a problem with the device then. im looking at the z2m page for it, it doesnt look like the energy value can be manipulated
yes, so I believe my only chance would be to reset the device to factory...
(btw, I use ZHA, not Zigbee2MQTT)
that is where I have tried to correct the device' value (using the "write attribute" option, of course 😉 )
yeah z2m just tends to have more information on devices
from z2ms side, this value cant be changed, i would imagine that the value just cant be changed at all. best you can do is see if you can try a factory reset, or simply adjust for the increased value in whatever automation/data you use it in