EM 20 Gruppenphase

Begonnen von herrmannj, 07 Juni 2021, 23:56:53

Vorheriges Thema - Nächstes Thema

herrmannj

Hallo zusammen,

die EM 20 steht vor der Tür. Hier ein list um das mühsame Tabellenausfüllen in der Gruppenphase zu automatisieren. Ob die Endergebnisse eingetragen werden, wird sich nach den ersten Spielen zeigen :)

Die Daten werden von openligadb gepflegt. Das ist ebenfalls ein Community Projekt -> beste Grüße dorthin!

Hier Gruppe F:

Internals:
   API_LAST_MSG 200
   API_LAST_RES 1623104134.59334
   CFGFN     
   DEF        https://www.openligadb.de/api/getmatchdata/em20/2020
   FUUID      60be950a-f33f-aa36-17d9-9c0f11c41ec62fde
   NAME       Gruppe_F
   NEXT       2021-06-11 01:00:00
   NR         197
   SOURCE     https://www.openligadb.de/api/getmatchdata/em20/2020 (200)
   STATE      ???
   SVN        24420 2021-05-11 21:25:20 UTC
   TYPE       JsonMod
   CONFIG:
     IN_REQUEST 0
     SOURCE     https://www.openligadb.de/api/getmatchdata/em20/2020
     SECRET:
   READINGS:
     2021-06-08 00:15:34   2021-06-15_1800_Budapest Ungarn : Portugal (?:?)
     2021-06-08 00:15:34   2021-06-15_2100_Muenchen Frankreich : Deutschland (?:?)
     2021-06-08 00:15:34   2021-06-19_1500_Budapest Ungarn : Frankreich (?:?)
     2021-06-08 00:15:34   2021-06-19_1800_Muenchen Portugal : Deutschland (?:?)
     2021-06-08 00:15:34   2021-06-23_2100_Budapest Portugal : Frankreich (?:?)
     2021-06-08 00:15:34   2021-06-23_2100_Muenchen Deutschland : Ungarn (?:?)
Attributes:
   interval   0 * 11-23 6 *
   readingList multi(jsonPath(q/$[?(@.Team1.TeamGroupName == 'Gruppe F')]/), sprintf('%s %s %s', substr(property('MatchDateTime'), 0, 10), substr(property('MatchDateTime'), 11, 5), property('Location.LocationCity')), sprintf('%s : %s %s%s', property('Team1.TeamName'), property('Team2.TeamName'), propertyf(q/MatchResults[?(@.ResultName == 'Endergebnis')].PointsTeam1/,'?', '(%s:'), propertyf(q/MatchResults[?(@.ResultName == 'Endergebnis')].PointsTeam2/,'?', '%s)')));

herrmannj

Update nach dem ersten Spiel. Die Tore erfassen die anders als in der BL, daher leicht modifiziert und läuft.

Def:
define Gruppe_A JsonMod https://www.openligadb.de/api/getmatchdata/em20/2020\

attr Gruppe_A interval 0 * 11-23 6 *
attr Gruppe_A readingList multi(jsonPath(q/$[?(@.Team1.TeamGroupName == 'Gruppe A')]/), sprintf('%s %s %s', substr(property('MatchDateTime'), 0, 10), substr(property('MatchDateTime'), 11, 5), property('Location.LocationCity')), sprintf('%s : %s %s%s', property('Team1.TeamName'), property('Team2.TeamName'), propertyf('MatchResults[0].PointsTeam1','?', '(%s:'), propertyf('MatchResults[0].PointsTeam2','?', '%s)')));;


ergibt:
setstate Gruppe_A 2021-06-11 23:12:37 2021-06-11_2100_Rom Türkei : Italien (0:3)
setstate Gruppe_A 2021-06-11 23:12:37 2021-06-12_1500_Baku Wales : Schweiz (?:?)
setstate Gruppe_A 2021-06-11 23:12:37 2021-06-16_1800_Baku Türkei : Wales (?:?)
setstate Gruppe_A 2021-06-11 23:12:37 2021-06-16_2100_Rom Italien : Schweiz (?:?)
setstate Gruppe_A 2021-06-11 23:12:37 2021-06-20_1800_Baku Schweiz : Türkei (?:?)
setstate Gruppe_A 2021-06-11 23:12:37 2021-06-20_1800_Rom Italien : Wales (?:?)


Passt. Mal schauen wie das dann mit Verlängerung und co aussieht, ich rate mal dass das auch an Pos0 der Liste stehen würde ..

Hier das Turnier gesammelt:
define em20 JsonMod https://www.openligadb.de/api/getmatchdata/em20/2020
attr em20 event-on-change-reading .*
attr em20 interval 0 * 11-23 6 *
attr em20 readingList multi(jsonPath('$.*'), sprintf('%s %s %s %s', substr(property('MatchDateTime'), 0, 10), substr(property('MatchDateTime'), 11, 5), property('Location.LocationCity'), property('Team1.TeamGroupName')), sprintf('%s : %s %s%s', property('Team1.TeamName'), property('Team2.TeamName'), propertyf('MatchResults[0].PointsTeam1','?', '(%s:'), propertyf('MatchResults[0].PointsTeam2','?', '%s)')));;

NewbieNew

Moin,
ist ja Klasse. Dankeschön dafür.

Könnte man die Ergebnisse auch per Telegram versenden? Wenn Ja, wie?

Besten Dank.

caldir65

Zitat von: herrmannj am 11 Juni 2021, 23:24:30

Passt. Mal schauen wie das dann mit Verlängerung und co aussieht, ich rate mal dass das auch an Pos0 der Liste stehen würde ..


Moin,

11-Meter-Schießen werden anscheinend nicht abgebildet ...

Gruß, Christoph
Alte Techniker-Regel: "kaum macht man es richtig, funktioniert es auch"
------
Dell Wyse5070 ThinClient 16GBRam, 64GB SSD, Lubuntu 22.04LTS, fhem (aktuell), debmatic, Homematic-Devs, ConBee II und deConz, viele Shellys, Rademacher, NextCloud-Anbindung, FullyKioskBrowser+FUIP uvm.

herrmannj

war ein echt geiles Speil. :) Schau mal in die quelle wie das da drinsteht

caldir65

Puh - da blicke ich dann nicht mehr durch  :o Ein langes Spahgetti  ;D
Alte Techniker-Regel: "kaum macht man es richtig, funktioniert es auch"
------
Dell Wyse5070 ThinClient 16GBRam, 64GB SSD, Lubuntu 22.04LTS, fhem (aktuell), debmatic, Homematic-Devs, ConBee II und deConz, viele Shellys, Rademacher, NextCloud-Anbindung, FullyKioskBrowser+FUIP uvm.