# Share of regenerative electricity -energie Chart Frauenhofer

**URL:** https://discourse.nodered.org/t/share-of-regenerative-electricity-energie-chart-frauenhofer/83913
**Category:** Share Your Projects
**Created:** [21 December 2023 12:19 UTC](https://discourse.nodered.org/t/share-of-regenerative-electricity-energie-chart-frauenhofer/83913 "2023-12-21T12:19:24Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![WP-Rue](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wp-rue/32/87264_2.png) [@WP-Rue](https://discourse.nodered.org/u/WP-Rue)
#### Post date: [21 December 2023 12:19 UTC](https://discourse.nodered.org/t/share-of-regenerative-electricity-energie-chart-frauenhofer/83913/1 "2023-12-21T12:19:24Z")

</div>

At [https://energy-charts.info](https://energy-charts.info) you can find many information about the actual energy mix in Germany.  
My flow gets actual data and shows a graph and a signal...

 ![Bildschirmfoto vom 2023-12-21 11-57-19](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/f/5fcf633282b7df75c7b3fad21eb84caa0bb10c17.png)

```auto
[
    {
        "id": "cb95544e34843c81",
        "type": "http request",
        "z": "2ee18b148a01d52a",
        "name": "Energie-Charts",
        "method": "GET",
        "ret": "obj",
        "paytoqs": "ignore",
        "url": "https://api.energy-charts.info/signal?country=de&postal_code=38104",
        "tls": "",
        "persist": false,
        "proxy": "",
        "insecureHTTPParser": false,
        "authType": "",
        "senderr": false,
        "headers": [
            {
                "keyType": "other",
                "keyValue": "unix_seconds",
                "valueType": "msg",
                "valueValue": "time"
            },
            {
                "keyType": "other",
                "keyValue": "share",
                "valueType": "msg",
                "valueValue": "anteil"
            },
            {
                "keyType": "other",
                "keyValue": "signal",
                "valueType": "msg",
                "valueValue": "signal"
            },
            {
                "keyType": "other",
                "keyValue": "substitute",
                "valueType": "other",
                "valueValue": "sub"
            }
        ],
        "x": 320,
        "y": 100,
        "wires": [
            [
                "ee4312cb3e3ad49a"
            ]
        ]
    },
    {
        "id": "441dcc387db3aab8",
        "type": "inject",
        "z": "2ee18b148a01d52a",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "0 5-22 * * *",
        "once": true,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 150,
        "y": 100,
        "wires": [
            [
                "cb95544e34843c81",
                "5b82317b44553382",
                "89cea6b65387baaf"
            ]
        ]
    },
    {
        "id": "5b82317b44553382",
        "type": "change",
        "z": "2ee18b148a01d52a",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "timesta",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 330,
        "y": 60,
        "wires": [
            []
        ]
    },
    {
        "id": "0822028c7c754acb",
        "type": "ui_chart",
        "z": "2ee18b148a01d52a",
        "name": "",
        "group": "c63597be5feefad7",
        "order": 1,
        "width": 0,
        "height": 0,
        "label": "Anteil regen. Energie",
        "chartType": "line",
        "legend": "false",
        "xformat": "dd HH:mm",
        "interpolate": "linear",
        "nodata": "",
        "dot": false,
        "ymin": "",
        "ymax": "",
        "removeOlder": "36",
        "removeOlderPoints": "",
        "removeOlderUnit": "3600",
        "cutout": 0,
        "useOneColor": false,
        "useUTC": false,
        "colors": [
            "#43f62f",
            "#aec7e8",
            "#ff7f0e",
            "#2ca02c",
            "#98df8a",
            "#d62728",
            "#ff9896",
            "#9467bd",
            "#c5b0d5"
        ],
        "outputs": 1,
        "useDifferentColor": false,
        "className": "",
        "x": 800,
        "y": 60,
        "wires": [
            []
        ]
    },
    {
        "id": "ee4312cb3e3ad49a",
        "type": "function",
        "z": "2ee18b148a01d52a",
        "name": "function 45",
        "func": "// Holt den aktuellen und 2h zukünftigen Ökostrom-Anteil als Ampelsignal (0..3)\n/*\n Grün / Blau: Anteil EE > Mittelwert + 10 % oder Anteil EE > 95 %\n Gelb: Mittelwert – 10 % < Anteil EE < Mittelwert + 10 %\n Rot: Anteil EE < Mittelwert – 10 %\n -1: Red (grid congestion), -violett\n 0: Red (low renewable share), \n 1: Yellow (average renewable share),\n 2: Green (high renewable share)\n*/\n\nvar time =0;\nvar signal=0 ;\nvar share=0;\nlet msg2={}, msg3={}, msg4={};//msg2: Ausgang für Status zur aktuellen Zeit, msg3: Ausgang für 2h in ZUkunft\n\nvar timestamp=flow.get(\"timesta\"); //aktuelle Zeit\nconst timestamp1h=timestamp+7200000;\n\nvar time_float = 0;\n\nvar i = 0;\nvar dataarray = [[]];\n\nfor (i = 0; i < msg.payload.unix_seconds.length; i++) {\n\n time = msg.payload.unix_seconds[i];\n time_float = time * 1000;\n share = msg.payload.share[i];\n signal = msg.payload.signal[i];\n dataarray[0][i] = { \"x\": time_float, \"y\": share };\n \n if ((time_float > timestamp) && (timestamp+901000 > time_float)) {\n msg2.payload=signal;\n msg4.payload=share;\n }\n if ((time_float > timestamp1h) && (timestamp1h + 901000 > time_float)) {\n msg3.payload = signal;\n };\n}\n\nvar chart = [{\n \"series\": [\"Ökostrom-Anteil=\"],\n \"data\": dataarray,\n \"labels\": [\"Anteil\"]\n}];\n\nmsg.payload = chart;\n\nreturn [msg,msg2,msg3,msg4];",
        "outputs": 4,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 530,
        "y": 100,
        "wires": [
            [
                "0822028c7c754acb"
            ],
            [
                "01917244f7c098e6",
                "d86cad2d2a910704"
            ],
            [
                "4d7ef0bd591b11e0"
            ],
            [
                "d6831a4292a29bd5",
                "774243f751c6ac02"
            ]
        ]
    },
    {
        "id": "01917244f7c098e6",
        "type": "ui_led",
        "z": "2ee18b148a01d52a",
        "order": 4,
        "group": "c63597be5feefad7",
        "width": 1,
        "height": 1,
        "label": "",
        "labelPlacement": "left",
        "labelAlignment": "left",
        "colorForValue": [
            {
                "color": "#ee27f7",
                "value": "-1",
                "valueType": "num"
            },
            {
                "color": "#ff0000",
                "value": "0",
                "valueType": "num"
            },
            {
                "color": "#fce94f",
                "value": "1",
                "valueType": "num"
            },
            {
                "color": "#43f62f",
                "value": "2",
                "valueType": "num"
            }
        ],
        "allowColorForValueInMessage": false,
        "shape": "circle",
        "showGlow": true,
        "name": "",
        "x": 750,
        "y": 100,
        "wires": []
    },
    {
        "id": "4d7ef0bd591b11e0",
        "type": "ui_led",
        "z": "2ee18b148a01d52a",
        "order": 5,
        "group": "c63597be5feefad7",
        "width": 6,
        "height": 1,
        "label": "Vorhersage 2h:",
        "labelPlacement": "left",
        "labelAlignment": "left",
        "colorForValue": [
            {
                "color": "#ee27f7",
                "value": "-1",
                "valueType": "num"
            },
            {
                "color": "#cc0000",
                "value": "0",
                "valueType": "num"
            },
            {
                "color": "#edd400",
                "value": "1",
                "valueType": "num"
            },
            {
                "color": "#8ae234",
                "value": "2",
                "valueType": "num"
            }
        ],
        "allowColorForValueInMessage": false,
        "shape": "circle",
        "showGlow": false,
        "name": "",
        "x": 750,
        "y": 140,
        "wires": []
    },
    {
        "id": "d6831a4292a29bd5",
        "type": "ui_text",
        "z": "2ee18b148a01d52a",
        "group": "c63597be5feefad7",
        "order": 2,
        "width": 4,
        "height": 1,
        "name": "",
        "label": "Strommix ",
        "format": "{{msg.payload}} %",
        "layout": "row-spread",
        "className": "",
        "style": false,
        "font": "",
        "fontSize": 16,
        "color": "#000000",
        "x": 760,
        "y": 180,
        "wires": []
    },
    {
        "id": "2edea2d1a6fc8607",
        "type": "ui_text",
        "z": "2ee18b148a01d52a",
        "group": "c63597be5feefad7",
        "order": 6,
        "width": 0,
        "height": 0,
        "name": "Aktualisierung",
        "label": "<font size=1>Aktualisiert: ",
        "format": "<font size=1>{{msg.payload}}",
        "layout": "row-left",
        "className": "",
        "style": false,
        "font": "",
        "fontSize": "",
        "color": "#000000",
        "x": 360,
        "y": 160,
        "wires": []
    },
    {
        "id": "89cea6b65387baaf",
        "type": "moment",
        "z": "2ee18b148a01d52a",
        "name": "Timestamp",
        "topic": "",
        "input": "payload",
        "inputType": "msg",
        "inTz": "Europe/Berlin",
        "adjAmount": 0,
        "adjType": "days",
        "adjDir": "add",
        "format": "dddd, D.MM.YY HH:mm",
        "locale": "de",
        "output": "payload",
        "outputType": "msg",
        "outTz": "Europe/Berlin",
        "x": 190,
        "y": 160,
        "wires": [
            [
                "2edea2d1a6fc8607"
            ]
        ]
    },
    {
        "id": "d86cad2d2a910704",
        "type": "ui_led",
        "z": "2ee18b148a01d52a",
        "order": 7,
        "group": "66afbcec5bd7c7bb",
        "width": 1,
        "height": 1,
        "label": "",
        "labelPlacement": "left",
        "labelAlignment": "left",
        "colorForValue": [
            {
                "color": "#ee27f7",
                "value": "-1",
                "valueType": "num"
            },
            {
                "color": "#ff0000",
                "value": "0",
                "valueType": "num"
            },
            {
                "color": "#fce94f",
                "value": "1",
                "valueType": "num"
            },
            {
                "color": "#43f62f",
                "value": "2",
                "valueType": "num"
            }
        ],
        "allowColorForValueInMessage": false,
        "shape": "circle",
        "showGlow": true,
        "name": "Öko",
        "x": 870,
        "y": 100,
        "wires": []
    },
    {
        "id": "774243f751c6ac02",
        "type": "ui_text",
        "z": "2ee18b148a01d52a",
        "group": "66afbcec5bd7c7bb",
        "order": 14,
        "width": 4,
        "height": 1,
        "name": "",
        "label": "Strommix ",
        "format": "<font size=4>{{msg.payload| number:0}} %",
        "layout": "row-spread",
        "className": "",
        "style": false,
        "font": "",
        "fontSize": 16,
        "color": "#000000",
        "x": 760,
        "y": 220,
        "wires": []
    },
    {
        "id": "c63597be5feefad7",
        "type": "ui_group",
        "name": "Ökostrom-Anteil",
        "tab": "6b520bda.e997a4",
        "order": 2,
        "disp": true,
        "width": "6",
        "collapse": false,
        "className": ""
    },
    {
        "id": "66afbcec5bd7c7bb",
        "type": "ui_group",
        "name": "Einstellungen",
        "tab": "2acb95821445c8af",
        "order": 3,
        "disp": false,
        "width": "5",
        "collapse": false,
        "className": ""
    },
    {
        "id": "6b520bda.e997a4",
        "type": "ui_tab",
        "name": "System",
        "icon": "dashboard",
        "order": 7,
        "disabled": false,
        "hidden": false
    },
    {
        "id": "2acb95821445c8af",
        "type": "ui_tab",
        "name": "Home",
        "icon": "dashboard",
        "order": 1,
        "disabled": false,
        "hidden": false
    }
]

```

---

<div class="post-metadata">

### Author: ![limago1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/limago1/32/87330_2.png) [@limago1](https://discourse.nodered.org/u/limago1)
#### Post date: [14 January 2024 21:21 UTC](https://discourse.nodered.org/t/share-of-regenerative-electricity-energie-chart-frauenhofer/83913/2 "2024-01-14T21:21:54Z")

</div>

Thanks for sharing this flow! In my idea I want to illuminate a living room bulb according to the signal color.  
I imported your nodes and stripped away the dashboard nodes. I riddled now for hours but I can't figure out why I'm getting only

> "RequestError: connect EHOSTUNREACH 192.107.235.120:443"

errors from the request. I had my network config in mind but is OK, API request via browser works also fine.

My small question torwards you is: do encounter any difficulties acessing the API via node red nowadays?

Thank you!

---

<div class="post-metadata">

### Author: ![WP-Rue](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wp-rue/32/87264_2.png) [@WP-Rue](https://discourse.nodered.org/u/WP-Rue)
#### Post date: [15 January 2024 16:24 UTC](https://discourse.nodered.org/t/share-of-regenerative-electricity-energie-chart-frauenhofer/83913/3 "2024-01-15T16:24:37Z")

</div>

> [@limago1](#):
>
> EHOSTUNREACH

Sorry I had no errors so far. Maybe you have config a too high request rate? Or do you have a firewall..?  
Good luck.

---

<div class="post-metadata">

### Author: ![limago1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/limago1/32/87330_2.png) [@limago1](https://discourse.nodered.org/u/limago1)
#### Post date: [15 January 2024 19:17 UTC](https://discourse.nodered.org/t/share-of-regenerative-electricity-energie-chart-frauenhofer/83913/4 "2024-01-15T19:17:07Z")

</div>

Thank you for the reply - it narrows the possibilities for error.  
Also my next guess is network traffic blocking inside my network. I'll check (again).

---

<div class="post-metadata">

### Author: ![juntiedt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juntiedt/32/58357_2.png) [@juntiedt](https://discourse.nodered.org/u/juntiedt)
#### Post date: [16 January 2024 12:12 UTC](https://discourse.nodered.org/t/share-of-regenerative-electricity-energie-chart-frauenhofer/83913/5 "2024-01-16T12:12:39Z")

</div>

Hi, I like your input very much. Interesting Information.  
I did some exercise with [https://energy-chsrts.info](https://energy-chsrts.info).  
Now it is up to dashboard specialists to make good looking graphics.

```auto
[{"id":"f1bddf75aa5337d8","type":"http request","z":"e973a865c2b93001","name":"Energie-Charts","method":"GET","ret":"obj","paytoqs":"body","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":540,"y":500,"wires":[["54aefef0a699ef9e"]]},{"id":"3f1afcf8b53a9c34","type":"inject","z":"e973a865c2b93001","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":500,"wires":[["8236414b3d6d850a","862d1403bfd9fa35"]]},{"id":"54aefef0a699ef9e","type":"function","z":"e973a865c2b93001","name":"function 164","func":"let aktualisierung = moment( ).tz(\"Europe/Berlin\").format(\"DD-MM-YYYY HH:mm:ss\");\nlet data_array = [];\nlet len = msg.payload.unix_seconds.length;\n\nfor (let i = 0; i < len; i++) {\n let t_string = moment(msg.payload.unix_seconds[i] * 1000).tz(\"Europe/Berlin\").format(\"DD-MM-YYYY HH:mm:ss\");\n let sha = msg.payload.share[i];\n let sig = msg.payload.signal[i];\n\n data_array[0] = msg.payload.unix_seconds[i];\n data_array[1] = t_string;\n data_array[2] = sha;\n data_array[3] = parseFloat((100 - sha).toFixed(1));\n data_array[4] = sig;\n data_array[5] = sig_txt(sig);\n data_array[6] = sig_color(sig); \n data_array[7] = msg.payload.substitute;\n data_array[8] = aktualisierung; \n \n node.send([{ payload: msg.payload.unix_seconds[i] },\n { payload: t_string },\n { payload:sha },\n { payload: parseFloat((100 - sha).toFixed(1)) }, \n { payload:sig },\n { payload: sig_txt(sig) },\n { payload: sig_color(sig) }, \n { payload:msg.payload.substitute },\n { payload: aktualisierung },\n { payload:data_array } \n ]);\n};\nreturn null;\n\n\nfunction sig_txt(n){\n if (n === -1){\n return \"grid congestion\";\n }\n else if (n === 0){\n return \"low renewable share\";\n }\n else if (n === 1) {\n return \"average renewable share\";\n }\n else if (n === 2) {\n return \"high renewable share\";\n } \n else return \"Signal unknown\"; \n}\n\nfunction sig_color(n) {\n if (n === -1) {\n return \"red\";\n }\n else if (n === 0) {\n return \"orange\";\n }\n else if (n === 1) {\n return \"yellow\";\n }\n else if (n === 2) {\n return \"green\";\n }\n else return \"Color unknown\";\n}","outputs":10,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"},{"var":"momentTimezone","module":"moment-timezone"}],"x":730,"y":500,"wires":[["c099d35b046148e9"],["95215d5284d6e494"],["bcb5d8481bee98d6","4e37a222b7b0ce9f"],["5b996e28c17f0ed9"],["4228528078780804"],["cfe9b58bdd851037"],["6eccfdce5b083a3d"],["31953f1bc24080a3"],["6b64aee93efde966"],["3cccf2fc633ffaf8"]]},{"id":"95215d5284d6e494","type":"debug","z":"e973a865c2b93001","name":"debug x2","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":980,"y":360,"wires":[]},{"id":"5b996e28c17f0ed9","type":"debug","z":"e973a865c2b93001","name":"debug x4","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":980,"y":440,"wires":[]},{"id":"4228528078780804","type":"debug","z":"e973a865c2b93001","name":"debug x5","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":980,"y":480,"wires":[]},{"id":"cfe9b58bdd851037","type":"debug","z":"e973a865c2b93001","name":"debug x6","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":980,"y":520,"wires":[]},{"id":"c099d35b046148e9","type":"debug","z":"e973a865c2b93001","name":"debug x1","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":980,"y":320,"wires":[]},{"id":"6eccfdce5b083a3d","type":"debug","z":"e973a865c2b93001","name":"debug x7","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":980,"y":560,"wires":[]},{"id":"31953f1bc24080a3","type":"debug","z":"e973a865c2b93001","name":"debug x8","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":980,"y":600,"wires":[]},{"id":"8236414b3d6d850a","type":"change","z":"e973a865c2b93001","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"https://api.energy-charts.info/signal?country=de&postal_code=89343","tot":"str"},{"t":"set","p":"count","pt":"flow","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":500,"wires":[["f1bddf75aa5337d8"]]},{"id":"bcb5d8481bee98d6","type":"debug","z":"e973a865c2b93001","name":"debug x3","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":980,"y":400,"wires":[]},{"id":"6b64aee93efde966","type":"debug","z":"e973a865c2b93001","name":"debug x9","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":980,"y":640,"wires":[]},{"id":"3cccf2fc633ffaf8","type":"debug","z":"e973a865c2b93001","name":"debug x10","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":990,"y":680,"wires":[]},{"id":"28b88c058eb61ef8","type":"ui_chart","z":"e973a865c2b93001","name":"Green Energy","group":"1d3119656d7b59a6","order":29,"width":0,"height":0,"label":"Green energy (one bar every 15 min)","chartType":"bar","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"110","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":true,"useUTC":false,"colors":["#aef9af","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":1360,"y":400,"wires":[[]]},{"id":"4e37a222b7b0ce9f","type":"function","z":"e973a865c2b93001","name":"function 165","func":"let z = flow.get('count') + 1;\nflow.set('count', z );\nreturn { label:z, payload: msg.payload };\n\n","outputs":1,"timeout":0,"noerr":0,"initialize":"// Der Code hier wird ausgeführt,\n// wenn der Node gestartet wird","finalize":"","libs":[],"x":1170,"y":400,"wires":[["28b88c058eb61ef8"]]},{"id":"862d1403bfd9fa35","type":"function","z":"e973a865c2b93001","name":"reset/init","func":"return({ payload: [] });","outputs":1,"timeout":0,"noerr":0,"initialize":"// Der Code hier wird ausgeführt,\n// wenn der Node gestartet wird\nnode.send({payload:[]});","finalize":"","libs":[],"x":340,"y":540,"wires":[["a63db9465a12fe1a"]]},{"id":"a63db9465a12fe1a","type":"link out","z":"e973a865c2b93001","name":"reset-out","mode":"link","links":["83dcb6769e812448"],"x":435,"y":540,"wires":[]},{"id":"83dcb6769e812448","type":"link in","z":"e973a865c2b93001","name":"reset-in","links":["a63db9465a12fe1a"],"x":1225,"y":440,"wires":[["28b88c058eb61ef8"]]},{"id":"1d3119656d7b59a6","type":"ui_group","name":"green energy","tab":"8957e5cd1f4df0d4","order":1,"disp":true,"width":"25","collapse":false,"className":""},{"id":"8957e5cd1f4df0d4","type":"ui_tab","name":"Bar Test","icon":"dashboard","order":16,"disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

### Author: ![WP-Rue](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wp-rue/32/87264_2.png) [@WP-Rue](https://discourse.nodered.org/u/WP-Rue)
#### Post date: [29 January 2024 19:13 UTC](https://discourse.nodered.org/t/share-of-regenerative-electricity-energie-chart-frauenhofer/83913/6 "2024-01-29T19:13:29Z")

</div>

I import your flow and had a complete timeout, if I deploy...!!!

---

<div class="post-metadata">

### Author: ![juntiedt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juntiedt/32/58357_2.png) [@juntiedt](https://discourse.nodered.org/u/juntiedt)
#### Post date: [30 January 2024 16:11 UTC](https://discourse.nodered.org/t/share-of-regenerative-electricity-energie-chart-frauenhofer/83913/7 "2024-01-30T16:11:50Z")

</div>

Hi WP-Rue,

load these nodes into a fresh, empty flow. Then check your dashboard. There have to be a chart and a button.  
This should look like this.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/3/93fd96f2b0c5f801f183b36691792a2730290cd7.png)

```auto
[{"id":"3f1afcf8b53a9c34","type":"inject","z":"e973a865c2b93001","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":540,"wires":[["8236414b3d6d850a","862d1403bfd9fa35"]]},{"id":"54aefef0a699ef9e","type":"function","z":"e973a865c2b93001","name":"function 164","func":"const aktualisierung = moment( ).tz(\"Europe/Berlin\").format(\"DD-MM-YYYY HH:mm:ss\");\nconst len = msg.payload.unix_seconds.length;\nconst data_array = [];\n\nfor (let i = 0; i < len; i++) {\n const t_string = moment(msg.payload.unix_seconds[i] * 1000).tz(\"Europe/Berlin\").format(\"DD-MM-YYYY HH:mm:ss\");\n const sha = msg.payload.share[i];\n const sig = msg.payload.signal[i];\n\n data_array[0] = msg.payload.unix_seconds[i];\n data_array[1] = t_string;\n data_array[2] = sha;\n data_array[3] = parseFloat((100 - sha).toFixed(1));\n data_array[4] = sig;\n data_array[5] = sig_txt(sig);\n data_array[6] = sig_color(sig); \n data_array[7] = msg.payload.substitute;\n data_array[8] = aktualisierung; \n \n node.send([{ payload: msg.payload.unix_seconds[i] },\n { payload: t_string },\n { payload:sha },\n { payload: parseFloat((100 - sha).toFixed(1)) }, \n { payload:sig },\n { payload: sig_txt(sig) },\n { payload: sig_color(sig) }, \n { payload:msg.payload.substitute },\n { payload: aktualisierung },\n { payload:data_array } \n ]);\n};\nreturn null;\n\n//--------------------------------------------------------------------------\n\nfunction sig_txt(n){\n if (n === -1){\n return \"grid congestion\";\n }\n else if (n === 0){\n return \"low renewable share\";\n }\n else if (n === 1) {\n return \"average renewable share\";\n }\n else if (n === 2) {\n return \"high renewable share\";\n } \n else return \"Signal unknown\"; \n}\n\n//--------------------------------------------------------------------------\n\nfunction sig_color(n) {\n if (n === -1) {\n return \"red\";\n }\n else if (n === 0) {\n return \"orange\";\n }\n else if (n === 1) {\n return \"yellow\";\n }\n else if (n === 2) {\n return \"green\";\n }\n else return \"Color unknown\";\n}\n\n//--------------------------------------------------------------------------","outputs":10,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"},{"var":"momentTimezone","module":"moment-timezone"}],"x":730,"y":500,"wires":[["c099d35b046148e9"],["95215d5284d6e494"],["bcb5d8481bee98d6","4208940eacbd2762"],["5b996e28c17f0ed9"],["4228528078780804"],["cfe9b58bdd851037"],["6eccfdce5b083a3d"],["31953f1bc24080a3"],["6b64aee93efde966"],["3cccf2fc633ffaf8"]]},{"id":"95215d5284d6e494","type":"debug","z":"e973a865c2b93001","name":"debug x2","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":980,"y":360,"wires":[]},{"id":"5b996e28c17f0ed9","type":"debug","z":"e973a865c2b93001","name":"debug x4","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":980,"y":440,"wires":[]},{"id":"4228528078780804","type":"debug","z":"e973a865c2b93001","name":"debug x5","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":980,"y":480,"wires":[]},{"id":"cfe9b58bdd851037","type":"debug","z":"e973a865c2b93001","name":"debug x6","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":980,"y":520,"wires":[]},{"id":"c099d35b046148e9","type":"debug","z":"e973a865c2b93001","name":"debug x1","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":980,"y":320,"wires":[]},{"id":"6eccfdce5b083a3d","type":"debug","z":"e973a865c2b93001","name":"debug x7","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":980,"y":560,"wires":[]},{"id":"31953f1bc24080a3","type":"debug","z":"e973a865c2b93001","name":"debug x8","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":980,"y":600,"wires":[]},{"id":"1e979cd535f7aad4","type":"link call","z":"e973a865c2b93001","name":"http-request-in 1","links":["d59a2325dd14c795"],"linkType":"static","timeout":"90","x":540,"y":500,"wires":[["54aefef0a699ef9e"]]},{"id":"8236414b3d6d850a","type":"change","z":"e973a865c2b93001","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"https://api.energy-charts.info/signal?country=de&postal_code=89343","tot":"str"},{"t":"set","p":"count","pt":"flow","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":500,"wires":[["1e979cd535f7aad4"]]},{"id":"bcb5d8481bee98d6","type":"debug","z":"e973a865c2b93001","name":"debug x3","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":980,"y":400,"wires":[]},{"id":"6b64aee93efde966","type":"debug","z":"e973a865c2b93001","name":"debug x9","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":980,"y":640,"wires":[]},{"id":"3cccf2fc633ffaf8","type":"debug","z":"e973a865c2b93001","name":"debug x10","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":990,"y":680,"wires":[]},{"id":"28b88c058eb61ef8","type":"ui_chart","z":"e973a865c2b93001","name":"Green Energy","group":"1d3119656d7b59a6","order":1,"width":0,"height":0,"label":"Green energy (one bar every 15 min starting from load)","chartType":"bar","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"150","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":true,"useUTC":false,"colors":["#aef9af","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":1360,"y":400,"wires":[[]]},{"id":"4e37a222b7b0ce9f","type":"function","z":"e973a865c2b93001","name":"function 165","func":"let z = flow.get('count') + 1;\nflow.set('count', z );\nreturn { label:z, payload: msg.payload };\n\n","outputs":1,"timeout":0,"noerr":0,"initialize":"// Der Code hier wird ausgeführt,\n// wenn der Node gestartet wird","finalize":"","libs":[],"x":1170,"y":400,"wires":[["28b88c058eb61ef8"]]},{"id":"862d1403bfd9fa35","type":"function","z":"e973a865c2b93001","name":"reset/init","func":"return({ payload: [] });","outputs":1,"timeout":0,"noerr":0,"initialize":"// Der Code hier wird ausgeführt,\n// wenn der Node gestartet wird\nnode.send({payload:[]});","finalize":"","libs":[],"x":320,"y":540,"wires":[["a63db9465a12fe1a"]]},{"id":"a63db9465a12fe1a","type":"link out","z":"e973a865c2b93001","name":"reset-out","mode":"link","links":["83dcb6769e812448"],"x":415,"y":540,"wires":[]},{"id":"83dcb6769e812448","type":"link in","z":"e973a865c2b93001","name":"reset-in","links":["a63db9465a12fe1a"],"x":1225,"y":440,"wires":[["28b88c058eb61ef8"]]},{"id":"f33e7b54ef289ecd","type":"ui_button","z":"e973a865c2b93001","name":"","group":"1d3119656d7b59a6","order":2,"width":0,"height":0,"passthru":false,"label":"start loading","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":150,"y":500,"wires":[["8236414b3d6d850a","862d1403bfd9fa35"]]},{"id":"4208940eacbd2762","type":"junction","z":"e973a865c2b93001","x":920,"y":400,"wires":[["4e37a222b7b0ce9f"]]},{"id":"1d3119656d7b59a6","type":"ui_group","name":"green energy","tab":"8957e5cd1f4df0d4","order":1,"disp":true,"width":"25","collapse":false,"className":""},{"id":"8957e5cd1f4df0d4","type":"ui_tab","name":"Bar Test","icon":"dashboard","order":16,"disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

### Author: ![juntiedt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juntiedt/32/58357_2.png) [@juntiedt](https://discourse.nodered.org/u/juntiedt)
#### Post date: [30 January 2024 19:18 UTC](https://discourse.nodered.org/t/share-of-regenerative-electricity-energie-chart-frauenhofer/83913/8 "2024-01-30T19:18:14Z")

</div>

Hi, I just found that I have a link node (http-request-in 1) in my flow wich you should replace with an http request node in order to get the right data.

---

<div class="post-metadata">

### Author: ![WP-Rue](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wp-rue/32/87264_2.png) [@WP-Rue](https://discourse.nodered.org/u/WP-Rue)
#### Post date: [13 December 2024 21:48 UTC](https://discourse.nodered.org/t/share-of-regenerative-electricity-energie-chart-frauenhofer/83913/9 "2024-12-13T21:48:49Z")

</div>

[https://flows.nodered.org/node/node-red-contrib-energy-charts](https://flows.nodered.org/node/node-red-contrib-energy-charts)  
There could be an update in the future..(Just see, not my work)
