Skip to content

Instantly share code, notes, and snippets.

@jonathanschneider
Created September 11, 2021 20: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 jonathanschneider/99d24e0cbc336ca1cd53a8de4919fa44 to your computer and use it in GitHub Desktop.
Save jonathanschneider/99d24e0cbc336ca1cd53a8de4919fa44 to your computer and use it in GitHub Desktop.
Node-RED flow to send data from iSpindel to Brewfather and BierBot Bricks
[
{
"id": "9327b347.7fd9e",
"type": "tab",
"label": "iSpindel",
"disabled": false,
"info": ""
},
{
"id": "70580097.7895f",
"type": "http in",
"z": "9327b347.7fd9e",
"name": "iSpindel",
"url": "/ispindel",
"method": "post",
"upload": false,
"swaggerDoc": "",
"x": 140,
"y": 80,
"wires": [
[
"9a2b67e7.cb01b",
"ea510202.28179",
"706f9baf.4b3eac",
"3beec238.e9822e"
]
]
},
{
"id": "dcf00811.1f3d7",
"type": "debug",
"z": "9327b347.7fd9e",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 750,
"y": 220,
"wires": []
},
{
"id": "ea510202.28179",
"type": "http request",
"z": "9327b347.7fd9e",
"name": "Brewfather",
"method": "POST",
"ret": "txt",
"paytoqs": "body",
"url": "log.brewfather.net/ispindel?id=<token>",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"x": 390,
"y": 220,
"wires": [
[
"dcf00811.1f3d7"
]
]
},
{
"id": "9a2b67e7.cb01b",
"type": "http response",
"z": "9327b347.7fd9e",
"name": "Response",
"statusCode": "200",
"headers": {},
"x": 380,
"y": 80,
"wires": []
},
{
"id": "4369aae6.e94a94",
"type": "http request",
"z": "9327b347.7fd9e",
"name": "BierBot Bricks",
"method": "POST",
"ret": "txt",
"paytoqs": "ignore",
"url": "https://brewbricks.com/api/iot/v1",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"x": 560,
"y": 320,
"wires": [
[
"6c31f8d1.fceb58"
]
]
},
{
"id": "3beec238.e9822e",
"type": "function",
"z": "9327b347.7fd9e",
"name": "Format",
"func": "msg.payload = {\n \"apikey\": \"<apikey>\",\n \"type\": \"ispindel\",\n \"brand\": \"wemos_d1_mini\",\n \"version\": \"7.1.0\",\n \"chipid\": 11111111,\n \"s_number_wort_0\": Math.round(msg.payload.gravity * 10) / 10,\n \"s_number_temp_0\": Math.round(msg.payload.temperature * 10) / 10,\n \"s_number_voltage_0\": Math.round(msg.payload.battery * 100) / 100,\n \"s_number_wifi_0\": msg.payload.RSSI,\n \"s_number_tilt_0\": Math.round(msg.payload.angle * 100) / 100\n}\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 380,
"y": 320,
"wires": [
[
"4369aae6.e94a94"
]
]
},
{
"id": "6c31f8d1.fceb58",
"type": "debug",
"z": "9327b347.7fd9e",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 750,
"y": 320,
"wires": []
},
{
"id": "706f9baf.4b3eac",
"type": "debug",
"z": "9327b347.7fd9e",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 390,
"y": 120,
"wires": []
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment