98_DBPlan.pm: Fahrplaninformation der DB

Begonnen von JoWiemann, 08 April 2015, 18:57:14

Vorheriges Thema - Nächstes Thema

yersinia

#570
Ich schau auch gerade, was mit JsonMod geht, hab aber (nach zugegeben sehr kurzen Suche) noch keine weitere Doku zur Api gefunden.

Da mich (erst einmal nur ein) Richtungsgleis Interessiert (SBAHN), nutze ich diese readingsList:
multi(jsonPath("\$.entries.[?(\@.gleis in ['3'])]"), concat(sprintf('%02d', count()), "_Abfahrt_geplant"), substr(property('.zeit'), -8, 5));
multi(jsonPath("\$.entries.[?(\@.gleis in ['3'])]"), concat(sprintf('%02d', count()), "_Abfahrt_aktuell"), substr(property('.ezZeit'), -8, 5));
multi(jsonPath("\$.entries.[?(\@.gleis in ['3'])]"), concat(sprintf('%02d', count()), "_Verspaetung"), sprintf("%d",((time_str2num(property('.ezZeit'))-time_str2num(property('.zeit')))/60)));
multi(jsonPath("\$.entries.[?(\@.gleis in ['3'])]"), concat(sprintf('%02d', count()), "_Meldungen_0"), property('.meldungen.0.text'));
multi(jsonPath("\$.entries.[?(\@.gleis in ['3'])]"), concat(sprintf('%02d', count()), "_Meldungen_0_prio"), property('.meldungen.0.prioritaet'));
multi(jsonPath("\$.entries.[?(\@.gleis in ['3'])]"), concat(sprintf('%02d', count()), "_Meldungen_1"), property('.meldungen.1.text'));
multi(jsonPath("\$.entries.[?(\@.gleis in ['3'])]"), concat(sprintf('%02d', count()), "_Meldungen_1_prio"), property('.meldungen.1.prioritaet'));
multi(jsonPath("\$.entries.[?(\@.gleis in ['3'])]"), concat(sprintf('%02d', count()), "_Ziel"), property('.terminus'));
multi(jsonPath("\$.entries.[?(\@.gleis in ['3'])]"), concat(sprintf('%02d', count()), "_Verkehrmittel"), property('.verkehrmittel.name'));
Die Zwischenstationen (vias?) find ich unwichtig. Schön wäre noch die geplante und aktuelle Ankunftszeit zu erfahren. Analog zu DBPlan fehlt mir auch die Angabe des Zielbahnhofs.

Wenn du die meisten Parameter weglässt,
https://www.bahn.de/web/api/reiseloesung/abfahrten?ortExtId=8001033bekommst du alle Verkehrsmittel rund um die Station; ein naheliegender Busbahnhof/-Haltestelle erhält allerdings eine andere bahnhofsID.
viele Grüße, yersinia
----
FHEM 6.3 (SVN) on RPi 4B with RasPi OS Bookworm (perl 5.36.0) | FTUI
nanoCUL->2x868(1x ser2net)@tsculfw, 1x433@Sduino | MQTT2 | Tasmota | ESPEasy
VCCU->14xSEC-SCo, 7xCC-RT-DN, 5xLC-Bl1PBU-FM, 3xTC-IT-WM-W-EU, 1xPB-2-WM55, 1xLC-Sw1PBU-FM, 1xES-PMSw1-Pl

rico5588

Da ich auch gerade dabei bin das Rad neu zuerfinden...
meine erste Hürde war das finden der BahnhofsID. Im Anhang eine aktuelle Liste.
https://wiki.openstreetmap.org/w/images/c/c2/20141001_IBNR.pdf

Gruß
Rico
Geht nicht gibt's nicht.
NUC-I3+Proxmox, Fritzbox 7590 AX, Synology DS423+
Dimplex Wärmepumpe, Lüftungsanlage, Solarlog 1200
HM,IT,Lacross,EspEasy,Modbus,MQTT2, Freund von Shelly