[
{
"id": "6d449e2c78b1b570",
"type": "html",
"z": "2270875cb0f163ee",
"name": "",
"property": "payload",
"outproperty": "payload",
"tag": "p",
"ret": "text",
"as": "single",
"chr": "",
"x": 210,
"y": 240,
"wires": [
[
"edbd67e7eac94376",
"0f3879d60db30ebe"
]
]
},
{
"id": "08ce85573b2cee3c",
"type": "debug",
"z": "2270875cb0f163ee",
"name": "debug 41",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 590,
"y": 140,
"wires": []
},
{
"id": "a2350cf2e1581fda",
"type": "www-request",
"z": "2270875cb0f163ee",
"name": "",
"method": "use",
"ret": "txt",
"url": "",
"follow-redirects": true,
"persistent-http": true,
"tls": "",
"x": 370,
"y": 140,
"wires": [
[
"08ce85573b2cee3c",
"6d449e2c78b1b570"
]
]
},
{
"id": "edbd67e7eac94376",
"type": "debug",
"z": "2270875cb0f163ee",
"name": "debug 48",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 370,
"y": 280,
"wires": []
},
{
"id": "0f3879d60db30ebe",
"type": "function",
"z": "2270875cb0f163ee",
"name": "function 46",
"func": "var EuroPos=0;\n\nvar count=0;\n\n// find Pragraph containing Euro Price\n\nfor (var i = 0; i < 30; i++) {\n if (msg.payload[i].includes(\"Bundesdurchschnitt\")) {\n break;\n }\n else\n { count++;}\n}\n\nEuroPos = count;\n\nvar words = msg.payload[EuroPos].split('Bundesdurchschnitt ');\nvar words1 = words[1].split(' ');\nvar Preis_lose = (words1[0]);\n\nwords = msg.payload[EuroPos].split('derzeit ');\nwords1 = words[1].split(' ');\nvar Preis_Sack = (words1[0]);\n\nvar Influx = [{\n Room: \"Pelletpreis\",\n Lose: Preis_lose,\n Sack: Preis_Sack\n}]\n\nnode.status({\n fill: \"green\",\n shape: \"ring\",\n text: \"Preis (lose): \" + Preis_lose + \" Euro, \" +\n \"Preis (Sackware): \" + Preis_Sack + \" Euro\"\n});\n\n// New date using date Constructor\nlet d = new Date();\n// Convert to string\nlet dateString = d.toISOString();\nlet date = dateString.slice(0,10);\nvar SQL= \"INSERT INTO prix_moyen (dateB, prix) VALUES('\" + date + \"', \" + parseInt(Preis_lose) + \");\"\n\nvar NewMsg = \"\";\nNewMsg = {payload: \"empty\"};\nNewMsg.topic = {topic: SQL}; \n\nnode.status({fill:\"blue\",shape:\"ring\",text:\"Date: \" + dateString });\n// return [{payload: Influx}, NewMsg];\nreturn [{payload: Influx},{\"topic\": SQL, \"payload\": \"Please wait, updating views...\"}];",
"outputs": 2,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 370,
"y": 240,
"wires": [
[
"43d56ff46af639f2"
],
[
"727f1720340068c7",
"0a6a3ac445710741"
]
],
"outputLabels": [
"Influx",
""
]
},
{
"id": "0a6a3ac445710741",
"type": "mysql",
"z": "2270875cb0f163ee",
"mydb": "516bb65d8291d321",
"name": "Hargassner",
"x": 590,
"y": 300,
"wires": [
[
"47a660065ed43f82"
]
]
},
{
"id": "43d56ff46af639f2",
"type": "debug",
"z": "2270875cb0f163ee",
"name": "debug 92",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 590,
"y": 180,
"wires": []
},
{
"id": "727f1720340068c7",
"type": "debug",
"z": "2270875cb0f163ee",
"name": "debug 93",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 590,
"y": 220,
"wires": []
},
{
"id": "47a660065ed43f82",
"type": "debug",
"z": "2270875cb0f163ee",
"name": "debug 94",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 590,
"y": 260,
"wires": []
},
{
"id": "ded38fff66ce0402",
"type": "cronplus",
"z": "2270875cb0f163ee",
"name": "daily at 4:00",
"outputField": "payload",
"timeZone": "",
"storeName": "",
"commandResponseMsgOutput": "output1",
"defaultLocation": "",
"defaultLocationType": "default",
"outputs": 1,
"options": [
{
"name": "Midnight",
"topic": "Midnight",
"payloadType": "default",
"payload": "",
"expressionType": "cron",
"expression": "0 0 4 * * *",
"location": "",
"offset": "0",
"solarType": "all",
"solarEvents": "sunrise,sunset"
}
],
"x": 130,
"y": 40,
"wires": [
[
"05c00401a21aa774"
]
]
},
{
"id": "05c00401a21aa774",
"type": "change",
"z": "2270875cb0f163ee",
"name": "",
"rules": [
{
"t": "set",
"p": "url",
"pt": "msg",
"to": "https://www.holzpellets.net/pelletspreise/",
"tot": "str"
},
{
"t": "set",
"p": "method",
"pt": "msg",
"to": "GET",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 380,
"y": 40,
"wires": [
[
"a2350cf2e1581fda"
]
]
},
{
"id": "007396b31aeac6ed",
"type": "inject",
"z": "2270875cb0f163ee",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 180,
"y": 100,
"wires": [
[
"05c00401a21aa774"
]
]
},
{
"id": "516bb65d8291d321",
"type": "MySQLdatabase",
"name": "SQL-Hargassner",
"host": "192.168.126.14",
"port": "3306",
"db": "hargassner",
"tz": "",
"charset": "UTF8"
}
]
Comments
0 B
|0 👍
/0 👎
0 B
|👍
/👎