StefaE / PVForecast

Forecasts to optimize electricity consumption for rooftop PV (photo-voltaic) installations
GNU General Public License v3.0
50 stars 13 forks source link

adds option to set retention policy for influx #17

Closed michbeck100 closed 1 year ago

michbeck100 commented 1 year ago

This PR adds the option to set a retention policy for influx, default is None. Furthermore are requirements.txt with all dependencies was added.

StefaE commented 1 year ago

Hi Michael, Thx. for the proposal.

I'm not sure what you are trying to achieve?

I'm working on an update, which will no longer require manual creation of the database. I was not planning to add a retention policy on the automatically created database - but I can certainly be convinced to change my mind there :-)

michbeck100 commented 1 year ago

I use multiple retention policies for different intervals: daily, weekly, monthly, yearly and forever. Default is daily but the data is only retained for 24 hours with an interval of 10 seconds. Then I use multiple continuous queries to copy the data to the different retention policies using appropriate intervals, e.g. for yearly the data is grouped by 30m, so in the end I can keep a lot more data. I couldn’t do this with a 10 second interval.

StefaE commented 1 year ago

Thx., Michael - got it - apparently you are storing other data in the same Influx database (because none of the PVForecast data sources updates more often than every 15min). Best practice would probably be to store data in different databases (Influx 2.x has only one retention policy per 'bucket' which is the loose equivalent to 'database' in Influx 1.x)

I'll push your changes as a non-documented feature with next update (and add a retention policy to the database creation). Will take a week and a bit (due to the other changes)

michbeck100 commented 1 year ago

Perfect! Thanks

StefaE commented 1 year ago

This has been closed with v2.10 - sorry for the additional delay