Open kamcioo opened 2 years ago
It works with this example of the function lookAheadHours
(every injection one hour is added)
var hours = flow.get('hoursAhead');
if ( hours === undefined){
hours = 0;
} else{
hours += 1;
}
flow.set('hoursAhead', hours);
msg.payload = {lookAheadHours : hours};
return msg ;
test this if you like
[ { "id": "6bc9afaa58d466be", "type": "function", "z": "07cb8451f6f8c0c0", "name": "lookAheadHours", "func": "var hours = flow.get('hoursAhead');\nif ( hours === undefined){\n hours = 0;\n} else{\n hours += 1;\n }\nflow.set('hoursAhead', hours);\n\nmsg.payload = {lookAheadHours : hours};\nreturn msg ;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 450, "y": 220, "wires": [ [ "33eb9a8b57792fca" ] ] } ]
Hello,
unfortunately I can only one time get information from DWD after I change the content of the “Look Ahead Hours”. I get always this message after I have asked second time for the informations: MOSMIX request failed: TypeError: Cannot read properties of undefined (reading 'lookAheadHours')
Thank You in advance, kamil