indeed, this is a web page.. say to debug.
There is also the scheduler that get & store the data :
And the "http request node" works also fine with the DeviceName-URL.
[
{
"id": "274464c5c274a09f",
"type": "debug",
"z": "f37cd7c9ed481cbb",
"name": "P1 Data 1 s",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1130,
"y": 160,
"wires": []
},
{
"id": "54b7fefc96d6abae",
"type": "inject",
"z": "f37cd7c9ed481cbb",
"name": "1 s",
"props": [
{
"p": "payload"
}
],
"repeat": "1",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 90,
"y": 180,
"wires": [
[
"ce577c401c9f8570"
]
]
},
{
"id": "9d547b75257c497e",
"type": "function",
"z": "f37cd7c9ed481cbb",
"name": "extract Act",
"func": "var pl = msg.payload;\n\nvar obj = pl.active_tariff;\nif (obj = 1) { global.set(\"P1_act_tariff\", \"D\", \"file\"); }\nelse { global.set(\"P1_act_tariff\", \"N\", \"file\"); }\n\n// ACTIVE POWER W\nvar actPowerSmth = global.get(\"P1_act_powerSmth\", \"file\") ;\nvar obj = pl.active_power_w;\nvar objSmth = Math.round((actPowerSmth * .75) + (obj * .25));\nglobal.set(\"P1_act_power\", obj, \"file\");\nglobal.set(\"P1_act_powerSmth\", objSmth, \"file\");\n\n// ACTIVE CURRENT L1 A\nvar obj = pl.active_current_l1_a;\nglobal.set(\"P1_act_current\", obj, \"file\");\n\n// ACTIVE VOLTAGE L1 V\nvar obj = pl.active_voltage_l1_v;\nglobal.set(\"P1_act_voltage\", obj, \"file\");\n\n// ACTIVE Monthly POWER PEAK W\nvar obj = pl.montly_power_peak_w;\nglobal.set(\"P1_mth_powerpeak\", obj, \"file\");\n\nreturn null;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 970,
"y": 160,
"wires": [
[
"274464c5c274a09f"
]
]
},
{
"id": "edecbb5ccf7917e4",
"type": "rbe",
"z": "f37cd7c9ed481cbb",
"name": "",
"func": "rbe",
"gap": "",
"start": "",
"inout": "out",
"property": "payload",
"x": 310,
"y": 240,
"wires": [
[
"ae82c6f686a174ed"
]
]
},
{
"id": "ae82c6f686a174ed",
"type": "http request",
"z": "f37cd7c9ed481cbb",
"name": "Data",
"method": "GET",
"ret": "obj",
"paytoqs": "body",
"url": "http://p1meter-090bb6.local/api/v1/data",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [],
"x": 450,
"y": 240,
"wires": [
[
"44f168240a7538b1"
]
]
},
{
"id": "1cbfbb7d9f5117d2",
"type": "switch",
"z": "f37cd7c9ed481cbb",
"name": "Check Sts",
"property": "statusCode",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "200",
"vt": "num"
},
{
"t": "neq",
"v": "200",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 590,
"y": 180,
"wires": [
[
"e5bba4096ad71cb5"
],
[
"6810994ee7ee99b9"
]
]
},
{
"id": "6810994ee7ee99b9",
"type": "change",
"z": "f37cd7c9ed481cbb",
"name": "Status NOK",
"rules": [
{
"t": "set",
"p": "#:(file)::P1Status",
"pt": "global",
"to": "payload.response_status.error_code",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 790,
"y": 200,
"wires": [
[
"d8541562c276a83a"
]
]
},
{
"id": "e5bba4096ad71cb5",
"type": "change",
"z": "f37cd7c9ed481cbb",
"name": "Status OK",
"rules": [
{
"t": "set",
"p": "#:(file)::P1Status",
"pt": "global",
"to": "Success",
"tot": "str"
},
{
"t": "set",
"p": "#:(file)::P1LastFetch",
"pt": "global",
"to": "",
"tot": "date"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 790,
"y": 160,
"wires": [
[
"9d547b75257c497e"
]
]
},
{
"id": "367d81e471cdbc4a",
"type": "inject",
"z": "f37cd7c9ed481cbb",
"name": "5 min",
"props": [
{
"p": "payload"
}
],
"repeat": "300",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 90,
"y": 240,
"wires": [
[
"edecbb5ccf7917e4"
]
]
},
{
"id": "ce577c401c9f8570",
"type": "http request",
"z": "f37cd7c9ed481cbb",
"name": "Data",
"method": "GET",
"ret": "obj",
"paytoqs": "body",
"url": "http://p1meter-090bb6.local/api/v1/data",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [],
"x": 450,
"y": 180,
"wires": [
[
"1cbfbb7d9f5117d2"
]
]
},
{
"id": "44f168240a7538b1",
"type": "function",
"z": "f37cd7c9ed481cbb",
"name": "exact YTD",
"func": "var pl = msg.payload;\n\nvar obj = pl.total_power_import_t1_kwh; // IMPORT kWh D\nglobal.set(\"P1_tot_import_t1\", obj, \"file\");\nvar obj = pl.total_power_import_t2_kwh; // IMPORT kWh N\nglobal.set(\"P1_tot_import_t2\", obj, \"file\");\nvar obj = pl.total_power_import_kwh; // IMPORT kWh\nglobal.set(\"P1_tot_import\", obj, \"file\");\nvar obj = pl.total_power_export_kwh; // EXPORT kWh\nglobal.set(\"P1_tot_export\", obj, \"file\");\n\nvar obj = pl.external[0].timestamp; // Gas \nvar y = 2000 + parseInt(obj.toString().substring(0, 2));\nvar m = parseInt(obj.toString().substring(2, 4)) - 1;\nvar d = parseInt(obj.toString().substring(4, 6));\nvar h = parseInt(obj.toString().substring(6, 8));\nvar n = parseInt(obj.toString().substring(8, 10));\nvar date = new Date(y, m, d, h, n);\nvar ts = date.getTime();\nglobal.set(\"P1LastFetchGas\", ts, \"file\");\nvar obj = pl.external[0].value;\nglobal.set(\"P1_tot_gas\", obj, \"file\"); // M3\n\nreturn null;\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 970,
"y": 240,
"wires": [
[]
]
},
{
"id": "f323f0b8c32013e2",
"type": "comment",
"z": "f37cd7c9ed481cbb",
"name": "TAB Scheduler : every hour the total kWh are stored in dB as kWh/Hr",
"info": "",
"x": 360,
"y": 280,
"wires": []
},
{
"id": "d8541562c276a83a",
"type": "debug",
"z": "f37cd7c9ed481cbb",
"name": "P1 nok",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1120,
"y": 200,
"wires": []
}
]