From 3f6d4df54fbfb6f31387c8bb292ee823ad219286 Mon Sep 17 00:00:00 2001 From: guillempages Date: Mon, 2 Mar 2020 12:14:49 +0100 Subject: [PATCH] Add tankerkoenig integration (#11137) * Add tankerkoenig integration * Add new configuration variable "stations" Enhance the documentation for the new optional configuration variable "stations" * Fix typos in tankerkoenig integration * Change integration to platform The integration is a platform integration instead of just a sensor now. --- source/_integrations/tankerkoenig.markdown | 94 ++++++++++++++++++ .../images/supported_brands/tankerkoenig.png | Bin 0 -> 1216 bytes 2 files changed, 94 insertions(+) create mode 100755 source/_integrations/tankerkoenig.markdown create mode 100755 source/images/supported_brands/tankerkoenig.png diff --git a/source/_integrations/tankerkoenig.markdown b/source/_integrations/tankerkoenig.markdown new file mode 100755 index 000000000000..c12536d9448a --- /dev/null +++ b/source/_integrations/tankerkoenig.markdown @@ -0,0 +1,94 @@ +--- +title: "Tankerkoenig Sensor" +description: "Instructions on how to integrate Tankerkoenig sensors within Home Assistant." +logo: tankerkoenig.png +ha_category: + - Energy + - Sensor +ha_release: 0.102 +ha_iot_class: Cloud Polling +--- + +The `tankerkoenig` platform allows you to monitor the fuel prices with [tankerkoenig.de](https://www.tankerkoenig.de/) from within Home Assistant and setup automations based on the information. +One sensor entity will be created for each fuel station within the given radius and for each configured fuel type in it. + +You can also add additional stations manually, referencing them via their IDs. To find out the ID for a given fuel station, you can use the [TankstellenFinder](https://creativecommons.tankerkoenig.de/TankstellenFinder/index.html) tool. + +## Setup + +To use this sensor you need an API key from [tankerkoenig](https://creativecommons.tankerkoenig.de). Go to [api-key](https://creativecommons.tankerkoenig.de/api-key), fill out the form and request a key. The API is free, but requests should be limited to less than once every 5 minutes. + +## Configuration + +To enable this platform, add the following lines to your `configuration.yaml`: + +```yaml +# Example configuration.yaml entry +tankerkoenig: + api_key: YOUR_API_KEY + radius: 1 + fuel_type: + - "diesel" +``` + +{% configuration %} +api_key: + description: The api key you got when you registered. + required: true + type: string +fuel_types: + description: The types of fuels you want to track. Allowed values are `e5`, `e10` and `diesel`. + required: false + default: ["e5", "e10", "diesel"] + type: list +latitude: + description: The latitude of the gas station to list. + required: inclusive + type: float + default: latitude of your home zone +longitude: + description: The longitude of the gas station to list. + required: inclusive + type: float + default: longitude of your home zone +radius: + description: The radius in km. in which to search for gas stations. Cannot be less than 1. + required: false + default: 5 + type: integer +scan_interval: + description: The time interval to poll the server for new data. You should not put values lower than 5 minutes here; otherwise you risk your API key being blocked. + required: false + default: 0:30 + type: time +stations: + description: List of additional fuel stations to create entities for. + required: false + type: list +{% endconfiguration %} + +## Full example + +This is a full example of the platform: + +```yaml +tankerkoenig: + api_key: YOUR_API_KEY + fuel_types: + - "diesel" + - "e10" + latitude: 52.51627 + longitude: 13.3777 + radius: 1 + scan_interval: "0:10:01" + stations: + - 8531b393-1e42-423b-cb4d-e4b98cff8a0c +``` + +Assuming there are two fuel stations within the specified range and location, you would get six sensor entities: + * sensor.tankerkoenig_berlin_paulstrasse_20_diesel + * sensor.tankerkoenig_berlin_paulstrasse_20_e10 + * sensor.tankerkoenig_aral_tankstelle_diesel + * sensor.tankerkoenig_aral_tankstelle_e10 + * sensor.tankerkoenig_svg_hamburg_strassen>_diesel + * sensor.tankerkoenig_svg_hamburg_strassen_e10 diff --git a/source/images/supported_brands/tankerkoenig.png b/source/images/supported_brands/tankerkoenig.png new file mode 100755 index 0000000000000000000000000000000000000000..5d3dd815677114fb845a516a7a2616beab8be4a9 GIT binary patch literal 1216 zcmV;x1V8(UP)O001Zm1^@s6)QG+q00006VoOIv0RI60 z0RN!9r;`8x010qNS#tmY4c7nw4c7reD4Tcy000McNliru;|mE70ydxw4KV-!1Widq zK~#9!?VL|`+At8tCBvQICA;(pq{%Dq;E#EC&FP6s8{t!PdTwJUnj~5EuY} zm$)#-m@azJeSW@(6=RH@_9cf&0RTpEks=`kTgzxfjY?!xGo4rOh*m(~N&=5BpG(*8 zxaR%i%ja_FYoqWrxXyTL>V&8T^g&n{W9-lQ@;$aK*~X9srie8j0DVE-AY~m zt)hN+$eV6~DFwj)0&~8Il`iT~H&xvRJDF7iHAsjH06`@Io!Gd3K4iGdpwzGufIbL{ z*COKlAcT0rdbmO4BCF|8a?s_}$QKBUp0Qn#+2Xh>H!&(dnNAZS(rCI=VU0^^9;!@x0?VPwYqb^K503yVtezs`c zrA41(w=&&ta0!g=d!eGFwsG2*JcY=qZOEd1j+FJZFZtuk=Q7o8?oq*)zkj~1b#|dd z(6+}{QrN?%&5*w9#%!}gN}p0}ob?hN=dANZT$_U^&TI3CUiY^{UadhPQSUIBBrul8#^Dn5SwcwNO9 zS#7W0P1m#ucTGEUh_4#m#8cas=pLT83w3e%3X83_!8u!~VYSZ~b;6WlQkixsA>!*wsU~#ogH^7D zV(YuG7{b?QxdgXa_n`<U# z)el#@I)8@zEmc^qV+uRakUop?!FW`Bs8;~mI+n)EqKu;9x8tOGl);vNr%YK*LUM0+ zl3e|bX?IlcWo~~mc0GwoJ$@gkr=hkD6yoC8wL(JFkR2zbD3~Ud?mh~|>CLv~|Bt(J zljF{i+DFP_Gxaw%qI0FYDaNfHaZ~MZ+LxT-my~moD!AF+L}$CI?DL)&06@2CC34Aq z4^K%00Pav+P-_8TINanC9p0S_03w%U