-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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] Initial contribution #14376
Conversation
a3de3ec
to
eef566e
Compare
Thanks!
The binding is only a data provider. Charts can be created using other framework components such as persistence. Unfortunately it's currently not possible to provide data with a given timestamp (back and forward in time), so out of the box it will not be possible to create a chart of future prices. You can see historic prices by persisting CurrentSpotPrice, for example. Persisting of historic and future prices would need to be resolved with openhab/openhab-core#3000 or something similar.
The intention was to have some way of exposing future prices, and I didn't want to create tons of channels representing different hours. Initially I used this JSON array in rules to perform calculations. However, this could later be replaced by the action
It looks cool, but this is a problem to be solved outside of the binding IMHO. |
I agree that fetching the data from a 3rd party and persisting it are two different topics. I just left this comment to the PR #3000. If the conclusion over there will be that bindings must not be able to persist data with future timestamps then I guess all that a binding like this can do is to fetch the data and store it as a serialized JSON array like you are doing here or alternatively have gazillion channels for different timestamps. And to address the IMHO obvious need to persist that data, there would then have to be for example a Rule which reads the serialized array (or gazillion channels with different timestamps) and then persists the data independently from the Binding that fetched it. Did I get this right? Cheers, Edit: Fixed the link to my comment. |
The only thing the binding can do is make the data available. In addition to the two methods you summarized, it can also be made available through actions, which this binding is also offering. When data is made available, users can consume the data in any way they see fit. I don't have any recommendations here. I'm using rules, but the Rest API could also be used to access items, i.e. the serialized JSON. |
eef566e
to
766e906
Compare
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/energi-data-service-binding-4-0-0-4-1-0/144370/1 |
766e906
to
17a971e
Compare
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/energi-data-service-binding-3-4-0-4-0-0/144381/1 |
17a971e
to
52453ff
Compare
52453ff
to
702c7c1
Compare
f831694
to
4d5bff6
Compare
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/dishwasher-price-calculation-automation/139207/5 |
2581fc3
to
26a4447
Compare
70a419c
to
66e35b8
Compare
d671440
to
de03690
Compare
...ain/java/org/openhab/binding/energidataservice/internal/action/EnergiDataServiceActions.java
Show resolved
Hide resolved
...ain/java/org/openhab/binding/energidataservice/internal/action/EnergiDataServiceActions.java
Show resolved
Hide resolved
02b682b
to
d512666
Compare
Signed-off-by: Jacob Laursen <[email protected]>
Signed-off-by: Jacob Laursen <[email protected]>
Signed-off-by: Jacob Laursen <[email protected]>
Signed-off-by: Jacob Laursen <[email protected]>
Signed-off-by: Jacob Laursen <[email protected]>
29b0de8
to
4d00b22
Compare
Signed-off-by: Jacob Laursen <[email protected]>
1566823
to
eeddd5a
Compare
@openhab/add-ons-maintainers - no one having time to pick up this PR for review? 🙂 Would be nice as baseline before 4.1 changes for currency, history, etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a reasonable code to test ratio :)
...in/java/org/openhab/binding/energidataservice/internal/handler/EnergiDataServiceHandler.java
Outdated
Show resolved
Hide resolved
...in/java/org/openhab/binding/energidataservice/internal/handler/EnergiDataServiceHandler.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.energidataservice/src/main/resources/OH-INF/addon/addon.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.energidataservice/src/main/resources/OH-INF/thing/channel-types.xml
Show resolved
Hide resolved
bundles/org.openhab.binding.energidataservice/src/main/resources/OH-INF/thing/thing-service.xml
Outdated
Show resolved
Hide resolved
Signed-off-by: Jacob Laursen <[email protected]>
Signed-off-by: Jacob Laursen <[email protected]>
Signed-off-by: Jacob Laursen <[email protected]>
@fwolter - thanks for picking up this PR and starting a review. I have fixed your initial comments. |
I was actually not looking at it yet as I assumed you'll depend on openhab/openhab-core#3597. |
It doesn't depend on this, but that will make it possible to store future prices and see graphs with those. However, the binding can already perform calculations based on future prices, or you can make your own calculations based on future prices from the JSON channel or thing actions to retrieve those prices.
The JSON channel is already half redundant because of thing actions, but I think it still serves a purpose for some scenarios where you can get future prices without writing rules. However, with openhab/openhab-core#3597 I think it will be fully redundant. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[enter your binding's logo reminder here.]
* Initial contribution Signed-off-by: Jacob Laursen <[email protected]> * Remove Value-Added Tax Signed-off-by: Jacob Laursen <[email protected]> * Migrate naming convention Signed-off-by: Jacob Laursen <[email protected]> * Add channel configuration example Signed-off-by: Jacob Laursen <[email protected]> * Remove current prefixes for forward compatibility with timestamped items Signed-off-by: Jacob Laursen <[email protected]> * Add filter for another grid company Signed-off-by: Jacob Laursen <[email protected]> * Use ISO 3166-1 alpha-2 codes in lowercase for XSD compliance Signed-off-by: Jacob Laursen <[email protected]> * Fix error handling for deserializers Signed-off-by: Jacob Laursen <[email protected]> * Fix compliance with RFC 9110 section 10.1.5 Signed-off-by: Jacob Laursen <[email protected]> * Add JavaScript example code Signed-off-by: Jacob Laursen <[email protected]> * Refactor List to Collection and use iterators Signed-off-by: Jacob Laursen <[email protected]> * Add filter for another grid company Signed-off-by: Jacob Laursen <[email protected]> * Extend cached history to 24 hours Signed-off-by: Jacob Laursen <[email protected]> * Remove filter for expired GLN Signed-off-by: Jacob Laursen <[email protected]> * Fix typos Signed-off-by: Jacob Laursen <[email protected]> * Improve descriptions Signed-off-by: Jacob Laursen <[email protected]> * Improve logging Signed-off-by: Jacob Laursen <[email protected]> --------- Signed-off-by: Jacob Laursen <[email protected]>
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/dishwasher-price-calculation-automation/139207/8 |
* Initial contribution Signed-off-by: Jacob Laursen <[email protected]> * Remove Value-Added Tax Signed-off-by: Jacob Laursen <[email protected]> * Migrate naming convention Signed-off-by: Jacob Laursen <[email protected]> * Add channel configuration example Signed-off-by: Jacob Laursen <[email protected]> * Remove current prefixes for forward compatibility with timestamped items Signed-off-by: Jacob Laursen <[email protected]> * Add filter for another grid company Signed-off-by: Jacob Laursen <[email protected]> * Use ISO 3166-1 alpha-2 codes in lowercase for XSD compliance Signed-off-by: Jacob Laursen <[email protected]> * Fix error handling for deserializers Signed-off-by: Jacob Laursen <[email protected]> * Fix compliance with RFC 9110 section 10.1.5 Signed-off-by: Jacob Laursen <[email protected]> * Add JavaScript example code Signed-off-by: Jacob Laursen <[email protected]> * Refactor List to Collection and use iterators Signed-off-by: Jacob Laursen <[email protected]> * Add filter for another grid company Signed-off-by: Jacob Laursen <[email protected]> * Extend cached history to 24 hours Signed-off-by: Jacob Laursen <[email protected]> * Remove filter for expired GLN Signed-off-by: Jacob Laursen <[email protected]> * Fix typos Signed-off-by: Jacob Laursen <[email protected]> * Improve descriptions Signed-off-by: Jacob Laursen <[email protected]> * Improve logging Signed-off-by: Jacob Laursen <[email protected]> --------- Signed-off-by: Jacob Laursen <[email protected]> Signed-off-by: Matt Myers <[email protected]>
* Initial contribution Signed-off-by: Jacob Laursen <[email protected]> * Remove Value-Added Tax Signed-off-by: Jacob Laursen <[email protected]> * Migrate naming convention Signed-off-by: Jacob Laursen <[email protected]> * Add channel configuration example Signed-off-by: Jacob Laursen <[email protected]> * Remove current prefixes for forward compatibility with timestamped items Signed-off-by: Jacob Laursen <[email protected]> * Add filter for another grid company Signed-off-by: Jacob Laursen <[email protected]> * Use ISO 3166-1 alpha-2 codes in lowercase for XSD compliance Signed-off-by: Jacob Laursen <[email protected]> * Fix error handling for deserializers Signed-off-by: Jacob Laursen <[email protected]> * Fix compliance with RFC 9110 section 10.1.5 Signed-off-by: Jacob Laursen <[email protected]> * Add JavaScript example code Signed-off-by: Jacob Laursen <[email protected]> * Refactor List to Collection and use iterators Signed-off-by: Jacob Laursen <[email protected]> * Add filter for another grid company Signed-off-by: Jacob Laursen <[email protected]> * Extend cached history to 24 hours Signed-off-by: Jacob Laursen <[email protected]> * Remove filter for expired GLN Signed-off-by: Jacob Laursen <[email protected]> * Fix typos Signed-off-by: Jacob Laursen <[email protected]> * Improve descriptions Signed-off-by: Jacob Laursen <[email protected]> * Improve logging Signed-off-by: Jacob Laursen <[email protected]> --------- Signed-off-by: Jacob Laursen <[email protected]> Signed-off-by: Jørgen Austvik <[email protected]>
This binding integrates the Danish service Energi Data Service, making data available as:
In this initial version, electricity prices are in focus, specifically the datasets Elspotprices and DatahubPricelist.
The binding is mainly targeting Denmark because of the tariffs and taxes provided which are specific to the Danish market and in currency DKK. However, spot prices can also be retrieved for other regions, for example Norway and Sweden.
Resolves #14222
Prerequisites
Features
Note about VAT
See #14222 (comment)
#14529 is now merged, and everything related to VAT has been removed from the binding.
Testing
I have the 3.4.x backport running in my productive system with rules for automation based on the provided thing actions:
https://community.openhab.org/t/dishwasher-price-calculation-automation/139207/4
Further plans
I've been working on this extensively for a few weeks and all planned MVP features are now implemented. Therefore, I feel the time is right for publishing this pull request. Major changes at this stage are not planned, but can of course be triggered by pull request comments. 😉
A few notes on areas I might revisit on short term:
On longer term, gas data could also be added, if there would be an interest in that.
Future
See openhab/openhab-core#3478 for discussions of more generic character.