//////////////////////////////////////////////////////////////////////////////// // UDP Logger Ambient // 各種ESP8266/ESP32用センサから受信したデータをAmbientへ送信するサンプルです。 // // ・Ambientノードをダブルクリックし、Channel Id とWrite Keyを入力してください。 // ・grep_deviceノードの matches regex欄へデバイス名を設定して下さい。 // // https://blogs.yahoo.co.jp/bokunimowakaru/56073151.html // // Copyright (c) 2018 Wataru KUNINO //////////////////////////////////////////////////////////////////////////////// // // Node-RED用 UDP Logger Example JSON形式 // コメント行は転送時に自動削除されます // [ { "id": "a791cdc3.c11068", "type": "udp in", "z": "66521955.61496c", "name": "", "iface": "", "port": "1024", "ipv": "udp4", "multicast": "false", "group": "", "datatype": "utf8", "x": 80, "y": 40, "wires": [ [ "bb81eab3.00d348" ] ] }, { "id": "af8683f0.e6f86", "type": "debug", "z": "66521955.61496c", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "x": 190, "y": 340, "wires": [] }, { "id": "bb81eab3.00d348", "type": "csv", "z": "66521955.61496c", "name": "", "sep": ",", "hdrin": "", "hdrout": "", "multi": "one", "ret": "\\n", "temp": "", "skip": "0", "x": 90, "y": 100, "wires": [ [ "8718198b.500c38" ] ] }, { "id": "8718198b.500c38", "type": "switch", "z": "66521955.61496c", "name": "grep_device", "property": "payload.col1", "propertyType": "msg", "rules": [ { "t": "regex", "v": "humid_1", "vt": "str", "case": false } ], "checkall": "true", "repair": false, "outputs": 1, "x": 130, "y": 160, "wires": [ [ "83bddc04.434ae" ] ] }, { "id": "756cba79.f0461", "type": "Ambient", "z": "66521955.61496c", "name": "", "channelId": "", "writeKey": "", "x": 380, "y": 300, "wires": [] }, { "id": "83bddc04.434ae", "type": "function", "z": "66521955.61496c", "name": "d(n):col(n+1)", "func": "return {\n payload:{\n \"d1\":msg.payload.col2,\n \"d2\":msg.payload.col3\n }\n}", "outputs": 1, "noerr": 0, "x": 150, "y": 220, "wires": [ [ "da1071c8.27f67" ] ] }, { "id": "da1071c8.27f67", "type": "delay", "z": "66521955.61496c", "name": "", "pauseType": "rate", "timeout": "5", "timeoutUnits": "seconds", "rate": "1", "nbRateUnits": "30", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": true, "x": 180, "y": 280, "wires": [ [ "756cba79.f0461", "af8683f0.e6f86" ] ] } ]