katerica
(katerica)
May 9, 2023, 8:55pm
11
Hi @somy ,
This is now a deprecated solution as far as I can tell. You should check the evolution of Jacobs binding, which I believe has far surpassed the functionality here.
opened 11:46PM - 14 Jan 23 UTC
enhancement
In order to make data from [Energi Data Service](https://www.energidataservice.d… k/) easily accessible in openHAB, I would like to create an add-on implementing this [API](https://www.energidataservice.dk/guides/api-guides).
The first milestone will have focus on [Elspot Prices](https://www.energidataservice.dk/tso-electricity/Elspotprices) and add a channel being updated with the current electricity price (per kilowatt hour). This was immediately achieved when starting the work on this add-on today:
### Data Filters
Filters were based on https://github.com/MTrab/energidataservice/blob/master/custom_components/energidataservice/tariffs/energidataservice/chargeowners.py
They have all been optimized and tested, and issues based on findings were created in this repo.
## Plan
This is the public TODO (in headline form) in order to reach "MVP" and publish a pull request:
- [X] Expose future prices as advanced channel with JSON array (since I'm not aware of any neat way of doing this currently).
- [X] Implement smarter retry policy on failures (e.g. exponential backoff and jitter).
- [X] Add support for tariffs (dataset **DatahubPricelist**).
- [x] Provide pre-made filters for known grid companies.
- [x] Add channel configuration for overriding pre-made filters.
- [x] Add grid companies to option list.
- [x] Add channels for Energinet (TSO) tariffs.
- [x] Add action for calculating price for specified consumption in a period. See https://community.openhab.org/t/dishwasher-price-calculation-automation/139207.
- [x] Load/keep retrospective data, e.g. 12 hours back in time. This would make it possible to write rules giving feedback on price when an appliance has ended a program.
- [x] Documentation cleanup.
- [x] Code cleanup (and a few more unit tests).
# Status
Draft code is here (work in progress):
https://github.com/jlaur/openhab-addons/tree/14222-energidataservice/bundles/org.openhab.binding.energidataservice
## Features
- **Optimized service calls:** Spot prices are retrieved once per day and tariffs only upon expiry (usually months/years).
- **Error handing:** Policies for retry strategies are in place to make sure data will be retrieved as soon as possible after failed calls. This includes exponential back-off with jitter.
- Channel configuration for adding VAT to prices based on openHAB regional settings.
- Grid company is selectable in configuration.
- Pre-configured filters are included for all known grid companies.
- Filters can be overridden by channel configuration.
- Spot prices and all tariffs are supported.
- Properties shows number of remaining calls as well as timestamp of last call.
- Actions for getting prices and performing calculations.
## Testing
- [org.openhab.binding.energidataservice-4.0.0-SNAPSHOT.jar](https://drive.google.com/file/d/175bvVisUXeTT9OUo_GUw2va0nJ6Gr3Af/view?usp=sharing) (latest)
- [org.openhab.binding.energidataservice-3.4.2-SNAPSHOT.jar](https://drive.google.com/file/d/1uNi7JTGcRCDWcAzCOrwb9Lme_UauG2eD/view?usp=sharing) (backported 27.01.2023, last updated 08.02.2023 21:53)
## Screenshots
### Properties and Configuration

### Channels

### Channel configuration

### Total price

Related to openhab/openhab-core#3478
Cheers