Change the PASSWORD and IPADDRESS
This element will get the request from the Kostal device as HTML and create the
GUI elements and the MQTT data for the HAS.
The flows can be used as an alternative to the node.js mqtt scripts.
"url": "http://pvserver:PASSWORD@IPADDRESS",
[
{
"id": "6421893c.968b4",
"type": "tab",
"label": "Kostal Piko",
"disabled": false,
"info": "All data from the kostal piko device and all\ns0 sensors..."
},
{
"id": "5a855f4f.2a0728",
"type": "inject",
"z": "6421893c.968b4",
"name": "Timer for data",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "60",
"crontab": "",
"once": true,
"onceDelay": "",
"x": 120,
"y": 180,
"wires": [
[
"ab2edc17.89f03",
"132be680.13c062",
"78980e1e.2ee6b8"
]
]
},
{
"id": "efd3d962.139b08",
"type": "html",
"z": "6421893c.968b4",
"name": "Watt aktuell",
"tag": "body > form > font > table:nth-child(2) > tr:nth-child(4) > td:nth-child(3)",
"ret": "text",
"as": "multi",
"x": 550,
"y": 640,
"wires": [
[
"559eb16b.9b761"
]
],
"outputLabels": [
"watt"
]
},
{
"id": "ab2edc17.89f03",
"type": "http request",
"z": "6421893c.968b4",
"name": "Request: SET PASSWORD && IPADDRESS",
"method": "GET",
"ret": "txt",
"url": "http://pvserver:PASSWORD@IPADDRESS",
"tls": "",
"x": 270,
"y": 480,
"wires": [
[
"efd3d962.139b08",
"ca195eeb.84edf8",
"7a9012cc.1145dc"
]
]
},
{
"id": "ca195eeb.84edf8",
"type": "html",
"z": "6421893c.968b4",
"name": "Tag kWh",
"tag": "body > form > font > table:nth-child(2) > tr:nth-child(6) > td:nth-child(6)",
"ret": "text",
"as": "multi",
"x": 540,
"y": 360,
"wires": [
[
"559eb16b.9b761"
]
],
"outputLabels": [
"daykwh"
]
},
{
"id": "7a9012cc.1145dc",
"type": "html",
"z": "6421893c.968b4",
"name": "Gesamtenergie kWh",
"tag": "body > form > font > table:nth-child(2) > tr:nth-child(4) > td:nth-child(6)",
"ret": "text",
"as": "multi",
"x": 580,
"y": 740,
"wires": [
[
"559eb16b.9b761"
]
],
"outputLabels": [
"kwh"
]
},
{
"id": "559eb16b.9b761",
"type": "join",
"z": "6421893c.968b4",
"name": "",
"mode": "custom",
"build": "array",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": false,
"timeout": "1",
"count": "3",
"x": 630,
"y": 500,
"wires": [
[
"938d9079.2d79d8",
"24fdee5.816a012",
"6b2b7b1e.c37b64",
"ef8307b2.91ce1",
"40c9d85a.9f19f8"
]
]
},
{
"id": "40c9d85a.9f19f8",
"type": "debug",
"z": "6421893c.968b4",
"name": "",
"active": false,
"console": "false",
"complete": "payload.watt",
"x": 830,
"y": 320,
"wires": []
},
{
"id": "938d9079.2d79d8",
"type": "function",
"z": "6421893c.968b4",
"name": "build payload",
"func": "var payload = msg.payload,\n o = {};\n o.device = \"Kostal PIKO 5.5 \";\n o.time = new Date().toLocaleString();\n o.watt = 0.00;\n o.daykwh = 0.00;\n o.totalkwh = 0.00;\n// build the payload for the mqtt broker\nif(payload && payload.length) {\n o.watt = parseFloat(payload[0].replace(/\\r?\\n?/g, '').trim())||0.00;\n o.daykwh = parseFloat(payload[1].replace(/\\r?\\n?/g, '').trim())||0.00;\n o.totalkwh = parseFloat(payload[2].replace(/\\r?\\n?/g, '').trim())||0.00;\n return {payload: o};\n} else {\n return {payload: o};\n}",
"outputs": 1,
"noerr": 0,
"x": 808.5,
"y": 449,
"wires": [
[
"c670457c.c1fdb8"
]
]
},
{
"id": "c670457c.c1fdb8",
"type": "mqtt out",
"z": "6421893c.968b4",
"name": "",
"topic": "tele/kostal/pikodata",
"qos": "0",
"retain": "true",
"broker": "359f0f5a.21b0c8",
"x": 1085,
"y": 447,
"wires": []
},
{
"id": "24fdee5.816a012",
"type": "function",
"z": "6421893c.968b4",
"name": "Watt",
"func": "var payload = msg.payload;\nvar watt = parseFloat(payload[0].replace(/\\r?\\n?/g, '').trim())||0.00;\nreturn {payload: watt};",
"outputs": 1,
"noerr": 0,
"x": 790,
"y": 517,
"wires": [
[
"3db83bd8.cf0444"
]
]
},
{
"id": "739861e7.0d058",
"type": "ui_gauge",
"z": "6421893c.968b4",
"name": "",
"group": "2c0d5acd.50dd7e",
"order": 0,
"width": 0,
"height": 0,
"gtype": "gage",
"title": "Tagesleistung kWh",
"label": "W",
"format": "{{value}}",
"min": 0,
"max": "12.00",
"colors": [
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1": "",
"seg2": "",
"x": 990,
"y": 565,
"wires": []
},
{
"id": "6b2b7b1e.c37b64",
"type": "function",
"z": "6421893c.968b4",
"name": "Day kWh",
"func": "var payload = msg.payload;\nvar watt = parseFloat(payload[1].replace(/\\r?\\n?/g, '').trim())||0.00;\nreturn {payload: watt};",
"outputs": 1,
"noerr": 0,
"x": 800.5,
"y": 565,
"wires": [
[
"739861e7.0d058"
]
]
},
{
"id": "ef8307b2.91ce1",
"type": "function",
"z": "6421893c.968b4",
"name": "Total kWh",
"func": "var payload = msg.payload;\nvar watt = parseFloat(payload[2].replace(/\\r?\\n?/g, '').trim())||0.00;\nreturn {payload: watt};",
"outputs": 1,
"noerr": 0,
"x": 801.5,
"y": 614,
"wires": [
[
"33f0029e.b58166"
]
]
},
{
"id": "3db83bd8.cf0444",
"type": "ui_chart",
"z": "6421893c.968b4",
"name": "",
"group": "2c0d5acd.50dd7e",
"order": 0,
"width": 0,
"height": 0,
"label": "Aktuell Watt",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": "",
"ymax": "",
"removeOlder": 1,
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"useOldStyle": false,
"x": 969.5,
"y": 517,
"wires": [
[],
[]
]
},
{
"id": "33f0029e.b58166",
"type": "ui_chart",
"z": "6421893c.968b4",
"name": "",
"group": "2c0d5acd.50dd7e",
"order": 0,
"width": 0,
"height": 0,
"label": "Gesamtleistung",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": "",
"ymax": "",
"removeOlder": 1,
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"useOldStyle": false,
"x": 981.5,
"y": 614,
"wires": [
[],
[]
]
},
{
"id": "132be680.13c062",
"type": "debug",
"z": "6421893c.968b4",
"name": "",
"active": false,
"console": "false",
"complete": "false",
"x": 370,
"y": 240,
"wires": []
},
{
"id": "b474c455.1cd0c",
"type": "debug",
"z": "6421893c.968b4",
"name": "",
"active": false,
"console": "false",
"complete": "false",
"x": 590,
"y": 240,
"wires": []
},
{
"id": "c1c2d803.d36378",
"type": "ui_text",
"z": "6421893c.968b4",
"group": "2c0d5acd.50dd7e",
"order": 0,
"width": 0,
"height": 0,
"name": "Current Date",
"label": "",
"format": "{{msg.payload}}",
"layout": "row-right",
"x": 610,
"y": 160,
"wires": []
},
{
"id": "78980e1e.2ee6b8",
"type": "moment",
"z": "6421893c.968b4",
"name": "",
"topic": "",
"input": "payload",
"inputType": "msg",
"inTz": "Europe/Vatican",
"adjAmount": "0",
"adjType": "hours",
"adjDir": "add",
"format": "dd, MM-DD-YYYY h:mm:ss a",
"locale": "en_GB",
"output": "payload",
"outputType": "msg",
"outTz": "Europe/Vatican",
"x": 400,
"y": 180,
"wires": [
[
"b474c455.1cd0c",
"c1c2d803.d36378"
]
]
},
{
"id": "359f0f5a.21b0c8",
"type": "mqtt-broker",
"z": "",
"broker": "10.1.1.94",
"port": "1883",
"clientid": "ndredMqtt",
"usetls": false,
"compatmode": true,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
},
{
"id": "2c0d5acd.50dd7e",
"type": "ui_group",
"z": "",
"name": "Kostal Piko 5.5 Anlage",
"tab": "aa717a22.25e1b",
"order": 3,
"disp": true,
"width": "6"
},
{
"id": "aa717a22.25e1b",
"type": "ui_tab",
"z": "",
"name": "3. OG",
"icon": "dashboard",
"order": 5
}
]