timdorr / tesla-api

🚘 A Ruby gem and unofficial documentation of Tesla's JSON API for the Model S, 3, X, and Y.
https://tesla-api.timdorr.com/
MIT License
1.99k stars 532 forks source link

Documentation update - 15m interval available on battery calendar history #636

Closed BuongiornoTexas closed 1 year ago

BuongiornoTexas commented 1 year ago

More or less by accident, I've found that adding an "interval=15m" parameter to calendar history data calls for kind='energy' and period 'day' will return 15 minute energy data. For example, this call on our powerwall generates 96 x 15m records for the 18th of September.

our_pw.api('CALENDAR_HISTORY_DATA', kind='energy', period='year', end_date="2022-09-18T23:59:00+10:00",timezone='Australia/Hobart', interval='15m')

This may also be available for other calendar history and other time series data, but don't expect it to be consistent - using any minute interval other than 15m reverts to a single daily record, and trying other time units raises an error, and any other kind is ignores the interval parameter.

Leaving this here for others to decide if this is useful or not, and if it can be extended to other parts of the api.

I'm currently doing some on work powerwall monitoring - when I have that in hand, I'll raise a small PR to reflect this information if no one else has picked it up in the interim.

timdorr commented 1 year ago

Please do submit the PR. I leave issues for problems that need discussion first. For docs updates, a PR is ideal.