I made a Powerwall 2 monitor for my Windows desktop PC using Rainmeter and figured others here may find it useful.
Rainmeter is a free application from https://www.rainmeter.net/
The meter can be found at https://forum.rainmeter.net/viewtopic.php?f=27&t=27916
Monitor & graph Powerwall 2 API output:
• Grid import & export
• Battery charging, discharging & level
• Home load
• PV generation
• Will graph up to 7kW import/export
• Grid shows idle / import / export states
• Battery shows idle / charging / discharging states
Would I need anything else but the code you provided?