I’ve made a simple Lua script in order to make a percentage estimation based on voltage reading of Li-Po batteries (I know it’s not the best way to estimate percentage), after calculating the percentage, I set this value to the battery monitor using battery:reset_remaining(). Doing so will set this new percentage and will be shown in Mission Planner. The problem is, doing a test with my drone, when reading the parameters, the Bat used EST (mah) is not saving the accumulated current used from the battery, the current being used is shown normally, but the accumulative value is not.
My guess is that somehow, forcing the battery percentage to a certain value is messing up with the accumulative current value, even when the function is called only once.
Since there is no much information about how the function works on the docs.lua file I think there might be an error in how this function is being implemented.
I’m almost certain you are overwriting the value of the estimated capacity remaining when you call that method, so the behavior you’re experiencing is quite likely expected.
Don’t use the battery:reset_remaining() binding if you wish to retain the mAh consumed estimate.