Skip to content

Instantly share code, notes, and snippets.

@IT-Berater
Last active August 28, 2020 11:29
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 IT-Berater/12cc2910e662a61bd70b39df13dff2de to your computer and use it in GitHub Desktop.
Save IT-Berater/12cc2910e662a61bd70b39df13dff2de to your computer and use it in GitHub Desktop.
Carbon dioxide (CO2) Dashboard with NodeRed, MQTT, CSV and Pushover
[
{
"id": "1833a4d8.7d988b",
"type": "tab",
"label": "CO2",
"disabled": false,
"info": ""
},
{
"id": "440c9260.d72904",
"type": "debug",
"z": "1833a4d8.7d988b",
"name": "CSV Wert",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"x": 1100,
"y": 180,
"wires": []
},
{
"id": "f1bf2c63.d0b35",
"type": "mqtt in",
"z": "1833a4d8.7d988b",
"name": "MQTT empfang von CO2-Messungen",
"topic": "co2",
"qos": "2",
"datatype": "json",
"broker": "abc88836.28e918",
"x": 230,
"y": 180,
"wires": [
[
"f2b053c6.5cf198",
"bf02fb2b.712218",
"a793616a.80fb78"
]
]
},
{
"id": "2e52bc64.25350c",
"type": "file",
"z": "1833a4d8.7d988b",
"name": "In Datei co2.csv speichern",
"filename": "/home/openhabian/co2.csv",
"appendNewline": true,
"createDir": false,
"overwriteFile": "false",
"encoding": "none",
"x": 880,
"y": 180,
"wires": [
[
"440c9260.d72904"
]
]
},
{
"id": "f2b053c6.5cf198",
"type": "function",
"z": "1833a4d8.7d988b",
"name": "JSON to CSV Format erzeugen",
"func": "var nachricht=msg.payload.messung.satz[0].zeitpunkt + \n\",\" + \nmsg.payload.messung.satz[1].temperature + \n\",\" + \nmsg.payload.messung.satz[1].co2;\n\nmsg.payload = nachricht;\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 590,
"y": 180,
"wires": [
[
"2e52bc64.25350c"
]
]
},
{
"id": "d39df43.4b2c608",
"type": "comment",
"z": "1833a4d8.7d988b",
"name": "Schreibe CO2 und Temperarur Messung in eine CSV-Datei und ins Dashboard",
"info": "",
"x": 350,
"y": 100,
"wires": []
},
{
"id": "79fb268c.db9288",
"type": "comment",
"z": "1833a4d8.7d988b",
"name": "(c) 2020 Thomas Wenzlaff www.wenzlaff.info",
"info": "",
"x": 1030,
"y": 100,
"wires": []
},
{
"id": "78fdd64.d47e128",
"type": "ui_gauge",
"z": "1833a4d8.7d988b",
"name": "",
"group": "92ac457c.0b6e2",
"order": 1,
"width": 0,
"height": 0,
"gtype": "gage",
"title": "CO2",
"label": "ppm",
"format": "{{msg.payload | number:0}}",
"min": "0",
"max": "5000",
"colors": [
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1": "600",
"seg2": "1000",
"x": 790,
"y": 320,
"wires": []
},
{
"id": "bcbaa182.36835",
"type": "debug",
"z": "1833a4d8.7d988b",
"name": "CO2 Wert",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"x": 800,
"y": 260,
"wires": []
},
{
"id": "bf02fb2b.712218",
"type": "function",
"z": "1833a4d8.7d988b",
"name": "JSON to CO2",
"func": "msg.payload = msg.payload.messung.satz[1].co2\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 540,
"y": 320,
"wires": [
[
"78fdd64.d47e128",
"bcbaa182.36835",
"416f4723.a612f8",
"6acb5e0a.2ae6b"
]
]
},
{
"id": "416f4723.a612f8",
"type": "ui_chart",
"z": "1833a4d8.7d988b",
"name": "",
"group": "92ac457c.0b6e2",
"order": 2,
"width": 0,
"height": 0,
"label": "Trend",
"chartType": "line",
"legend": "false",
"xformat": "dd HH:mm",
"interpolate": "linear",
"nodata": "Noch keine Daten erhalten",
"dot": false,
"ymin": "0",
"ymax": "2000",
"removeOlder": 1,
"removeOlderPoints": "",
"removeOlderUnit": "604800",
"cutout": 0,
"useOneColor": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"useOldStyle": false,
"outputs": 1,
"x": 790,
"y": 380,
"wires": [
[]
]
},
{
"id": "a793616a.80fb78",
"type": "function",
"z": "1833a4d8.7d988b",
"name": "JSON to Temperatur",
"func": "msg.payload = msg.payload.messung.satz[1].temperature\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 560,
"y": 720,
"wires": [
[
"bbdd00bc.49289",
"630f620b.5f4abc",
"f000f694.64c23"
]
]
},
{
"id": "bbdd00bc.49289",
"type": "ui_gauge",
"z": "1833a4d8.7d988b",
"name": "",
"group": "5469a886.aafe5",
"order": 1,
"width": 0,
"height": 0,
"gtype": "gage",
"title": "Temperatur",
"label": "Grad Celsius",
"format": "{{msg.payload | number:0}}",
"min": "0",
"max": "40",
"colors": [
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1": "25",
"seg2": "30",
"x": 810,
"y": 720,
"wires": []
},
{
"id": "630f620b.5f4abc",
"type": "ui_chart",
"z": "1833a4d8.7d988b",
"name": "",
"group": "5469a886.aafe5",
"order": 2,
"width": 0,
"height": 0,
"label": "Trend",
"chartType": "line",
"legend": "false",
"xformat": "dd HH:mm",
"interpolate": "linear",
"nodata": "Noch keine Daten erhalten",
"dot": false,
"ymin": "0",
"ymax": "40",
"removeOlder": 1,
"removeOlderPoints": "",
"removeOlderUnit": "604800",
"cutout": 0,
"useOneColor": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"useOldStyle": false,
"outputs": 1,
"x": 790,
"y": 780,
"wires": [
[]
]
},
{
"id": "f000f694.64c23",
"type": "debug",
"z": "1833a4d8.7d988b",
"name": "Temperatur Wert",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"x": 820,
"y": 660,
"wires": []
},
{
"id": "7ed6b66b.953e4",
"type": "pushover",
"z": "1833a4d8.7d988b",
"name": "CO2 Warnung senden",
"device": "",
"title": "CO2 Messung im Arbeitszimmer",
"priority": 0,
"sound": "",
"url": "",
"url_title": "",
"html": false,
"x": 1200,
"y": 500,
"wires": []
},
{
"id": "6acb5e0a.2ae6b",
"type": "switch",
"z": "1833a4d8.7d988b",
"name": "Auswertung",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "gt",
"v": "1000",
"vt": "num"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 810,
"y": 440,
"wires": [
[
"1bc11a17.c983ce"
]
]
},
{
"id": "1bc11a17.c983ce",
"type": "throttle",
"z": "1833a4d8.7d988b",
"name": "Nur eine Warnung pro Stunde",
"throttleType": "time",
"timeLimit": "1",
"timeLimitType": "hours",
"countLimit": "1",
"blockSize": 0,
"locked": false,
"x": 930,
"y": 500,
"wires": [
[
"7ed6b66b.953e4",
"315f6f10.da8708"
]
]
},
{
"id": "315f6f10.da8708",
"type": "debug",
"z": "1833a4d8.7d988b",
"name": "Warnung",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"x": 1160,
"y": 560,
"wires": []
},
{
"id": "abc88836.28e918",
"type": "mqtt-broker",
"z": "",
"name": "co2",
"broker": "pi-bplus",
"port": "1883",
"clientid": "",
"usetls": false,
"compatmode": false,
"keepalive": "60",
"cleansession": true,
"birthTopic": "co2",
"birthQos": "0",
"birthPayload": "",
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
},
{
"id": "92ac457c.0b6e2",
"type": "ui_group",
"z": "",
"name": "CO2-Messung",
"tab": "af39e9ca.cc925",
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "5469a886.aafe5",
"type": "ui_group",
"z": "",
"name": "Temperatur Messung",
"tab": "7735e668.50187",
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "af39e9ca.cc925",
"type": "ui_tab",
"z": "",
"name": "CO2",
"icon": "dashboard",
"disabled": false,
"hidden": false
},
{
"id": "7735e668.50187",
"type": "ui_tab",
"z": "",
"name": "Temperatur",
"icon": "dashboard",
"disabled": false,
"hidden": false
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment