badguy99 / octocost

Octocost is an app which works under AppDaemon within Home Assistant which gets yearly and monthly cost and usage of Octopus Energy Agile Octopus Tariff
MIT License
13 stars 3 forks source link

Get tarrifs and start dates from api if account id given, and if using tracker get data elsewhere #4

Closed badguy99 closed 3 years ago

badguy99 commented 4 years ago

If account id is given, https://api.octopus.energy/v1/accounts/ can be used to get the tariff details, and start end dates e.g.:

tariff_code "E-1R-AGILE-18-02-21-H"
valid_from "2020-02-23T00:00:00Z"
valid_to "2021-02-23T00:00:00Z"

gas data is also there.

I using tracker tariff, e.g.

tariff_code "E-1R-AGILE-18-02-21-H"
valid_from "2020-02-23T00:00:00Z"
valid_to "2021-02-23T00:00:00Z"

Use the following rather than the normal API, until tracker is added to the normal API:

    https://octopus.energy/api/v1/tracker/G-1R-SILVER-2017-1-{grid_code}/daily/current/0/{consumption}/
    https://octopus.energy/api/v1/tracker/G-1R-SILVER-2017-1-{grid_code}/monthly/past/{num_months}/{consumption}/
    https://octopus.energy/api/v1/tracker/G-1R-SILVER-2017-1-{grid_code}/monthly/future/{num_months}/{consumption}/