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.98k stars 532 forks source link

"/api/1/energy_sites/{site_id}/calendar_history" API does not work when kind=energy #751

Closed CiaranGames closed 10 months ago

CiaranGames commented 10 months ago

When you try to call the API and set all your request parameters, like so:

{
    "kind": "energy",
    "end_date": "2023-08-26T23:45:00-01:00",
    "period": "day",
    "interval": "15m"
}

It returns this error:

{
    "response": null,
    "error": "https://powergate.prd.sn.tesla.services:443/api/v3/energy_site/energy_history => Period must either be 'day', 'month', 'year', or 'lifetime",
    "error_description": ""
}

I have already tried all the different periods (day, month etc) and they all return the same error. The API works with kind=power.

Any help to get this working would be amazing.