Flow Details
Es können mittels dieses Flows die Pegelstände von verschiedenen Flüssen abgerufen werden. Die einzelnen Messstellen, können über den Link https://www.pegelonline.wsv.de/gast/karte/standard eingesehen werden.
Es wurde der Standort Bonn (Rhein) im Flow übernommen. Sollte ein anderer Standort gewünscht sein, muss die API angepasst werden. Siehe hierzu https://www.pegelonline.wsv.de/webservice/guideRestapi
Es werden Mittels der Icons die Wasserstände "hoch", "normal" und "niedrig" angezeigt.
Der Wasserstand wird alle 15 Minuten aktualisiert. Deshalb wird nach 16 Minuten eine erneute Abfrage angestoßen.
[
{
"id": "75c86965610cec38",
"type": "tab",
"label": "Wasserstand",
"disabled": false,
"info": "",
"env": []
},
{
"id": "63fe4b41fb20f487",
"type": "inject",
"z": "75c86965610cec38",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "960",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 270,
"y": 560,
"wires": [
[
"69ec04f4d7e9acd5"
]
]
},
{
"id": "69ec04f4d7e9acd5",
"type": "http request",
"z": "75c86965610cec38",
"name": "",
"method": "GET",
"ret": "obj",
"paytoqs": "ignore",
"url": "https://pegelonline.wsv.de/webservices/rest-api/v2/stations/593647aa-9fea-43ec-a7d6-6476a76ae868.json?includeTimeseries=true&includeCurrentMeasurement=true",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [],
"x": 510,
"y": 560,
"wires": [
[
"0d1b9f58ecc02697",
"d7dc14dc74f532c8"
]
]
},
{
"id": "0d1b9f58ecc02697",
"type": "debug",
"z": "75c86965610cec38",
"name": "Rohdaten",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 680,
"y": 480,
"wires": []
},
{
"id": "d7dc14dc74f532c8",
"type": "change",
"z": "75c86965610cec38",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.timeseries.0.currentMeasurement",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 790,
"y": 560,
"wires": [
[
"cb88182cd74acc02",
"940bd80e139dda23"
]
]
},
{
"id": "cb88182cd74acc02",
"type": "debug",
"z": "75c86965610cec38",
"name": "gefilterte Daten",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1000,
"y": 480,
"wires": []
},
{
"id": "940bd80e139dda23",
"type": "switch",
"z": "75c86965610cec38",
"name": "",
"property": "payload.stateMnwMhw",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "high",
"vt": "str"
},
{
"t": "eq",
"v": "normal",
"vt": "str"
},
{
"t": "eq",
"v": "low",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 3,
"x": 1030,
"y": 560,
"wires": [
[
"432478a5d580e9f2"
],
[
"6fbe7dda7465fec3"
],
[
"1a1bf1d5351fca3c"
]
]
},
{
"id": "432478a5d580e9f2",
"type": "function",
"z": "75c86965610cec38",
"name": "Wasser hoch",
"func": "var value = msg.payload.value;\n\nmsg.payload = {\n \"icon\": 24120,\n \"text\": value + \"cm\"\n };\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1270,
"y": 500,
"wires": [
[
"cfa82e623304d526",
"2a55018e025f6cc4"
]
]
},
{
"id": "6fbe7dda7465fec3",
"type": "function",
"z": "75c86965610cec38",
"name": "Wasser normal",
"func": "var value = msg.payload.value;\n\nmsg.payload = {\n \"icon\": 24117,\n \"text\": value + \"cm\"\n };\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1280,
"y": 560,
"wires": [
[
"cfa82e623304d526",
"2a55018e025f6cc4"
]
]
},
{
"id": "1a1bf1d5351fca3c",
"type": "function",
"z": "75c86965610cec38",
"name": "Wasser niedrig",
"func": "var value = msg.payload.value;\n\nmsg.payload = {\n \"icon\": 24115,\n \"text\": value + \"cm\"\n };\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1280,
"y": 620,
"wires": [
[
"cfa82e623304d526",
"2a55018e025f6cc4"
]
]
},
{
"id": "cfa82e623304d526",
"type": "http request",
"z": "75c86965610cec38",
"name": "AwtrixUlanzi/waterlevel",
"method": "POST",
"ret": "txt",
"paytoqs": "ignore",
"url": "http://192.168.178.112/api/custom?name=waterlevel",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [
{
"keyType": "Content-Type",
"keyValue": "",
"valueType": "other",
"valueValue": "application/json"
}
],
"x": 1660,
"y": 560,
"wires": [
[]
],
"icon": "font-awesome/fa-align-left"
},
{
"id": "2a55018e025f6cc4",
"type": "debug",
"z": "75c86965610cec38",
"name": "Ausgabe",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1620,
"y": 480,
"wires": []
}
]
-- Flow first published on June 28, 2024, last updated on June 28, 2024 at 07:51.