[ { "id": "db136c5d713d3cd0", "type": "inject", "z": "6eb5c526e737cb21", "name": "Trigger", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 210, "y": 1500, "wires": [["5f41ce33e1d008a9"]] }, { "id": "4948edd4b85e148f", "type": "inject", "z": "6eb5c526e737cb21", "name": "zadd 1", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "[\"device:96a4:1a87:04\", 1, \"{\\\"test\\\":1,\\\"hello\\\":\\\"world1\\\", \\\"hexstr\\\": \\\"000102\\\"}\"]", "payloadType": "json", "x": 210, "y": 1680, "wires": [["f9ccc3e1983f8ec7"]] }, { "id": "89734db2e2b504d9", "type": "inject", "z": "6eb5c526e737cb21", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 220, "y": 1880, "wires": [["ad21bea98339b79e"]] }, { "id": "5f41ce33e1d008a9", "type": "redis-lua-script", "z": "6eb5c526e737cb21", "server": "08ae710220cd5170", "name": "redis lua: hello world", "keyval": 0, "func": "\nreturn \"hello world\"", "stored": false, "block": false, "x": 600, "y": 1500, "wires": [["44f2c4e99a1e521d"]] }, { "id": "44f2c4e99a1e521d", "type": "debug", "z": "6eb5c526e737cb21", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 870, "y": 1820, "wires": [] }, { "id": "29035e2612073aa9", "type": "redis-lua-script", "z": "6eb5c526e737cb21", "server": "08ae710220cd5170", "name": "redis lua: ping pong", "keyval": 0, "func": "local foo = redis.call('ping')\nreturn foo", "stored": false, "block": false, "x": 590, "y": 1560, "wires": [["44f2c4e99a1e521d"]] }, { "id": "b9f91d2f3fceb024", "type": "redis-lua-script", "z": "6eb5c526e737cb21", "server": "08ae710220cd5170", "name": "redis lua: set", "keyval": "1", "func": "local foo = redis.call('SET', KEYS[1], ARGV[1])\nreturn foo", "stored": false, "block": false, "x": 570, "y": 1620, "wires": [["44f2c4e99a1e521d"]] }, { "id": "cfb9a1d9d6235c96", "type": "inject", "z": "6eb5c526e737cb21", "name": "Set key value", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "[\"key\", \"value\"]", "payloadType": "json", "x": 230, "y": 1620, "wires": [["b9f91d2f3fceb024"]] }, { "id": "f9ccc3e1983f8ec7", "type": "redis-lua-script", "z": "6eb5c526e737cb21", "server": "08ae710220cd5170", "name": "redis lua: zadd", "keyval": "1", "func": "local foo = redis.call('ZADD', KEYS[1], ARGV[1], ARGV[2])\nreturn foo", "stored": false, "block": false, "x": 580, "y": 1680, "wires": [["44f2c4e99a1e521d"]] }, { "id": "75a5d81a80da3959", "type": "inject", "z": "6eb5c526e737cb21", "name": "zadd 2", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "[\"device:96a4:1a87:04\", 2, \"{\\\"test\\\":2,\\\"hello\\\":\\\"world2\\\", \\\"hexstr\\\": \\\"030405\\\"}\"]", "payloadType": "json", "x": 210, "y": 1720, "wires": [["f9ccc3e1983f8ec7"]] }, { "id": "c32955b956a9c79a", "type": "redis-lua-script", "z": "6eb5c526e737cb21", "server": "08ae710220cd5170", "name": "redis lua: cjson decode", "keyval": "1", "func": "local foo = cjson.decode(ARGV[2])\n\nreturn foo.test", "stored": false, "block": false, "x": 600, "y": 1820, "wires": [["44f2c4e99a1e521d"]] }, { "id": "84bd8bb2222e0517", "type": "inject", "z": "6eb5c526e737cb21", "name": "cjson", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "[\"device:96a4:1a87:04\", 3, \"{\\\"test\\\":3,\\\"hello\\\":\\\"world3\\\", \\\"hexstr\\\": \\\"060708\\\"}\"]", "payloadType": "json", "x": 210, "y": 1820, "wires": [["c32955b956a9c79a"]] }, { "id": "8d8b9d844348773c", "type": "inject", "z": "6eb5c526e737cb21", "name": "Trigger", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 210, "y": 1560, "wires": [["29035e2612073aa9"]] }, { "id": "15959eedb0e32c26", "type": "redis-lua-script", "z": "6eb5c526e737cb21", "server": "08ae710220cd5170", "name": "redis lua: substring", "keyval": "1", "func": "local foo = tonumber(string.sub(KEYS[1], -2, -1))\n\nreturn foo", "stored": false, "block": false, "x": 590, "y": 1940, "wires": [["44f2c4e99a1e521d"]] }, { "id": "b66f5d8e92e9fbbf", "type": "inject", "z": "6eb5c526e737cb21", "name": "substring", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "[\"device:96a4:1a87:04\", 3, \"{\\\"test\\\":3,\\\"hello\\\":\\\"world3\\\", \\\"hexstr\\\": \\\"060708\\\"}\"]", "payloadType": "json", "x": 220, "y": 1940, "wires": [["15959eedb0e32c26"]] }, { "id": "2a7fac1573b38b98", "type": "inject", "z": "6eb5c526e737cb21", "name": "zadd 3", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "[\"device:96a4:1a87:04\", 3, \"{\\\"test\\\":3,\\\"hello\\\":\\\"world3\\\", \\\"hexstr\\\": \\\"060708\\\"}\"]", "payloadType": "json", "x": 210, "y": 1760, "wires": [["f9ccc3e1983f8ec7"]] }, { "id": "ad21bea98339b79e", "type": "redis-lua-script", "z": "6eb5c526e737cb21", "server": "08ae710220cd5170", "name": "redis lua: cjson encode", "keyval": "0", "func": "local foo = {}\n\nfoo.field1 = 1\nfoo.field2 = \"hello world\"\nfoo.field3 = {}\nfoo.field3.name = \"paul\"\n\nreturn cjson.encode(foo)", "stored": false, "block": false, "x": 600, "y": 1880, "wires": [["41d9477be860b123"]] }, { "id": "41d9477be860b123", "type": "json", "z": "6eb5c526e737cb21", "name": "", "property": "payload", "action": "", "pretty": false, "x": 790, "y": 1880, "wires": [["44f2c4e99a1e521d"]] }, { "id": "b6378268209d3f41", "type": "redis-lua-script", "z": "6eb5c526e737cb21", "server": "08ae710220cd5170", "name": "redis lua: zcount", "keyval": "1", "func": "local elementCount = redis.call('ZCOUNT', KEYS[1], \"-inf\", \"+inf\")\n\nreturn elementCount", "stored": false, "block": false, "x": 580, "y": 2000, "wires": [["44f2c4e99a1e521d"]] }, { "id": "1efddadd63d15077", "type": "inject", "z": "6eb5c526e737cb21", "name": "zcount", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "[\"device:96a4:1a87:04\", 4, \"{\\\"test\\\":4,\\\"hello\\\":\\\"world4\\\", \\\"hexstr\\\": \\\"090a0b\\\"}\"]", "payloadType": "json", "x": 210, "y": 2000, "wires": [["b6378268209d3f41"]] }, { "id": "e49699a6dde3b6de", "type": "redis-lua-script", "z": "6eb5c526e737cb21", "server": "08ae710220cd5170", "name": "redis lua: zrange", "keyval": "1", "func": "local elementCount = redis.call('ZRANGE', KEYS[1], 0, 3)\n\nreturn elementCount", "stored": false, "block": false, "x": 580, "y": 2060, "wires": [["44f2c4e99a1e521d"]] }, { "id": "5da7c2d8aea3b596", "type": "inject", "z": "6eb5c526e737cb21", "name": "zrange", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "[\"device:96a4:1a87:04\", 4, \"{\\\"test\\\":4,\\\"hello\\\":\\\"world4\\\", \\\"hexstr\\\": \\\"090a0b\\\"}\"]", "payloadType": "json", "x": 210, "y": 2060, "wires": [["e49699a6dde3b6de"]] }, { "id": "e9aa29233106c2c8", "type": "inject", "z": "6eb5c526e737cb21", "name": "concat", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "[\"device:96a4:1a87:04\", 4, \"{\\\"test\\\":4,\\\"hello\\\":\\\"world4\\\", \\\"hexstr\\\": \\\"090a0b\\\"}\"]", "payloadType": "json", "x": 210, "y": 2120, "wires": [["f513666fe9a2c2ca"]] }, { "id": "f513666fe9a2c2ca", "type": "redis-lua-script", "z": "6eb5c526e737cb21", "server": "08ae710220cd5170", "name": "redis lua: complex", "keyval": "1", "func": "local response = \"\"\nlocal elementCount = redis.call('ZRANGE', KEYS[1], 0, 3)\n\nfor i=1,3,1\ndo\n response = response .. cjson.decode(elementCount[i]).hexstr\nend\n\nreturn response", "stored": false, "block": false, "x": 590, "y": 2120, "wires": [["44f2c4e99a1e521d"]] }, { "id": "08ae710220cd5170", "type": "redis-config", "name": "Local", "options": "{}", "cluster": false, "optionsType": "json" }, { "id": "d91c2cfe5d0efc36", "type": "global-config", "env": [], "modules": { "node-red-contrib-redis": "2.0.0" } } ]