Skip to content

Instantly share code, notes, and snippets.

@sjoerdvanderhoorn
Created December 15, 2018 22: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 sjoerdvanderhoorn/a8ac98f20dd083ccc8136906aaab7116 to your computer and use it in GitHub Desktop.
Save sjoerdvanderhoorn/a8ac98f20dd083ccc8136906aaab7116 to your computer and use it in GitHub Desktop.
Windcentrale
[
{
"id": "f75dcbe4.b5a578",
"type": "subflow",
"name": "productie",
"info": "Maakt verbinding met Windcentrale API om productiegegevens van een windmolen te tonen.\n\n# Input\n* ID van windmolen (te verkrijgen via https://mijnmolen.windcentrale.nl/)\n\n# Output\n\n* Dag (kW)\n* Week (kW)\n* Maand (kW)\n* Jaar (kW)",
"category": "windcentrale",
"in": [
{
"x": 160,
"y": 440,
"wires": [
{
"id": "8ec46dbf.d15aa"
}
]
}
],
"out": [
{
"x": 780,
"y": 380,
"wires": [
{
"id": "c51ef4cc.0eeab8",
"port": 0
}
]
},
{
"x": 780,
"y": 420,
"wires": [
{
"id": "1297178e.7c4fa8",
"port": 0
}
]
},
{
"x": 780,
"y": 460,
"wires": [
{
"id": "bcf67ed.c8e468",
"port": 0
}
]
},
{
"x": 780,
"y": 500,
"wires": [
{
"id": "2317543a.22dc7c",
"port": 0
}
]
}
],
"inputLabels": [
"windmolen id"
],
"outputLabels": [
"dag (kW)",
"week (kW)",
"maand (kW)",
"jaar (kW)"
],
"icon": "node-red/debug.png"
},
{
"id": "badd6538.ef1d98",
"type": "xml",
"z": "f75dcbe4.b5a578",
"name": "",
"property": "payload",
"attr": "",
"chr": "",
"x": 490,
"y": 440,
"wires": [
[
"c51ef4cc.0eeab8",
"bcf67ed.c8e468",
"2317543a.22dc7c",
"1297178e.7c4fa8"
]
]
},
{
"id": "c51ef4cc.0eeab8",
"type": "change",
"z": "f75dcbe4.b5a578",
"name": "Dag (kW)",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$round(\t $number(\t msg.payload.response.productie[0].subset[0].\"$\".sum\t\t ) / $number(\t msg.payload.response.productie[0].\"$\".winddelen\t\t ),\t 1\t)",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 640,
"y": 380,
"wires": [
[]
]
},
{
"id": "bcf67ed.c8e468",
"type": "change",
"z": "f75dcbe4.b5a578",
"name": "Maand (kW)",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$round(\t $number(\t msg.payload.response.productie[0].subset[1].\"$\".sum\t\t \t ) / $number(\t msg.payload.response.productie[0].\"$\".winddelen\t\t \t )\t)",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 650,
"y": 460,
"wires": [
[]
]
},
{
"id": "2317543a.22dc7c",
"type": "change",
"z": "f75dcbe4.b5a578",
"name": "Jaar (kW)",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$round(\t $number(\t msg.payload.response.productie[0].subset[3].\"$\".sum\t\t \t ) / $number(\t msg.payload.response.productie[0].\"$\".winddelen\t\t \t )\t)",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 640,
"y": 500,
"wires": [
[]
]
},
{
"id": "1297178e.7c4fa8",
"type": "change",
"z": "f75dcbe4.b5a578",
"name": "Week (kW)",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$round(\t $number(\t msg.payload.response.productie[0].subset[2].\"$\".sum\t\t ) / $number(\t msg.payload.response.productie[0].\"$\".winddelen\t\t )\t)",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 650,
"y": 420,
"wires": [
[]
]
},
{
"id": "4688dc88.823314",
"type": "http request",
"z": "f75dcbe4.b5a578",
"name": "Live",
"method": "GET",
"ret": "txt",
"url": "",
"tls": "",
"x": 370,
"y": 440,
"wires": [
[
"badd6538.ef1d98"
]
]
},
{
"id": "8ec46dbf.d15aa",
"type": "template",
"z": "f75dcbe4.b5a578",
"name": "URL",
"field": "url",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "https://zep-api.windcentrale.nl/production/{{payload}}?method=getProductie&molenid={{payload}}",
"output": "str",
"x": 250,
"y": 440,
"wires": [
[
"4688dc88.823314"
]
]
},
{
"id": "65402381.78104c",
"type": "subflow",
"name": "live",
"info": "Maakt verbinding met Windcentrale API om live gegevens van een windmolen te tonen.\n\n# Input\n* ID van windmolen (te verkrijgen via https://mijnmolen.windcentrale.nl/)\n\n# Output\n\n* Vermogen\n* Productie\n* Windsnelheid\n* Windrichting",
"category": "windcentrale",
"in": [
{
"x": 260,
"y": 180,
"wires": [
{
"id": "284e60a7.eafd9"
}
]
}
],
"out": [
{
"x": 780,
"y": 120,
"wires": [
{
"id": "eb167523.a27608",
"port": 0
}
]
},
{
"x": 780,
"y": 160,
"wires": [
{
"id": "c3bb6fb6.43b93",
"port": 0
}
]
},
{
"x": 780,
"y": 200,
"wires": [
{
"id": "f94b8eaf.c5faf",
"port": 0
}
]
},
{
"x": 780,
"y": 240,
"wires": [
{
"id": "715e5825.e3b9a8",
"port": 0
}
]
}
],
"inputLabels": [
"windmolen id"
],
"outputLabels": [
"vermogen (%)",
"productie (W)",
"windsnelheid (m/s)",
"windrichting"
],
"icon": "node-red/serial.png"
},
{
"id": "2f414ede.f5dc02",
"type": "http request",
"z": "65402381.78104c",
"name": "Live",
"method": "GET",
"ret": "obj",
"url": "",
"tls": "",
"x": 470,
"y": 180,
"wires": [
[
"eb167523.a27608",
"c3bb6fb6.43b93",
"f94b8eaf.c5faf",
"715e5825.e3b9a8"
]
]
},
{
"id": "eb167523.a27608",
"type": "change",
"z": "65402381.78104c",
"name": "Vermogen",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.powerRel",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 650,
"y": 120,
"wires": [
[]
]
},
{
"id": "c3bb6fb6.43b93",
"type": "change",
"z": "65402381.78104c",
"name": "Productie",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.powerAbsWd",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 640,
"y": 160,
"wires": [
[]
]
},
{
"id": "284e60a7.eafd9",
"type": "template",
"z": "65402381.78104c",
"name": "URL",
"field": "url",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "https://zep-api.windcentrale.nl/production/{{payload}}/live?ignoreLoadingBar=true",
"output": "str",
"x": 350,
"y": 180,
"wires": [
[
"2f414ede.f5dc02"
]
]
},
{
"id": "f94b8eaf.c5faf",
"type": "change",
"z": "65402381.78104c",
"name": "Windsnelheid",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.windSpeed",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 660,
"y": 200,
"wires": [
[]
]
},
{
"id": "715e5825.e3b9a8",
"type": "change",
"z": "65402381.78104c",
"name": "Windrichting",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.windDirection",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 650,
"y": 240,
"wires": [
[]
]
},
{
"id": "f881ba0.12d0348",
"type": "inject",
"z": "14cd401d.1b1e3",
"name": "De Trouwe Wachter",
"topic": "",
"payload": "121",
"payloadType": "str",
"repeat": "300",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 140,
"y": 480,
"wires": [
[
"405c0bca.b1f854",
"c3d1a1ce.89559"
]
]
},
{
"id": "9ab81bbc.af7378",
"type": "ui_gauge",
"z": "14cd401d.1b1e3",
"name": "",
"group": "4099ad20.ccf0d4",
"order": 5,
"width": 0,
"height": 0,
"gtype": "gage",
"title": "Vermogen",
"label": "%",
"format": "{{value}}",
"min": 0,
"max": "100",
"colors": [
"#cc0000",
"#e6e600",
"#00ae00"
],
"seg1": "",
"seg2": "",
"x": 550,
"y": 400,
"wires": []
},
{
"id": "c7bc7f7c.9aed6",
"type": "ui_gauge",
"z": "14cd401d.1b1e3",
"name": "",
"group": "4099ad20.ccf0d4",
"order": 6,
"width": 0,
"height": 0,
"gtype": "gage",
"title": "Productie",
"label": "W",
"format": "{{value}}",
"min": 0,
"max": "400",
"colors": [
"#cc0000",
"#e6e600",
"#00ae00"
],
"seg1": "",
"seg2": "",
"x": 540,
"y": 440,
"wires": []
},
{
"id": "1c8e2a1a.94ad06",
"type": "ui_text",
"z": "14cd401d.1b1e3",
"group": "4099ad20.ccf0d4",
"order": 1,
"width": 0,
"height": 0,
"name": "",
"label": "Dagopbrengst (kW)",
"format": "{{msg.payload}}",
"layout": "row-spread",
"x": 570,
"y": 480,
"wires": []
},
{
"id": "6eec33ca.7886ec",
"type": "ui_text",
"z": "14cd401d.1b1e3",
"group": "4099ad20.ccf0d4",
"order": 3,
"width": 0,
"height": 0,
"name": "",
"label": "Maandopbrengst (kW)",
"format": "{{msg.payload}}",
"layout": "row-spread",
"x": 580,
"y": 560,
"wires": []
},
{
"id": "92ec1388.6e9c7",
"type": "ui_text",
"z": "14cd401d.1b1e3",
"group": "4099ad20.ccf0d4",
"order": 4,
"width": 0,
"height": 0,
"name": "",
"label": "Jaaropbrengst (kW)",
"format": "{{msg.payload}}",
"layout": "row-spread",
"x": 570,
"y": 600,
"wires": []
},
{
"id": "405c0bca.b1f854",
"type": "subflow:65402381.78104c",
"z": "14cd401d.1b1e3",
"name": "",
"x": 350,
"y": 440,
"wires": [
[
"9ab81bbc.af7378"
],
[
"c7bc7f7c.9aed6"
],
[],
[]
]
},
{
"id": "c3d1a1ce.89559",
"type": "subflow:f75dcbe4.b5a578",
"z": "14cd401d.1b1e3",
"name": "",
"x": 360,
"y": 520,
"wires": [
[
"1c8e2a1a.94ad06"
],
[
"fc919cea.508eb"
],
[
"6eec33ca.7886ec"
],
[
"92ec1388.6e9c7"
]
]
},
{
"id": "fc919cea.508eb",
"type": "ui_text",
"z": "14cd401d.1b1e3",
"group": "4099ad20.ccf0d4",
"order": 2,
"width": 0,
"height": 0,
"name": "",
"label": "Weekopbrengst (kW)",
"format": "{{msg.payload}}",
"layout": "row-spread",
"x": 580,
"y": 520,
"wires": []
},
{
"id": "4099ad20.ccf0d4",
"type": "ui_group",
"z": "",
"name": "De Trouwe Wachter",
"tab": "ebce54d6.f7c8c8",
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "ebce54d6.f7c8c8",
"type": "ui_tab",
"z": "",
"name": "Energie",
"icon": "dashboard"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment