[
    {
        "id": "3d3ac3e13997c3b0",
        "type": "debug",
        "z": "6b468a73889cb169",
        "name": "Debug ote 2",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 990,
        "y": 200,
        "wires": []
    },
    {
        "id": "501cd600d1b6188a",
        "type": "function",
        "z": "6b468a73889cb169",
        "name": "convert ote data",
        "func": "const price=[];\n\nvar date = new Date();\n\n// for(var count in msg.payload.data.dataLine[2].point)\n// {\n//     // node.warn(\"data=\"+msg.payload.data.dataLine[1].point[count].y);\n//     price[count] = msg.payload.data.dataLine[2].point[count].y;\n// }\nconst points = msg.payload.data.dataLine[2].point;\n\nfor (let i = 0; i < points.length; i += 4) {\n    price.push(points[i].y);\n}\n\n/*\nnode.warn(date.getHours());\nnode.warn(price);\nnode.warn(price[date.getHours()]);\n*/\n\nmsg.payload = price[date.getHours()];\nmsg.topic = \"DailyPriceEnergy\";\n\nreturn msg;",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 660,
        "y": 180,
        "wires": [
            [
                "3d3ac3e13997c3b0",
                "23d5e030fde63cb9"
            ]
        ]
    },
    {
        "id": "1465dad1f8a0d077",
        "type": "http request",
        "z": "6b468a73889cb169",
        "name": "ote-cr",
        "method": "GET",
        "ret": "obj",
        "paytoqs": "ignore",
        "url": "https://www.ote-cr.cz/cs/kratkodobe-trhy/elektrina/denni-trh/@@chart-data?report_date={{date}}",
        "tls": "",
        "persist": false,
        "proxy": "",
        "insecureHTTPParser": false,
        "authType": "",
        "senderr": false,
        "headers": [],
        "x": 470,
        "y": 180,
        "wires": [
            [
                "5c6832f3ddc1e2c4",
                "501cd600d1b6188a"
            ]
        ]
    },
    {
        "id": "5c6832f3ddc1e2c4",
        "type": "debug",
        "z": "6b468a73889cb169",
        "name": "Debug ote 1",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 650,
        "y": 240,
        "wires": []
    },
    {
        "id": "23d5e030fde63cb9",
        "type": "api-call-service",
        "z": "6b468a73889cb169",
        "name": "",
        "server": "a3ff46ce.f40158",
        "version": 7,
        "debugenabled": false,
        "action": "input_number.set_value",
        "floorId": [],
        "areaId": [],
        "deviceId": [],
        "entityId": [
            "input_number.ote_electricity_price_eur"
        ],
        "labelId": [],
        "data": "{'value':msg.payload}",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "blockInputOverrides": false,
        "domain": "input_number",
        "service": "set_value",
        "x": 950,
        "y": 280,
        "wires": [
            [
                "2e85f4470ff450e4"
            ]
        ]
    },
    {
        "id": "2e85f4470ff450e4",
        "type": "debug",
        "z": "6b468a73889cb169",
        "name": "Debug ote 3",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "msg.payload",
        "targetType": "jsonata",
        "statusVal": "",
        "statusType": "auto",
        "x": 1190,
        "y": 280,
        "wires": []
    },
    {
        "id": "e5dc22f5be6106f1",
        "type": "debug",
        "z": "6b468a73889cb169",
        "name": "Debug ote 1",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 350,
        "y": 280,
        "wires": []
    },
    {
        "id": "1d98fa539869c2a2",
        "type": "function",
        "z": "6b468a73889cb169",
        "name": "convert ote data",
        "func": "\nvar date = new Date();\n\nmsg.payload = date.toISOString().split('T')[0];\nmsg.date = date.toISOString().split('T')[0];\n// msg.req.query = {report_date: date.toISOString().split('T')[0]};\n\nreturn msg;",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 260,
        "y": 180,
        "wires": [
            [
                "1465dad1f8a0d077",
                "e5dc22f5be6106f1"
            ]
        ]
    },
    {
        "id": "19903aac76c5d117",
        "type": "inject",
        "z": "6b468a73889cb169",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "0 0-23 * * *",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 150,
        "y": 100,
        "wires": [
            [
                "1d98fa539869c2a2"
            ]
        ]
    },
    {
        "id": "a3ff46ce.f40158",
        "type": "server",
        "name": "Home Assistant",
        "version": 6,
        "addon": true,
        "rejectUnauthorizedCerts": true,
        "ha_boolean": [
            "y",
            "yes",
            "true",
            "on",
            "home",
            "open"
        ],
        "connectionDelay": true,
        "cacheJson": true,
        "heartbeat": false,
        "heartbeatInterval": "30",
        "areaSelector": "friendlyName",
        "deviceSelector": "friendlyName",
        "entitySelector": "friendlyName",
        "statusSeparator": "at: ",
        "statusYear": "hidden",
        "statusMonth": "short",
        "statusDay": "numeric",
        "statusHourCycle": "h23",
        "statusTimeFormat": "h:m",
        "enableGlobalContextStore": true
    },
    {
        "id": "e8a9451eae345bb5",
        "type": "global-config",
        "env": [],
        "modules": {
            "node-red-contrib-home-assistant-websocket": "0.80.3"
        }
    }
]