yo8192 / octo2influx

InfluxDB+Grafana Dashboards of your Octopus Energy usage and tariff data
GNU General Public License v3.0
6 stars 2 forks source link

Support economy 7 tariffs #4

Open netjordan opened 5 months ago

netjordan commented 5 months ago

Hello,

First of all thanks for continuing this project on - it has actually helped me almost cut my bill in half by providing the data to show that switching to agile tariff will save me money.

When running with an economy 7 tariff such as E-2R-VAR-22-11-01-A, the following error is outputted

2024-04-21 11:33:31 INFO octo2influx.py:456: === Retrieving tariffs... 2024-04-21 11:33:31 INFO octo2influx.py:467: ====== Retrieving electricity standard-unit-rates price of tariff Flexible Octopus November 2022 v1 from Octopus... progress (one dot per page) Traceback (most recent call last): File "/Users/jordan/Projects/octo2influx/src/octo2influx.py", line 469, in <module> data = retrieve_paginated_data( File "/Users/jordan/Projects/octo2influx/src/octo2influx.py", line 161, in retrieve_paginated_data response.raise_for_status() File "/Users/jordan/Projects/octo2influx/venv/lib/python3.9/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.octopus.energy/v1/products/VAR-22-11-01/electricity-tariffs/E-2R-VAR-22-11-01-A/standard-unit-rates/?period_from=2023-04-26T23%3A00%3A00Z&period_to=2024-04-21T22%3A59%3A59Z

I believe this is because there is a different url and format required for the economy 7 tariffs, with separate urls for day and night rates.

It would be great to be able to use these

yo8192 commented 4 months ago

I've had a look and I see the Octopus API has different 'day' and 'night' endpoints for this, both on the consumption and tariffs side. However you'd need a smart meter to be able to get usage for each half-hour and for octo2influx to be useful: do you have one?

Also the API doesn't seem to say what hours of the day are 'night' vs. 'day'.

https://www.uswitch.com/gas-electricity/guides/economy-7/ says the day and night hours can vary, apparently depending on the provider, but also with daylight saving time changes :/

https://octopus.energy/help-and-faqs/articles/what-is-an-economy-7-meter-and-tariff/ says "This means you pay less for any energy you use at night (usually between 12:00am and 7:00am) and more for energy used during the day (usually between 7:00am and 12:00am).".

Can you shed any light on what the day and night hours are, if they are the same for all Octopus customers, and if they change with daylight saving time changes or not?