That's cool. I am mostly using Grafana for visualisation, but good to know that NR can do stuff like that as well.
I am still struggling. I did set up those mock nodes and they do seem to work, but not sure what I did but now when I actually do the API call I do get two arrays that were actually renamed to forecasts_east and _west, but whenever I then use the mock nodes to send the same messages again, all I get is two empty arrays? So it's working when not using the mock nodes. Unfortunately, I only have two API calls left
Here is my current flow, still a long long way to go. Not sure if that's the correct way to rename the arrays. I also wasn't able to actually copy one of the arrays to a new third array, but I guess I will manage to get that to work once I am able to reliably resend messages with the mock nodes. Do you know what I could be doing wrong here?
[
{
"id": "a5cb0f26a080725b",
"type": "http request",
"z": "457f9988695be7c4",
"name": "Solcast API - get Live+Forecast JSON EAST",
"method": "GET",
"ret": "obj",
"paytoqs": "ignore",
"url": "https://api.solcast.com.au/rooftop_sites/XXXXXXXXXXXX",
"tls": "",
"persist": false,
"proxy": "",
"authType": "basic",
"senderr": false,
"x": 630,
"y": 460,
"wires": [
[
"786e5f423ffa7593"
]
]
},
{
"id": "c0e0319e8b59c5ca",
"type": "debug",
"z": "457f9988695be7c4",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1210,
"y": 740,
"wires": []
},
{
"id": "5cc54dd022077d84",
"type": "http request",
"z": "457f9988695be7c4",
"name": "Solcast API - get Past + Estimated Actuals EAST",
"method": "GET",
"ret": "obj",
"paytoqs": "ignore",
"url": "https://api.solcast.com.au/rooftop_sites/XXXXXXXXXXXXXX",
"tls": "",
"persist": false,
"proxy": "",
"authType": "basic",
"senderr": false,
"x": 640,
"y": 420,
"wires": [
[
"786e5f423ffa7593"
]
]
},
{
"id": "786e5f423ffa7593",
"type": "switch",
"z": "457f9988695be7c4",
"name": "StatusCode",
"property": "statusCode",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "200",
"vt": "num"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 950,
"y": 380,
"wires": [
[
"78d8d2fbb49c79ab"
],
[
"c0e0319e8b59c5ca",
"43c89b64564876f0"
]
]
},
{
"id": "43c89b64564876f0",
"type": "change",
"z": "457f9988695be7c4",
"name": "timestamp",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "",
"tot": "date"
},
{
"t": "delete",
"p": "statusCode",
"pt": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1170,
"y": 380,
"wires": [
[
"e132cc1dd6f953de"
]
]
},
{
"id": "e132cc1dd6f953de",
"type": "delay",
"z": "457f9988695be7c4",
"name": "",
"pauseType": "delay",
"timeout": "3",
"timeoutUnits": "minutes",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"outputs": 1,
"x": 1380,
"y": 380,
"wires": [
[]
]
},
{
"id": "5783efa521601e69",
"type": "inject",
"z": "457f9988695be7c4",
"name": "forecasts",
"props": [
{
"p": "payload",
"v": "",
"vt": "date"
},
{
"p": "topic",
"v": "forecasts",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "forecasts",
"payload": "",
"payloadType": "date",
"x": 106,
"y": 1015,
"wires": [
[
"cbda7ba3f1b5dd8c"
]
]
},
{
"id": "6fba0be572ad1fcc",
"type": "change",
"z": "457f9988695be7c4",
"name": "reset counter",
"rules": [
{
"t": "set",
"p": "reset",
"pt": "msg",
"to": "true",
"tot": "bool"
},
{
"t": "set",
"p": "topic.reset",
"pt": "msg",
"to": "reset",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 450,
"y": 899,
"wires": [
[
"cbda7ba3f1b5dd8c"
]
]
},
{
"id": "647d5a3b47463e70",
"type": "switch",
"z": "457f9988695be7c4",
"name": "counter",
"property": "count",
"propertyType": "msg",
"rules": [
{
"t": "btwn",
"v": "1",
"vt": "num",
"v2": "50",
"v2t": "num"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 969,
"y": 739,
"wires": [
[
"2dc5dceec8bc5fe5"
],
[
"c0e0319e8b59c5ca"
]
]
},
{
"id": "c8a0bcb16c3e26a7",
"type": "change",
"z": "457f9988695be7c4",
"name": "",
"rules": [
{
"t": "delete",
"p": "reset",
"pt": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 907,
"y": 899,
"wires": [
[
"647d5a3b47463e70"
]
]
},
{
"id": "78d8d2fbb49c79ab",
"type": "switch",
"z": "457f9988695be7c4",
"name": "",
"property": "topic",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "estimated_actuals",
"vt": "str"
},
{
"t": "eq",
"v": "forecasts",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 1150,
"y": 200,
"wires": [
[],
[
"5b41b7be8a1ce405"
]
]
},
{
"id": "6c397fa8917f9a86",
"type": "inject",
"z": "457f9988695be7c4",
"name": "tägl. 02:00Uhr",
"props": [
{
"p": "payload",
"v": "",
"vt": "date"
},
{
"p": "topic",
"v": "Counter_Reset",
"vt": "str"
}
],
"repeat": "",
"crontab": "00 02 * * *",
"once": false,
"onceDelay": 0.1,
"topic": "Counter_Reset",
"payload": "",
"payloadType": "date",
"x": 127,
"y": 861,
"wires": [
[
"ec6877f94fdbf330"
]
]
},
{
"id": "2dc5dceec8bc5fe5",
"type": "switch",
"z": "457f9988695be7c4",
"name": "topic",
"property": "topic",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "estimated_actuals",
"vt": "str"
},
{
"t": "eq",
"v": "forecasts",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 350,
"y": 480,
"wires": [
[
"5cc54dd022077d84",
"23605978e56b965d"
],
[
"a5cb0f26a080725b",
"62e234f625a2a02a"
]
]
},
{
"id": "b1f52ecbb1c743c5",
"type": "inject",
"z": "457f9988695be7c4",
"name": "estimated_actuals",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "estimated_actuals",
"payload": "",
"payloadType": "date",
"x": 135,
"y": 1073,
"wires": [
[]
]
},
{
"id": "39febf8dd840c45e",
"type": "comment",
"z": "457f9988695be7c4",
"name": "Manuelle Abfragen",
"info": "",
"x": 126,
"y": 975,
"wires": []
},
{
"id": "58231316133afbbb",
"type": "comment",
"z": "457f9988695be7c4",
"name": "Zeitgesteuerte Abfragen",
"info": "",
"x": 120,
"y": 300,
"wires": []
},
{
"id": "3e4d03c3c94e9d0d",
"type": "comment",
"z": "457f9988695be7c4",
"name": "API abfragen",
"info": "",
"x": 590,
"y": 380,
"wires": []
},
{
"id": "b1a608779bbca9bf",
"type": "comment",
"z": "457f9988695be7c4",
"name": "50 API-Calls pro Tag möglich",
"info": "",
"x": 865,
"y": 860,
"wires": []
},
{
"id": "2e79f304435b99b2",
"type": "comment",
"z": "457f9988695be7c4",
"name": "Reset counter",
"info": "",
"x": 110,
"y": 820,
"wires": []
},
{
"id": "817124037088499e",
"type": "inject",
"z": "457f9988695be7c4",
"name": "Counter_Reset",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "Counter_Reset",
"payload": "",
"payloadType": "date",
"x": 126,
"y": 898,
"wires": [
[
"6fba0be572ad1fcc"
]
]
},
{
"id": "4feaa555ebe704cb",
"type": "debug",
"z": "457f9988695be7c4",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "count",
"targetType": "msg",
"statusVal": "count",
"statusType": "auto",
"x": 880,
"y": 960,
"wires": []
},
{
"id": "cbda7ba3f1b5dd8c",
"type": "counter",
"z": "457f9988695be7c4",
"name": "Counter",
"init": "0",
"step": "1",
"lower": null,
"upper": null,
"mode": "increment",
"outputs": "1",
"x": 719,
"y": 899,
"wires": [
[
"c8a0bcb16c3e26a7",
"4feaa555ebe704cb"
]
]
},
{
"id": "69982da8785adefe",
"type": "time-inject",
"z": "457f9988695be7c4",
"name": "forecasts",
"nameInt": "Sonnenaufgang Beginn↶ - Sonnenuntergang Ende↷ =... ↻150min",
"positionConfig": "8c7609ce.dd5798",
"props": [
{
"p": "",
"pt": "msgPayload",
"v": "",
"vt": "date",
"o": "1",
"oT": "none",
"oM": "60000",
"f": 0,
"fS": 0,
"fT": "Millisekunden UNIX-Zeit",
"fI": "0",
"next": true,
"days": "*",
"months": "*",
"onlyOddDays": false,
"onlyEvenDays": false,
"onlyOddWeeks": false,
"onlyEvenWeeks": false
},
{
"p": "",
"pt": "msgTopic",
"v": "forecasts",
"vt": "str",
"o": "1",
"oT": "none",
"oM": "60000",
"f": 0,
"fS": 0,
"fT": "Millisekunden UNIX-Zeit",
"fI": "0",
"next": false,
"days": "*",
"months": "*",
"onlyOddDays": false,
"onlyEvenDays": false,
"onlyOddWeeks": false,
"onlyEvenWeeks": false
}
],
"injectTypeSelect": "interval-time",
"intervalCount": "150",
"intervalCountType": "num",
"intervalCountMultiplier": 60000,
"time": "sunriseStart",
"timeType": "pdsTime",
"offset": "-15",
"offsetType": "num",
"offsetMultiplier": 60000,
"timeEnd": "sunsetEnd",
"timeEndType": "pdsTime",
"timeEndOffset": "15",
"timeEndOffsetType": "num",
"timeEndOffsetMultiplier": 60000,
"timeDays": "*",
"timeOnlyOddDays": false,
"timeOnlyEvenDays": false,
"timeOnlyOddWeeks": false,
"timeOnlyEvenWeeks": false,
"timeMonths": "*",
"timedatestart": "",
"timedateend": "",
"property": "",
"propertyType": "none",
"propertyCompare": "true",
"propertyThreshold": "",
"propertyThresholdType": "num",
"timeAlt": "",
"timeAltType": "entered",
"timeAltDays": "*",
"timeAltOnlyOddDays": false,
"timeAltOnlyEvenDays": false,
"timeAltOnlyOddWeeks": false,
"timeAltOnlyEvenWeeks": false,
"timeAltMonths": "*",
"timeAltOffset": 0,
"timeAltOffsetType": "none",
"timeAltOffsetMultiplier": 60000,
"once": false,
"onceDelay": 0.1,
"recalcTime": 2,
"x": 100,
"y": 380,
"wires": [
[]
]
},
{
"id": "a6859388b3b826d8",
"type": "time-inject",
"z": "457f9988695be7c4",
"name": "estimated_actuals",
"nameInt": "Sonnenaufgang Beginn↷ - Sonnenuntergang Ende↷ =... ↻4h",
"positionConfig": "8c7609ce.dd5798",
"props": [
{
"p": "",
"pt": "msgPayload",
"v": "",
"vt": "date",
"o": "1",
"oT": "none",
"oM": "60000",
"f": 0,
"fS": 0,
"fT": "Millisekunden UNIX-Zeit",
"fI": "0",
"next": true,
"days": "*",
"months": "*",
"onlyOddDays": false,
"onlyEvenDays": false,
"onlyOddWeeks": false,
"onlyEvenWeeks": false
},
{
"p": "",
"pt": "msgTopic",
"v": "estimated_actuals",
"vt": "str",
"o": "1",
"oT": "none",
"oM": "60000",
"f": 0,
"fS": 0,
"fT": "Millisekunden UNIX-Zeit",
"fI": "0",
"next": false,
"days": "*",
"months": "*",
"onlyOddDays": false,
"onlyEvenDays": false,
"onlyOddWeeks": false,
"onlyEvenWeeks": false
}
],
"injectTypeSelect": "interval-time",
"intervalCount": "4",
"intervalCountType": "num",
"intervalCountMultiplier": 3600000,
"time": "sunriseStart",
"timeType": "pdsTime",
"offset": "90",
"offsetType": "num",
"offsetMultiplier": 60000,
"timeEnd": "sunsetEnd",
"timeEndType": "pdsTime",
"timeEndOffset": "60",
"timeEndOffsetType": "num",
"timeEndOffsetMultiplier": 60000,
"timeDays": "*",
"timeOnlyOddDays": false,
"timeOnlyEvenDays": false,
"timeOnlyOddWeeks": false,
"timeOnlyEvenWeeks": false,
"timeMonths": "*",
"timedatestart": "",
"timedateend": "",
"property": "",
"propertyType": "none",
"propertyCompare": "true",
"propertyThreshold": "",
"propertyThresholdType": "num",
"timeAlt": "",
"timeAltType": "entered",
"timeAltDays": "*",
"timeAltOnlyOddDays": false,
"timeAltOnlyEvenDays": false,
"timeAltOnlyOddWeeks": false,
"timeAltOnlyEvenWeeks": false,
"timeAltMonths": "*",
"timeAltOffset": 0,
"timeAltOffsetType": "none",
"timeAltOffsetMultiplier": 60000,
"once": false,
"onceDelay": 0.1,
"recalcTime": 2,
"x": 130,
"y": 344,
"wires": [
[]
]
},
{
"id": "ec6877f94fdbf330",
"type": "within-time-switch",
"z": "457f9988695be7c4",
"name": "neuer Tag?",
"nameInt": "",
"positionConfig": "8c7609ce.dd5798",
"startTime": "sunriseStart",
"startTimeType": "pdsTime",
"startOffset": "-15",
"startOffsetType": "num",
"startOffsetMultiplier": 60000,
"endTime": "sunsetEnd",
"endTimeType": "pdsTime",
"endOffset": "60",
"endOffsetType": "num",
"endOffsetMultiplier": 60000,
"timeRestrictions": "",
"timeRestrictionsType": "none",
"timeDays": "*",
"timeOnlyOddDays": false,
"timeOnlyEvenDays": false,
"timeOnlyOddWeeks": false,
"timeOnlyEvenWeeks": false,
"timeMonths": "*",
"timedatestart": "",
"timedateend": "",
"propertyStart": "",
"propertyStartType": "none",
"propertyStartCompare": "true",
"propertyStartThreshold": "",
"propertyStartThresholdType": "num",
"startTimeAlt": "",
"startTimeAltType": "entered",
"startOffsetAlt": 0,
"startOffsetAltType": "none",
"startOffsetAltMultiplier": 60000,
"propertyEnd": "",
"propertyEndType": "none",
"propertyEndCompare": "true",
"propertyEndThreshold": "",
"propertyEndThresholdType": "num",
"endTimeAlt": "",
"endTimeAltType": "entered",
"endOffsetAlt": 0,
"endOffsetAltType": "none",
"endOffsetAltMultiplier": 60000,
"withinTimeValue": "",
"withinTimeValueType": "msgInput",
"outOfTimeValue": "",
"outOfTimeValueType": "msgInput",
"tsCompare": "0",
"x": 310,
"y": 760,
"wires": [
[
"cbda7ba3f1b5dd8c"
],
[
"6fba0be572ad1fcc"
]
]
},
{
"id": "62e234f625a2a02a",
"type": "http request",
"z": "457f9988695be7c4",
"name": "Solcast API - get Live+Forecast JSON WEST",
"method": "GET",
"ret": "obj",
"paytoqs": "ignore",
"url": "https://api.solcast.com.au/rooftop_sites/XXXXXXXXXXXXXXX",
"tls": "",
"persist": false,
"proxy": "",
"authType": "basic",
"senderr": false,
"x": 630,
"y": 540,
"wires": [
[
"50f9f1260a2a3cab"
]
]
},
{
"id": "23605978e56b965d",
"type": "http request",
"z": "457f9988695be7c4",
"name": "Solcast API - get Past + Estimated Actuals WEST",
"method": "GET",
"ret": "obj",
"paytoqs": "ignore",
"url": "https://api.solcast.com.au/rooftop_sites/XXXXXXXXXX",
"tls": "",
"persist": false,
"proxy": "",
"authType": "basic",
"senderr": false,
"x": 650,
"y": 500,
"wires": [
[
"50f9f1260a2a3cab"
]
]
},
{
"id": "50f9f1260a2a3cab",
"type": "switch",
"z": "457f9988695be7c4",
"name": "StatusCode",
"property": "statusCode",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "200",
"vt": "num"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 970,
"y": 560,
"wires": [
[
"080fa57b694d22f0"
],
[
"96fb7138c35bd826",
"c0e0319e8b59c5ca"
]
]
},
{
"id": "96fb7138c35bd826",
"type": "change",
"z": "457f9988695be7c4",
"name": "timestamp",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "",
"tot": "date"
},
{
"t": "delete",
"p": "statusCode",
"pt": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1230,
"y": 640,
"wires": [
[
"5e61daf7a3b261cc"
]
]
},
{
"id": "5e61daf7a3b261cc",
"type": "delay",
"z": "457f9988695be7c4",
"name": "",
"pauseType": "delay",
"timeout": "3",
"timeoutUnits": "minutes",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"outputs": 1,
"x": 1440,
"y": 640,
"wires": [
[]
]
},
{
"id": "080fa57b694d22f0",
"type": "switch",
"z": "457f9988695be7c4",
"name": "",
"property": "topic",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "estimated_actuals",
"vt": "str"
},
{
"t": "eq",
"v": "forecasts",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 1190,
"y": 500,
"wires": [
[],
[
"18b30938e9b171ea"
]
]
},
{
"id": "d546ea9a582551d0",
"type": "join",
"z": "457f9988695be7c4",
"name": "",
"mode": "custom",
"build": "array",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": false,
"timeout": "",
"count": "2",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 1870,
"y": 340,
"wires": [
[
"458232a4a5ef55e4"
]
]
},
{
"id": "458232a4a5ef55e4",
"type": "debug",
"z": "457f9988695be7c4",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 2350,
"y": 340,
"wires": []
},
{
"id": "18b30938e9b171ea",
"type": "mock",
"z": "457f9988695be7c4",
"name": "",
"x": 1370,
"y": 500,
"wires": [
[
"3a5f9fe881377a01"
]
]
},
{
"id": "5b41b7be8a1ce405",
"type": "mock",
"z": "457f9988695be7c4",
"name": "",
"x": 1350,
"y": 200,
"wires": [
[
"4eae59afbaad4281"
]
]
},
{
"id": "4eae59afbaad4281",
"type": "change",
"z": "457f9988695be7c4",
"name": "rename forecasts array (east)",
"rules": [
{
"t": "move",
"p": "payload.forecasts",
"pt": "msg",
"to": "payload.forecasts_east",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1630,
"y": 200,
"wires": [
[
"d546ea9a582551d0"
]
]
},
{
"id": "3a5f9fe881377a01",
"type": "change",
"z": "457f9988695be7c4",
"name": "rename forecasts array (west)",
"rules": [
{
"t": "move",
"p": "payload.forecasts",
"pt": "msg",
"to": "payload.forecasts_west",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1630,
"y": 500,
"wires": [
[
"d546ea9a582551d0"
]
]
},
{
"id": "8c7609ce.dd5798",
"type": "position-config",
"name": "DACH-1",
"isValide": "true",
"longitude": "0",
"latitude": "0",
"angleType": "deg",
"timeZoneOffset": 99,
"timeZoneDST": 0,
"stateTimeFormat": "3",
"stateDateFormat": "12",
"contextStore": ""
}
]
Edit: Just connected the mock nodes to the debug node, and it looks like the payload is empty. Not sure why?