snstac / stratuxcot

stratuxcot - Stratux Cursor on Target Gateway
Other
13 stars 4 forks source link

Put IP of stratux box into CoT remarks #16

Open ampledata opened 1 year ago

ampledata commented 1 year ago

A flow that does some of this:

[
    {
        "id": "917b3d0b3c724213",
        "type": "tab",
        "label": "Stratux Location to CoT Multicast",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "21ae4d38f567404f",
        "type": "http request",
        "z": "917b3d0b3c724213",
        "name": "",
        "method": "GET",
        "ret": "txt",
        "paytoqs": "ignore",
        "url": "http://192.168.10.1/getSituation",
        "tls": "",
        "persist": false,
        "proxy": "",
        "insecureHTTPParser": false,
        "authType": "",
        "senderr": false,
        "headers": [],
        "x": 230,
        "y": 300,
        "wires": [
            [
                "e31c76cff2b19d17"
            ]
        ]
    },
    {
        "id": "c1f2332116fd1115",
        "type": "inject",
        "z": "917b3d0b3c724213",
        "name": "start",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "50",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 110,
        "y": 260,
        "wires": [
            [
                "21ae4d38f567404f",
                "4a9fb8a2399235f2"
            ]
        ]
    },
    {
        "id": "e31c76cff2b19d17",
        "type": "json",
        "z": "917b3d0b3c724213",
        "name": "",
        "property": "payload",
        "action": "",
        "pretty": false,
        "x": 350,
        "y": 340,
        "wires": [
            [
                "2ea0a464477ad608"
            ]
        ]
    },
    {
        "id": "2ea0a464477ad608",
        "type": "function",
        "z": "917b3d0b3c724213",
        "name": "Stratux getSituation to CoT",
        "func": "{msg.payload = {\n    'event': {\n        '_attributes': {\n            'version': '2.0',\n            'time': new Date(Date.now()).toISOString(),\n            'start': new Date(Date.now()).toISOString(),\n            'stale': new Date(Date.now() + 60000).toISOString(),\n            'type': 'a-f-G-E-S-R',\n            'uid': 'REMOTE-STRATUX-1',\n            'how': 'm-r'\n        },   \n        'point': {\n            '_attributes': {\n                'lat': msg.payload.GPSLatitude,\n                'lon': msg.payload.GPSLongitude,\n                'hae': msg.payload.GPSHeightAboveEllipsoid*0.304,\n                'le': msg.payload.GPSVerticalAccuracy*0.304,\n                'ce': msg.payload.GPSHorizontalAccuracy*0.304,\n          }\n        }\n    }\n}}\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 520,
        "y": 380,
        "wires": [
            [
                "20524a6586ee9c1d"
            ]
        ]
    },
    {
        "id": "20524a6586ee9c1d",
        "type": "tak",
        "z": "917b3d0b3c724213",
        "name": "TAK",
        "x": 690,
        "y": 420,
        "wires": [
            [
                "079732cb73c2c9b6",
                "83bab1e8d17fdf67"
            ]
        ]
    },
    {
        "id": "079732cb73c2c9b6",
        "type": "udp out",
        "z": "917b3d0b3c724213",
        "name": "",
        "addr": "239.2.3.1",
        "iface": "",
        "port": "6969",
        "ipv": "udp4",
        "outport": "",
        "base64": false,
        "multicast": "false",
        "x": 830,
        "y": 460,
        "wires": []
    },
    {
        "id": "4a9fb8a2399235f2",
        "type": "ip",
        "z": "917b3d0b3c724213",
        "name": "ip",
        "https": false,
        "timeout": "5000",
        "internalIPv4": true,
        "internalIPv6": true,
        "publicIPv4": true,
        "publicIPv6": false,
        "x": 210,
        "y": 440,
        "wires": [
            []
        ]
    },
    {
        "id": "83bab1e8d17fdf67",
        "type": "debug",
        "z": "917b3d0b3c724213",
        "name": "debug 1",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 860,
        "y": 340,
        "wires": []
    }
]