netzero-labs / tesla-solar-download

Download Tesla solar data using the API
Apache License 2.0
17 stars 3 forks source link

Power data is 5mins displaced compared to tesla app download #6

Open fhopley opened 2 weeks ago

fhopley commented 2 weeks ago

Hi. Thanks for building this, great help to start understanding and making use of teslapy.

The power data downloaded is consistently 5 mins displaced compared to the tesla app downloaded data. For example, the data from this download for '31/8/2024 12:00:00 AM' matches up with the tesla app download data at '2024-08-31T00:05:00+10:00'. Easy to work around, but thought you might be interested to know and have an idea why. I can tell that you are just passing through what is provided by the api, so clearly not an issue in your code.

Interestingly the data for 'soe' matches up exactly with tesla app download. You might want to add to the readme that you also download the 'soe' and that it is the state of charge of the powerwall(s).

zigam commented 2 weeks ago

Thanks for the report. I can reproduce the 5 min offset. I cross-checked the data using Powerwall-Dashboard (which independently aggregates readings from the gateway) and the data in the Tesla app downloads looks to be incorrect. The timestamps of course are assumed to be the start of the 5 minute interval. I suspect that's where the issue is -- the Tesla app uses this data set for the energy charts, where the 5 minute average value would be shown at the end of the interval instead of the start. But for CSV files it seems more intuitive to use the start times.

I documented the state of charge data in the README, thanks for the suggestion.