awetrix-apps/flows.json

193 lines
5.1 KiB
JSON
Raw Normal View History

2025-02-12 23:28:10 +01:00
[
{
"id": "40aabaff57950a4d",
"type": "tab",
"label": "Fritzbox Data",
"disabled": false,
"info": "",
"env": []
},
{
"id": "ad11af5d5835415a",
"type": "fritzbox-config",
"name": "MKBOX",
"host": "192.168.200.1",
"port": 49000,
"ssl": false,
"user": "nodered"
},
{
"id": "156c0331c926b697",
"type": "fritzbox-in",
"z": "40aabaff57950a4d",
"device": "ad11af5d5835415a",
"name": "MKBOX Speed",
"service": "urn:dslforum-org:service:WANDSLInterfaceConfig:1",
"action": "GetInfo",
"arguments": "{}",
"x": 360,
"y": 260,
"wires": [
[
2025-02-13 21:09:13 +01:00
"103202b0b37a8b04",
"ec93c31d21242a8a"
2025-02-12 23:28:10 +01:00
]
]
},
{
"id": "4b7a4e388591e90b",
"type": "inject",
"z": "40aabaff57950a4d",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 120,
"y": 260,
"wires": [
[
"156c0331c926b697",
"566257d96f364db1"
]
]
},
{
"id": "103202b0b37a8b04",
"type": "debug",
"z": "40aabaff57950a4d",
"name": "DSL SPEEDINFO",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 610,
"y": 260,
"wires": []
},
{
"id": "566257d96f364db1",
"type": "fritzbox-in",
"z": "40aabaff57950a4d",
"device": "ad11af5d5835415a",
"name": "MKBOX Connection",
"service": "urn:schemas-upnp-org:service:WANIPConnection:1",
"action": "GetStatusInfo",
"arguments": "{}",
"x": 380,
"y": 340,
"wires": [
[
2025-02-13 21:21:52 +01:00
"1069bff298293e62",
"edbaa0fd072ec5af"
2025-02-12 23:28:10 +01:00
]
]
},
{
"id": "1069bff298293e62",
"type": "debug",
"z": "40aabaff57950a4d",
"name": "DSL Connection Info",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 620,
"y": 340,
"wires": []
2025-02-13 21:09:13 +01:00
},
{
"id": "ec93c31d21242a8a",
"type": "function",
"z": "40aabaff57950a4d",
2025-02-13 21:21:52 +01:00
"name": "extract/store speeds",
"func": "var oldmsg = msg\nvar new_payload = {}\nmsg.topic = \"fbspeed\"\n\n// Gettin Values from Payload\nvar upstream = oldmsg.payload.NewUpstreamMaxRate\nvar downstream = oldmsg.payload.NewDownstreamCurrRate\n\n// Store values globally\nglobal.set(\"upstream\", upstream);\nglobal.set(\"downstream\", downstream);\n\n// generate new payload\nnew_payload.upstream = upstream\nnew_payload.downstream = downstream\nmsg.payload = new_payload\n\nreturn msg\n",
2025-02-13 21:09:13 +01:00
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 620,
"y": 160,
"wires": [
[
"5975b0134a7c406e"
]
]
},
{
"id": "5975b0134a7c406e",
"type": "debug",
"z": "40aabaff57950a4d",
2025-02-13 21:21:52 +01:00
"name": "mqtt speeds",
2025-02-13 21:09:13 +01:00
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 830,
"y": 160,
"wires": []
2025-02-13 21:21:52 +01:00
},
{
"id": "edbaa0fd072ec5af",
"type": "function",
"z": "40aabaff57950a4d",
"name": "build Uptime",
"func": "var oldmsg = msg\nvar new_payload = {}\nmsg.topic = \"uptime\"\n\n// parse Uptime\nnew_payload.uptime = new Date(parseInt(msg.payload.NewUptime) * 1000).toISOString().slice(11, 19);\n\n\n// generate new payload\nmsg.payload = new_payload\n\nreturn msg\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 590,
"y": 400,
"wires": [
[
"5b264dfa75365ea1"
]
]
},
{
"id": "5b264dfa75365ea1",
"type": "debug",
"z": "40aabaff57950a4d",
"name": "mqtt uptime",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 810,
"y": 400,
"wires": []
2025-02-12 23:28:10 +01:00
}
]