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

[energidataservice] Reduce redundant persistence of tariffs #16222

Merged
merged 1 commit into from Jan 7, 2024

Conversation

jlaur
Copy link
Contributor

@jlaur jlaur commented Jan 6, 2024

Unlike spotprices, tariffs are not updated by the hour.

The most dynamic tariff is the grid tariff which can currently change as often as four times per day. The most static one is the system tariff which is usually only changed once in very hectic years.

The time series implementation didn't take any of this into consideration. Previously when using persistence strategy everyChange this was not a problem (first row is an actual change, the rest are probably caused by restarts):

Timestamp Value
2023-07-01 00:00:00.064 0.87125
2023-09-30 12:51:56.487 0.87125
2023-11-04 20:31:20.955 0.87125
2023-11-18 17:25:23.032 0.87125

Now, when using persistence strategy forecast, this would cause many redundant updates:

Timestamp Value
2023-12-21 23:00:00.000 0.87125
2023-12-22 00:00:00.000 0.87125
2023-12-22 01:00:00.000 0.87125
2023-12-22 02:00:00.000 0.87125
2023-12-22 03:00:00.000 0.87125
2023-12-22 04:00:00.000 0.87125
2023-12-22 05:00:00.000 0.87125

This fix will avoid adding such redundant updates to the published time series.

As an example, for N1 grid tariffs the red marked rows will no longer be persisted:

image

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
@jlaur jlaur added the bug An unexpected problem or unintended behavior of an add-on label Jan 6, 2024
@jlaur jlaur requested review from J-N-K and a team January 6, 2024 20:04
@jlaur
Copy link
Contributor Author

jlaur commented Jan 6, 2024

@openhab/add-ons-maintainers - this is also a candidate for 4.1.x.

Copy link
Member

@kaikreuzer kaikreuzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kaikreuzer kaikreuzer merged commit 75dcdd2 into openhab:main Jan 7, 2024
3 checks passed
@kaikreuzer kaikreuzer added this to the 4.2 milestone Jan 7, 2024
kaikreuzer pushed a commit that referenced this pull request Jan 7, 2024
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
@kaikreuzer
Copy link
Member

Cherry-picked to 4.1.x.

@kaikreuzer kaikreuzer added the patch A PR that has been cherry-picked to a patch release branch label Jan 7, 2024
@jlaur jlaur deleted the energidataservice-timeseries branch January 7, 2024 10:32
austvik pushed a commit to austvik/openhab-addons that referenced this pull request Mar 27, 2024
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Jørgen Austvik <jaustvik@acm.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on patch A PR that has been cherry-picked to a patch release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants