Capture Peak Mains Values over period of time

Here’s a code snippet that I threw together using the informal API to show simple logging of mains voltages and frequency. It doesn’t have all the embellishments needed for long term logging (authentication updates, error handling/reconnects, formatting, etc.)

Plus it doesn’t contain separate L1/L2 power - just voltages, because the current API code doesn’t expose those. But I think that data must be available in one of the json payloads pulled by one of the calls in the API. So it would take some digging.