The binding uses the Tankerkönig API <https://www.tankerkoenig.de> for collecting gas price data of German gas stations.
Special thanks to the creators of Tankerkönig for providing an easy way to get data from the [MTS-K] (Markttransparenzstelle für Kraftstoffe).
Tankerkönig is providing this service for free, however they request to prevent overloading of their server by reducing the number of web-requests.
The data will be updated for each Station individually after the initialization and after each Refresh Interval for all (open) stations (Note: changing the Webservice will cause the Refresh Interval to restart).
Additionally one may select the mode Opening-Times in which only those Stations get polled which are actually open.
For a correct usage of opening times the binding needs the information if the actual day is a holiday.
Note:
While using the mode Opening-Times the channel "station_open" will NOT show "close" because during such times no update is being requested from that Station!
## Preparation
In order to use this binding one needs to prepare:
- minimal Java Version is 1.8.0_101-b13 (otherwise the https request will not produce a usable return)
- a personal API-Key
Request a free Tankerkönig API key from: <https://creativecommons.tankerkoenig.de/> (Select the tab "API-Key").
- LocationIDs of the selected gas stations
Search for the gas station IDs via the [finder tool](https://creativecommons.tankerkoenig.de/TankstellenFinder/index.html) (Select tab "Tools" -> "Tankstellenfinder").
Drag the red marker on the map to the rough location of desired gas stations.
Select the gas stations and click "Tankstellen übernehmen" on the right.
This will download a file holding the location IDs.
For example: `a7cdd9cf-b467-4aac-8eab-d662f082511e`
## Supported Things
This binding supports:
-Webservice (bridge)
-Station (thing)
## Discovery
The binding provides no discovery.
The desired Webservice and Stations must be configured manually or via a things file.
## Binding configuration
The binding has no configuration options itself, all configuration is done at 'Bridge' and 'Things' level.
The Webservice (bridge) needs to be configured with the personal API-Key, the desired Refresh Interval (the time interval between price-updates, default 60 minutes, minimum 5 minutes) and the Opening-Times mode selection (in this mode price-updates are only requested from stations that are actually open).
java.io.IOException: java.util.concurrent.ExecutionException: javax.net.ssl.SSLHandshakeException: General SSLEngine problem
......
```
This indicates a missing certificate of a certification authority (CA) in the certificate-store of the Java JDK under which openHAB is running.
In most cases, updating to the latest version of JDK solves this because the store of cacerts are maintained and updated in Java releases.
Note: You must restart openHAB after a Java update.
If you receive the error because you are running an old Linux installation which does not have the latest java-versions available in its package-repositories, you may be able to fix the issue using one of the three options below:
If the Tankerkönig return indicates an error a descriptive message (in German) is added next to the OFFLINE which will be displayed on the Webservice and Station(s) pages on UI. For further investigation the API Explorer can be used to show all data-fields of the things.
On the next receipt of a valid message Webservice and Station(s) will go ONLINE again.
The scheduled polling of price-data is canceled in case of no valid response.
Users should check the log for any reports to solve the reason for the OFFLINE status.
In order to restart the polling a change of the Webservice has to be saved (for example a change in the Refresh Interval).
Note: If the API-key is banned by Tankerkönig, the reason has to be cleared with Tankerkönig!
-How to set the switch item for the channel holiday?
The correct usage of opening times needs the information if the actual day is a holiday.
The binding expects a switch item linked to the Webservice channel holiday.
This switch can be set either manually (only suggested for testing!) or by a rule which uses the [ephemeris action](https://www.openhab.org/docs/configuration/actions.html#ephemeris) to set that switch.