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

Plugins: add timeseries #18049

Merged
merged 2 commits into from
Jan 5, 2025
Merged

Plugins: add timeseries #18049

merged 2 commits into from
Jan 5, 2025

Conversation

andig
Copy link
Member

@andig andig commented Jan 4, 2025

timeseries plugin can be used with custom tariffs that provide forecast based on formula like this:

type: custom
forecast:
  source: timeseries
formula: |
  base := 0.35;
  if ts.Month() >= 6 && ts.Month() <= 9 {
    base = 0.40;
    if ts.Hour() >= 15 && ts.Hour() < 16 {
      base = 0.45
    } else if ts.Hour() >= 16 && ts.Hour() < 21 {
      base = 0.62
    } else if ts.Hour() >= 21 {
      base = 0.45
    }
  } else if ts.Hour() >= 15 && ts.Hour() < 16 {
    base = 0.36
  } else if ts.Hour() >= 16 && ts.Hour() < 21 {
    base = 0.38
  } else if ts.Hour() >= 21 {
    base = 0.36
  };
  base

Length of the time series is 48 hours.

/cc @VolkerK62

@andig andig added the enhancement New feature or request label Jan 4, 2025
@andig andig added the needs documentation Triggers issue creation in evcc-io/docs label Jan 4, 2025
@VolkerK62
Copy link
Contributor

Das includiert das hier? #17761 (comment)

See #17414. You can configure a formula that takes the current hour into account:

fees := 1
if ts.Hour <= 6 {
    fees = 2
}
price += fees

@andig
Copy link
Member Author

andig commented Jan 5, 2025

Jaein. Das timeseries Plugin ist die Voraussetzung dafür, dass die Formel auch ohne zugrunde liegende Preise funktionieren kann, wenn also nicht nur Charges geändert sondern überhaupt mal ein Basispreis erzeugt werden muss. Dafür generiert die timeseries die notwendigen Stundenslots. Das ginge auch mit einem Go Plugin oder viel Jquery, aber so ist es einfacher.

@andig andig merged commit 927cd39 into master Jan 5, 2025
6 checks passed
@andig andig deleted the feat/timeseries branch January 5, 2025 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs documentation Triggers issue creation in evcc-io/docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants