Skip to content

Instantly share code, notes, and snippets.

@ethanpierce
Created August 6, 2019 06:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ethanpierce/96851e9b60835d4763f0f47adcbbca50 to your computer and use it in GitHub Desktop.
Save ethanpierce/96851e9b60835d4763f0f47adcbbca50 to your computer and use it in GitHub Desktop.
Rules Engine List events
[
{
"id": "b69a84fc.80a2b8",
"type": "subflow",
"name": "Log Error (3)",
"info": "This sub flow will log an error to the ManageDevices FileMaker applicaiton on the solarsync.io FileMaker Server.",
"category": "Error Handling",
"in": [
{
"x": 60,
"y": 40,
"wires": [
{
"id": "917c47b5.69f9a8"
},
{
"id": "83351100.c6e2a"
}
]
}
],
"out": [
{
"x": 360,
"y": 40,
"wires": [
{
"id": "b69a84fc.80a2b8",
"port": 0
}
]
}
]
},
{
"id": "4dab9f24.ac3f48",
"type": "catch",
"z": "b69a84fc.80a2b8",
"name": "Catch Error Logging Issue",
"scope": [
"65c61488.62202c",
"9adeb8e3.5b0c68",
"56132c65.8cb284"
],
"x": 270,
"y": 140,
"wires": [
[
"917c47b5.69f9a8"
]
]
},
{
"id": "56132c65.8cb284",
"type": "dapi-create-record",
"z": "b69a84fc.80a2b8",
"name": "Create Error Log Entry",
"client": "",
"layout": "Log API",
"layoutType": "str",
"data": "error",
"dataType": "msg",
"scripts": "",
"scriptsType": "none",
"merge": "false",
"mergeType": "bool",
"output": "payload",
"x": 720,
"y": 40,
"wires": [
[]
]
},
{
"id": "9adeb8e3.5b0c68",
"type": "function",
"z": "b69a84fc.80a2b8",
"name": "Create Error Log",
"func": "msg.error = {\n error: msg.error,\n payload: msg.payload\n}\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 500,
"y": 40,
"wires": [
[
"56132c65.8cb284"
]
]
},
{
"id": "917c47b5.69f9a8",
"type": "function",
"z": "b69a84fc.80a2b8",
"name": "Send Error Message",
"func": "msg.payload = msg.error.message\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 520,
"y": 100,
"wires": [
[
"8568b987.2612a"
]
]
},
{
"id": "8568b987.2612a",
"type": "debug",
"z": "b69a84fc.80a2b8",
"name": "Log Error",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"x": 769.5,
"y": 100,
"wires": []
},
{
"id": "83351100.c6e2a",
"type": "debug",
"z": "b69a84fc.80a2b8",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"x": 540,
"y": 280,
"wires": []
},
{
"id": "ce7cfc36.5599d8",
"type": "tab",
"label": "List IOT Devices",
"disabled": false,
"info": ""
},
{
"id": "8c4ece24.a8122",
"type": "split",
"z": "ce7cfc36.5599d8",
"name": "",
"splt": "\\n",
"spltType": "str",
"arraySplt": 1,
"arraySpltType": "len",
"stream": false,
"addname": "",
"x": 870,
"y": 160,
"wires": [
[
"afbc02a5.45de78"
]
]
},
{
"id": "d7f24998.15a0d",
"type": "dapi-create-record",
"z": "ce7cfc36.5599d8",
"name": "",
"client": "",
"layout": "layout",
"layoutType": "msg",
"data": "payload",
"dataType": "msg",
"scripts": "",
"scriptsType": "none",
"merge": "false",
"mergeType": "bool",
"output": "payload.created",
"x": 1260,
"y": 160,
"wires": [
[
"44ae283e.ae1058"
]
]
},
{
"id": "afbc02a5.45de78",
"type": "change",
"z": "ce7cfc36.5599d8",
"name": "",
"rules": [
{
"t": "set",
"p": "layout",
"pt": "msg",
"to": "Device API",
"tot": "str"
},
{
"t": "set",
"p": "payload.coreid",
"pt": "msg",
"to": "payload.id",
"tot": "msg"
},
{
"t": "delete",
"p": "payload.id",
"pt": "msg"
},
{
"t": "set",
"p": "query",
"pt": "msg",
"to": "{}",
"tot": "json"
},
{
"t": "set",
"p": "query.coreid",
"pt": "msg",
"to": "payload.coreid",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1040,
"y": 160,
"wires": [
[
"d7f24998.15a0d"
]
]
},
{
"id": "c56e7961.9b0248",
"type": "catch",
"z": "ce7cfc36.5599d8",
"name": "",
"scope": null,
"x": 100,
"y": 260,
"wires": [
[
"8e3d57b4.1222b8"
]
]
},
{
"id": "54e758b4.556758",
"type": "http in",
"z": "ce7cfc36.5599d8",
"name": "",
"url": "/devices",
"method": "get",
"upload": false,
"swaggerDoc": "",
"x": 110,
"y": 160,
"wires": [
[
"840a0bf4.294b18"
]
]
},
{
"id": "23daee52.9fe0ba",
"type": "http response",
"z": "ce7cfc36.5599d8",
"name": "",
"statusCode": "",
"headers": {},
"x": 1930,
"y": 160,
"wires": []
},
{
"id": "44ae283e.ae1058",
"type": "join",
"z": "ce7cfc36.5599d8",
"name": "",
"mode": "auto",
"build": "string",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": "false",
"timeout": "",
"count": "",
"reduceRight": false,
"x": 1435,
"y": 160,
"wires": [
[
"95ffe1f.59e3d2"
]
]
},
{
"id": "95ffe1f.59e3d2",
"type": "switch",
"z": "ce7cfc36.5599d8",
"name": "",
"property": "res",
"propertyType": "flow",
"rules": [
{
"t": "nempty"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 1575,
"y": 160,
"wires": [
[
"384a8b33.3b2f2c"
],
[]
]
},
{
"id": "771c1a22.44e8cc",
"type": "change",
"z": "ce7cfc36.5599d8",
"name": "",
"rules": [
{
"t": "set",
"p": "res",
"pt": "flow",
"to": "res",
"tot": "msg"
},
{
"t": "set",
"p": "req",
"pt": "flow",
"to": "req",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 500,
"y": 160,
"wires": [
[
"98f502c9.a841"
]
]
},
{
"id": "384a8b33.3b2f2c",
"type": "change",
"z": "ce7cfc36.5599d8",
"name": "Populate Request",
"rules": [
{
"t": "set",
"p": "req",
"pt": "msg",
"to": "req",
"tot": "flow"
},
{
"t": "set",
"p": "res",
"pt": "msg",
"to": "res",
"tot": "flow"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1750,
"y": 160,
"wires": [
[
"23daee52.9fe0ba"
]
]
},
{
"id": "8e3d57b4.1222b8",
"type": "subflow:b69a84fc.80a2b8",
"z": "ce7cfc36.5599d8",
"name": "",
"x": 1400,
"y": 260,
"wires": [
[
"959c722.e70329"
]
]
},
{
"id": "16de32.9b2a81ce",
"type": "http response",
"z": "ce7cfc36.5599d8",
"name": "",
"statusCode": "",
"headers": {},
"x": 2470,
"y": 260,
"wires": []
},
{
"id": "98f502c9.a841",
"type": "particle-api",
"z": "ce7cfc36.5599d8",
"name": "",
"auth": "",
"method": "get",
"url": "v1/devices",
"x": 700,
"y": 160,
"wires": [
[
"8c4ece24.a8122"
]
]
},
{
"id": "22ba57ce.829208",
"type": "change",
"z": "ce7cfc36.5599d8",
"name": "",
"rules": [
{
"t": "set",
"p": "sent",
"pt": "flow",
"to": "true",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 2270,
"y": 260,
"wires": [
[
"16de32.9b2a81ce"
]
]
},
{
"id": "959c722.e70329",
"type": "switch",
"z": "ce7cfc36.5599d8",
"name": "",
"property": "sent",
"propertyType": "flow",
"rules": [
{
"t": "false"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 2090,
"y": 260,
"wires": [
[
"22ba57ce.829208"
]
]
},
{
"id": "840a0bf4.294b18",
"type": "change",
"z": "ce7cfc36.5599d8",
"name": "",
"rules": [
{
"t": "set",
"p": "sent",
"pt": "flow",
"to": "false",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 310,
"y": 160,
"wires": [
[
"771c1a22.44e8cc"
]
]
},
{
"id": "e5b5ba1e.c363d8",
"type": "inject",
"z": "ce7cfc36.5599d8",
"name": "",
"topic": "",
"payload": "{}",
"payloadType": "json",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 270,
"y": 360,
"wires": [
[
"9762e080.14a2f"
]
]
},
{
"id": "8a7d84a6.4a48a8",
"type": "debug",
"z": "ce7cfc36.5599d8",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"x": 610,
"y": 360,
"wires": []
},
{
"id": "9762e080.14a2f",
"type": "dapi-list-records",
"z": "ce7cfc36.5599d8",
"name": "",
"client": "",
"layout": "People API",
"layoutType": "str",
"limit": "",
"limitType": "num",
"offset": "",
"offsetType": "num",
"sort": "",
"sortType": "none",
"scripts": "",
"scriptsType": "none",
"portals": "",
"portalsType": "none",
"output": "payload",
"x": 440,
"y": 360,
"wires": [
[
"8a7d84a6.4a48a8"
]
]
},
{
"id": "4bc80c8e.698c9c",
"type": "http request",
"z": "ce7cfc36.5599d8",
"name": "",
"method": "GET",
"ret": "txt",
"url": "https://www.whatsmyua.info/api/v1/ua",
"tls": "",
"x": 370,
"y": 640,
"wires": [
[
"7a8ff83a.cc541"
]
]
},
{
"id": "5de5cdf7.34888c",
"type": "inject",
"z": "ce7cfc36.5599d8",
"name": "",
"topic": "",
"payload": "{}",
"payloadType": "json",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 210,
"y": 640,
"wires": [
[
"4bc80c8e.698c9c"
]
]
},
{
"id": "7a8ff83a.cc541",
"type": "debug",
"z": "ce7cfc36.5599d8",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"x": 530,
"y": 640,
"wires": []
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment