Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

Data Export

This site may earn commission on affiliate links.

realbeard

New Member
May 18, 2023
2
1
NZ
I can export Powerwall data from my App, but it's not granular enough.

I want to download hourly data for the past year - ie. I want to know exactly how much energy from the I have purchased between 9am-10am, how much solar has been generated at that time across the year, the times when the Powerwall has been charging and depleting hourly etc.

Basically all the data that can be exported in the app, just done at a much more granular level. If it means that I have the past 365 days hour by hour, that's fine - I can use excel and sort the data myself.

I did see somebody talk about Google Sheets which I managed to use to get access, but couldn't work out how to get the data that I wanted.

Is there anyone that can help me get this data?

I can follow instructions, but understand Git and don't really understand how all that works!

Thanks in advance!
 
I want to download hourly data for the past year - ie. I want to know exactly how much energy from the I have purchased between 9am-10am, how much solar has been generated at that time across the year, the times when the Powerwall has been charging and depleting hourly etc.
If you are in Day view, it will be every 5 minutes in the download, but you have to do every day by hand. Weekly is by Day ...
 
I also needed this data recently and wrote a Python script to download it. I added it to GitHub:
It uses the Tesla API to download the entire history of solar/battery/grid power data in 5 minute increments.
 
I also needed this data recently and wrote a Python script to download it. I added it to GitHub:
It uses the Tesla API to download the entire history of solar/battery/grid power data in 5 minute increments.
I use WIndows 11, and the readme.md file is clearly aimed at Linux. And I prefer to not wrestle with GitHub or svn. So I did the following:
I went to the link above, clicked on the green Code button, and downloaded the distribution as a ZIP file, and unzipped this into a suitable folder, which I'll call TSD here. I successfully downloaded the Power and Energy data using either of two methods.

Method 1: I use PyCharm at work, so I downloaded it and Python 3.11 and installed both. I made a PyCharm project of TSD\tesla_solar_download.py, and chose Python 3.11 as the base interpreter (File/Settings/Python Interpreter). PyCharm knows about requirements.txt, so I only needed one click to import the packages. To add the parameter "--email [email protected]" I clicked Run/Edit Configurations and on the resulting popup clicked Modify Options and chose Parameters and added the parameter. Then clicked run and followed the instructions in the program. As a bonus, PyCharm correctly rendered the readme.md file.

Method 2: I wanted to see if using a Command Prompt would work, so I made a copy of TSD to TSD2, and deleted the venv sub folder. Copying meant that TSD2 contained the download subfolder already filled with lots of csv files, so Tesla's server wasn't asked to download everything for Method 2. It turned out that Python wasn't in my Path environment variable even though I had asked the Python installer to do that, so I had to add it to the System Path manually. On my computer, it is necessary to use py instead of python on the command line. I entered these lines into the command prompt:
py -m venv venv
py -m pip install --upgrade pip
pip install -r requirements.txt
I doubt that upgrading pip was necessary, but it doesn't hurt.
Then created the file "download.bat" containing
py tesla_solar_download.py --email [email protected]
Clicking on download.bat in Windows Explorer caused an update of the download directory.
In the future I expect to click on download.bat rather than firing up PyCharm.
 
I use WIndows 11, and the readme.md file is clearly aimed at Linux. And I prefer to not wrestle with GitHub or svn. So I did the following:
I went to the link above, clicked on the green Code button, and downloaded the distribution as a ZIP file, and unzipped this into a suitable folder, which I'll call TSD here. I successfully downloaded the Power and Energy data using either of two methods.

Method 1: I use PyCharm at work, so I downloaded it and Python 3.11 and installed both. I made a PyCharm project of TSD\tesla_solar_download.py, and chose Python 3.11 as the base interpreter (File/Settings/Python Interpreter). PyCharm knows about requirements.txt, so I only needed one click to import the packages. To add the parameter "--email [email protected]" I clicked Run/Edit Configurations and on the resulting popup clicked Modify Options and chose Parameters and added the parameter. Then clicked run and followed the instructions in the program. As a bonus, PyCharm correctly rendered the readme.md file.

Method 2: I wanted to see if using a Command Prompt would work, so I made a copy of TSD to TSD2, and deleted the venv sub folder. Copying meant that TSD2 contained the download subfolder already filled with lots of csv files, so Tesla's server wasn't asked to download everything for Method 2. It turned out that Python wasn't in my Path environment variable even though I had asked the Python installer to do that, so I had to add it to the System Path manually. On my computer, it is necessary to use py instead of python on the command line. I entered these lines into the command prompt:
py -m venv venv
py -m pip install --upgrade pip
pip install -r requirements.txt
I doubt that upgrading pip was necessary, but it doesn't hurt.
Then created the file "download.bat" containing
py tesla_solar_download.py --email [email protected]
Clicking on download.bat in Windows Explorer caused an update of the download directory.
In the future I expect to click on download.bat rather than firing up PyCharm.
I am on MacOS, but am guessing will still work similar. Thanks again.
 
I've been downloading the CSV file for awhile and just keeping up with it by the day. Be warned that starting with the recent update with Charge on Solar, the format of the CSV changed by adding a vehicle column and switching the order of the other columns. Plus, I've noticed that the To Grid column doesn't seem to be at all accurate now. When I export data for yesterday, the CSV file says I exported 8.5 kWh, but just looking at the app it says I exported 13.5 kWh. And, up until last month, my spreadsheet of exported solar numbers matched my bill pretty well, but now it predicts a much lower monthly export.

Also, I went back to June and now those numbers are low, where before they were fairly accurate. Be careful when using the latest data and don't go back and wipe out a month of good data with this new erroneous data.