Bin jetzt eigentlich am Ziel.
Ich bin jetzt wieder auf die XML Variante direkt vom RMV gewechselt, aber erstmal bei node red geblieben. Das Ergebniss:
1446_node_red_rmv.png
[
{
"id": "c2e8a228.ce75a",
"type": "inject",
"z": "6214dd4e.ed2b74",
"name": "manueller Start",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 160,
"y": 200,
"wires": [
[
"9748880f.17aa98"
]
]
},
{
"id": "9b30d083.a4886",
"type": "xml",
"z": "6214dd4e.ed2b74",
"name": "XML -> Objects",
"property": "payload",
"attr": "",
"chr": "",
"x": 600,
"y": 200,
"wires": [
[
"5a537dae.e837a4",
"11667978.787987",
"956de415.5de428",
"c997de37.9d9bd",
"fa59f000.66649",
"7f6fef3e.45c23",
"2a81bd77.3b4fa2"
]
]
},
{
"id": "5a537dae.e837a4",
"type": "function",
"z": "6214dd4e.ed2b74",
"name": "Abfahrt 0",
"func": "msg.payload = msg.payload.ResC.SBRes[0].JourneyList[0].Journey[0].MainStop[0].BasicStop[0].Dep[0].Time\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 860,
"y": 60,
"wires": [
[
"2d94d037.f99f1"
]
]
},
{
"id": "11667978.787987",
"type": "function",
"z": "6214dd4e.ed2b74",
"name": "Abfahrt 1",
"func": "msg.payload = msg.payload.ResC.SBRes[0].JourneyList[0].Journey[1].MainStop[0].BasicStop[0].Dep[0].Time\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 860,
"y": 120,
"wires": [
[
"899471ca.19f5b"
]
]
},
{
"id": "956de415.5de428",
"type": "function",
"z": "6214dd4e.ed2b74",
"name": "Abfahrt 2",
"func": "msg.payload = msg.payload.ResC.SBRes[0].JourneyList[0].Journey[2].MainStop[0].BasicStop[0].Dep[0].Time\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 860,
"y": 180,
"wires": [
[
"b46de57a.c2c608"
]
]
},
{
"id": "9748880f.17aa98",
"type": "http request",
"z": "6214dd4e.ed2b74",
"name": "Abfrage RMV",
"method": "GET",
"ret": "txt",
"url": "https://www.rmv.de/auskunft/bin/jp/stboard.exe/dn?L=vs_anzeigetafel&cfgfile=FrankfurtM_3001501_2055304888&outputMode=xml&start=yes&output=xml&",
"tls": "",
"x": 360,
"y": 200,
"wires": [
[
"9b30d083.a4886"
]
]
},
{
"id": "2d94d037.f99f1",
"type": "ioBroker out",
"z": "6214dd4e.ed2b74",
"name": "Richtung Konstablerwache 0",
"topic": "javascript.0.RMV.Departure.Guenthersburgpark.to_Konstablerwache.Departure0",
"ack": "true",
"autoCreate": "false",
"x": 1200,
"y": 60,
"wires": []
},
{
"id": "899471ca.19f5b",
"type": "ioBroker out",
"z": "6214dd4e.ed2b74",
"name": "Richtung Konstablerwache 1",
"topic": "javascript.0.RMV.Departure.Guenthersburgpark.to_Konstablerwache.Departure1",
"ack": "true",
"autoCreate": "false",
"x": 1200,
"y": 120,
"wires": []
},
{
"id": "b46de57a.c2c608",
"type": "ioBroker out",
"z": "6214dd4e.ed2b74",
"name": "Richtung Konstablerwache 2",
"topic": "javascript.0.RMV.Departure.Guenthersburgpark.to_Konstablerwache.Departure2",
"ack": "true",
"autoCreate": "false",
"x": 1200,
"y": 180,
"wires": []
},
{
"id": "c997de37.9d9bd",
"type": "function",
"z": "6214dd4e.ed2b74",
"name": "Verspätung 0",
"func": "msg.payload = msg.payload.ResC.SBRes[0].JourneyList[0].Journey[0].MainStop[0].BasicStop[0].Dep[0].Delay\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 870,
"y": 240,
"wires": [
[
"639eab37.461804"
]
]
},
{
"id": "fa59f000.66649",
"type": "function",
"z": "6214dd4e.ed2b74",
"name": "Verspätung 1",
"func": "msg.payload = msg.payload.ResC.SBRes[0].JourneyList[0].Journey[1].MainStop[0].BasicStop[0].Dep[0].Delay\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 870,
"y": 300,
"wires": [
[
"929155a7.7af118"
]
]
},
{
"id": "7f6fef3e.45c23",
"type": "function",
"z": "6214dd4e.ed2b74",
"name": "Verspätung 2",
"func": "msg.payload = msg.payload.ResC.SBRes[0].JourneyList[0].Journey[2].MainStop[0].BasicStop[0].Dep[0].Delay\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 870,
"y": 360,
"wires": [
[
"e5362d2f.4c73e",
"c391efa6.a63cd"
]
]
},
{
"id": "639eab37.461804",
"type": "ioBroker out",
"z": "6214dd4e.ed2b74",
"name": "Richtung Konstablerwache Verspätung 0",
"topic": "javascript.0.RMV.Departure.Guenthersburgpark.to_Konstablerwache.Delay0",
"ack": "true",
"autoCreate": "false",
"x": 1240,
"y": 240,
"wires": []
},
{
"id": "929155a7.7af118",
"type": "ioBroker out",
"z": "6214dd4e.ed2b74",
"name": "Richtung Konstablerwache Verspätung 1",
"topic": "javascript.0.RMV.Departure.Guenthersburgpark.to_Konstablerwache.Delay1",
"ack": "true",
"autoCreate": "false",
"x": 1240,
"y": 300,
"wires": []
},
{
"id": "e5362d2f.4c73e",
"type": "ioBroker out",
"z": "6214dd4e.ed2b74",
"name": "Richtung Konstablerwache Verspätung 2",
"topic": "javascript.0.RMV.Departure.Guenthersburgpark.to_Konstablerwache.Delay2",
"ack": "true",
"autoCreate": "false",
"x": 1240,
"y": 360,
"wires": []
},
{
"id": "2a81bd77.3b4fa2",
"type": "debug",
"z": "6214dd4e.ed2b74",
"name": "alles als Objekte / Arrays",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"x": 910,
"y": 520,
"wires": []
},
{
"id": "c391efa6.a63cd",
"type": "debug",
"z": "6214dd4e.ed2b74",
"name": "nur Wert Verspätung 2",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"x": 1180,
"y": 520,
"wires": []
}
]
Funktioniert einwandfrei. Mal schauen ob ich noch Lust habe es als JavaScript zu versuchen…
Grüße,
Balu