I'm following this path because I need to save other variables, and I've noticed that Node-RED restarts if I perform high-frequency polling. So, my idea is to save only the average of the variables every 15 minutes and store everything in a file.
There should be absolutely no difference between using memory or File store. Provided all uses of json-spooler
use the same store. If there is then you have found a bug, but I will be surprised if that is the case. I am often surprised of course.
I also thought the same thing, could you try and tell me what happens?
I have set 'memoryOnly' as the default.
[
{
"id": "d37250881c41a530",
"type": "change",
"z": "d7f10d595c72d8fa",
"name": "",
"rules": [
{
"t": "set",
"p": "json_spooler",
"pt": "flow",
"to": "[$flowContext('json_spooler') , msg.json_spooler]\t",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 700,
"y": 680,
"wires": [
[]
]
},
{
"id": "cb9710e6324880e9",
"type": "inject",
"z": "d7f10d595c72d8fa",
"name": "",
"props": [
{
"p": "json_spooler",
"v": "test",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 470,
"y": 680,
"wires": [
[
"d37250881c41a530"
]
]
}
]
The problem is that the array always looks for the 'memoryOnly' variable.
Please check if you can solve this short flow.
If i understand correctly $flowContext(string[, string])
takes a second optional argumnet, the store, just like the JS flow.get().
I can't, in the end I'll settle for the change node