Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show the last 10 days history for the next Saving Session period #533

Open
BottlecapDave opened this issue Nov 16, 2023 Discussed in #531 · 3 comments
Open

Show the last 10 days history for the next Saving Session period #533

BottlecapDave opened this issue Nov 16, 2023 Discussed in #531 · 3 comments
Labels
enhancement New feature or request

Comments

@BottlecapDave
Copy link
Owner

Discussed in #531

Originally posted by deltamelter November 15, 2023
Since the new saving sessions are looking back over 10 days to decide "normal" usage so that they know how much we "really" save, could you add an entity to show the history for the upcoming period over the previous 10 days?

We’ll look at your historical smart meter data leading up to a Session, and calculate what you usually use at that time of day, on average.
If the Session is on a weekday, we’ll look at your half-hourly usage over the last 10 weekdays (excluding Saving Session days). If the Session is on a weekend, we’ll look at your half hourly usage over the last 4 weekend days.
We then use these half-hourly averages as a benchmark – so you’ll earn points for every kilowatt hour you save compared to that number during your Session.

@BottlecapDave BottlecapDave added the enhancement New feature or request label Nov 16, 2023
@ghanel
Copy link

ghanel commented Dec 5, 2023

Have you seen this app which does the above and estimates the octopoints received.

https://savingsessions.streamlit.app/

The project is also open sourced. Would you take pull requests for adding this functionality?

@BottlecapDave
Copy link
Owner Author

I'm happy to take contributions. I'm currently in the process of reworking how API requests are made (as per #597) so it might be best to hold fire until that's complete. I was thinking of looking at this "soon", but it could be a couple of months.

My current plan is

  1. Function which calculates the list of dates to retrieve consumption data for. This should take the target start/end of the saving session along with the collection of joined saving sessions and should return the 10 start/end dates that meet the target requirements. This should be fully unit tested.
  2. Function which takes a collection of consumption data and calculates the average consumption. This should be fully unit tested
  3. Sensor called `octopus_energy_{{ACCOUNT_ID}}_target_saving_session which updates the underlying data every 1 hour (TBC), using function 1 to retrieve current consumption via api client and then calculate and set the target consumption based on function 2.

The only question I have atm is if export meters are brought into the calculation if available.

@BottlecapDave
Copy link
Owner Author

I've managed to find some time over the holiday to look into this. I'm just waiting for the next saving session to test it properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

2 participants