mAh capacity remaining lua not working

I am trying to use lua script to show battery capacity remaining in a Taranis as per this video and this video and script here:

image

Although the starting mAh is displayed, it does not change with power consumption.

I have set the following variables to true.
image

Hoping someone with lua experience might help.

Unfortunately thats an issue with opentx and not ardupilot lua so im not sure if your going to get help for that here.