hypercrypt / octopus-db

Importer for Octopus Energy API Data
5 stars 0 forks source link

Unnecessary tariff information downloaded #4

Open NiccyB opened 1 year ago

NiccyB commented 1 year ago

Hi, Not sure if this is a problem or intended behaviour, but... Amongst other tariffs, I was on tariff 'E-1R-AGILE-18-02-21-B' from 2021-01-11 to 2021-07-23 before moving to 'E-1R-GO-21-05-13-B' and now 'E-1R-GO-22-03-29-B'. The code still downloads tariff information for both the tariffs I'm no longer on.

MariaDB [octopus]> select tariff,max(valid_from) from price_h group by tariff;
+------------------------------------------+---------------------+
| tariff                                   | max(valid_from)     |
+------------------------------------------+---------------------+
| E-1R-AGILE-18-02-21-B                    | 2023-01-04 22:30:00 |
| E-1R-GO-21-05-13-B                       | 2023-01-04 04:30:00 |
| E-1R-GO-22-03-29-B                       | 2023-01-04 04:30:00 |
| E-1R-VAR-19-04-12-B                      | 2023-01-01 00:00:00 |
| E-2R-GB-FIXED-SEPTEMBER-20-ELEC-2-RATE-B | 2019-09-18 00:00:00 |
+------------------------------------------+---------------------+

That having been said, it may be handy to have the option of downloading all current tariffs - that way it would be reasonably easy to run reports showing which tariff would have been the best one for day/month etc.

hypercrypt commented 1 year ago

It is currently intended behaviour as the idea was to be able to compare but I think it's something to change and stop once the tariff is no longer current. I like the idea of being able to download tariff information