I was easy for me to do using the app, but I also wanted to see what "the system" thought it had. because I have an EV, it was fairly easy for me to, after driving to work and back, set my EV to charge at 3 in the morning, and turn my reserve down to zero in the app. Then, because my production right now is about double my normal daily usage, simply let my PV fill my powerwalls (2) to full and see what that number was.
No math needed at all, lol. I wanted a way to validate that result, because I was aware there was information about what the powerwall thought it had, which was returned via the curl commands that
@gpez had.
In my case, as I have said in another thread, I have 21% degradation after 17 months or so.
As for "create an app" there is an app already, the tesla app, lol. You are asking for the wrong thing, imo. You dont want an app. You want one of them to create a custom dashboard, but then you end up with needing it to be self hosted like they have done, or possibly worrying about where your tesla token is being used.