So this might be of help to other. I tried Teslemetry to see what it can do in Home Assistant (HA). Besides a nice plugin for HA, Teslemetry also offers an API. I tried to download charging data. So i went to this URL.
After reading how the call should work, i clicked the 'Open API' button in the lower left. In the new window, i clicked 'Import Collection'.
I clicked to Vehicle > Charging History to get to this screen to fill out:
The VIN and API key i could retrieve in the Teslemetry Console.
A call like that delivers a JSON output. I copied it and saved the JSON to my desktop.
I told Perplexity.ai "I will receive a file frequently with a JSON that will be format like the below example:"
and gave it a part of the JSON, after which i asked
"For every sessionid in the JSON i want 1 row, with sessiosnid, siteLocationName, chargeStartDateTime, chargeStopDateTime, "feeType - CHARGING", currencyCode": "EUR", rateBase, usageBase, totalBase, netDue, "feeType PARKING", totalDue, "invoices fileName . What tool and/or code can do that".
It told me Python could do the job and gave me a Python script that would read a file and output a csv. I asked it to help me install Python, and run the script.
Which resulted in a CSV with the SUC sessions.
Geen opmerkingen:
Een reactie posten