-
Notifications
You must be signed in to change notification settings - Fork 1
/
tankerkönig
55 lines (46 loc) · 2.89 KB
/
tankerkönig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Kraftstoffpreise von Tankerkönig.de
#
# Zum Testen einfach die URLs im Browser öffnen.
# URL für Tankstellenliste:
# https://creativecommons.tankerkoenig.de/json/list.php?lat=52.52099975265203&lng=13.43803882598877&rad=4&sort=price&type=diesel&apikey=a3de1edb-2025-54d6-a52d-692fc70561d1
# URL für Details einer Tankstelle:
# https://creativecommons.tankerkoenig.de/json/detail.php?id=005056ba-7cb6-1ed2-bceb-90e59ad2cd35&apikey=a3de1edb-2025-54d6-a52d-692fc70561d1
#
# Tankerkönig apikey wird benötigt
#
# Tankstelle Mundorf Kaldauen 2025cec6-d76f-422b-b305-fe6b75be12e9
# Tankstelle Star Zeithstr. 005056ba-7cb6-1ed2-bceb-87412ca64d30
#
# http://www.cyberwulf.de/2016/fhem-spritpreise-von-tankerkoenig-de/
# Tankstelle Mundorf Kaldauen
define TS.Station.Mund HTTPMOD https://creativecommons.tankerkoenig.de/json/detail.php?id=2025cec6-d76f-422b-b305-fe6b75be12e9&apikey=aaaaa 900
attr TS.Station.Mund userattr event-min-interval event-on-update-reading icon reading1Name reading1Regex reading2Name reading2Regex reading3Name reading3Regex requestHeader stateFormat timeout
attr TS.Station.Mund alias Tankstelle Mundorf Kaldauen
attr TS.Station.Mund timeout 5
attr TS.Station.Mund event-on-update-reading .*
attr TS.Station.Mund group Spritpreise
attr TS.Station.Mund icon car
attr TS.Station.Mund reading1Name Diesel
attr TS.Station.Mund reading1Regex diesel":([\d\.]+)
attr TS.Station.Mund reading2Name Super_E10
attr TS.Station.Mund reading2Regex e10":([\d\.]+)
attr TS.Station.Mund reading3Name Super_E5
attr TS.Station.Mund reading3Regex e5":([\d\.]+)
attr TS.Station.Mund requestHeader Content-Type: application/json
attr TS.Station.Mund stateFormat {sprintf("Diesel %.3f €\n SuperE10 %.3f €\n SuperE5 %.3f €", ReadingsVal($name,"Diesel",0), ReadingsVal($name,"Super_E10",0), ReadingsVal($name,"Super_E5",0))}
# Tankstelle Star Zeithstraße
define TS.Station.Zeit HTTPMOD https://creativecommons.tankerkoenig.de/json/detail.php?id=005056ba-7cb6-1ed2-bceb-87412ca64d30&apikey=aaaaa 900
attr TS.Station.Zeit userattr event-min-interval event-on-update-reading icon reading1Name reading1Regex reading2Name reading2Regex reading3Name reading3Regex requestHeader stateFormat timeout
attr TS.Station.Zeit alias Tankstelle Star Zeitstr
attr TS.Station.Zeit timeout 5
attr TS.Station.Zeit event-on-update-reading .*
attr TS.Station.Zeit group Spritpreise
attr TS.Station.Zeit icon car
attr TS.Station.Zeit reading1Name Diesel
attr TS.Station.Zeit reading1Regex diesel":([\d\.]+)
attr TS.Station.Zeit reading2Name Super_E10
attr TS.Station.Zeit reading2Regex e10":([\d\.]+)
attr TS.Station.Zeit reading3Name Super_E5
attr TS.Station.Zeit reading3Regex e5":([\d\.]+)
attr TS.Station.Zeit requestHeader Content-Type: application/json
attr TS.Station.Zeit stateFormat {sprintf("Diesel %.3f €\n SuperE10 %.3f €\n SuperE5 %.3f €", ReadingsVal($name,"Diesel",0), ReadingsVal($name,"Super_E10",0), ReadingsVal($name,"Super_E5",0))}