So, off I go to settings.js. contextStorage not found
Looking.....
// Anything in this hash is globally available to all functions.
// It is accessed as context.global.
// eg:
// functionGlobalContext: { os:require('os') }
// can be accessed in a function block as:
// context.global.os
functionGlobalContext: {
// os:require('os'),
// octalbonescript:require('octalbonescript'),
// jfive:require("johnny-five"),
// j5board:require("johnny-five").Board({repl:false})
myDeviceName: "BedPi"
},
So we have gone from contextStorage to functionGlobalContext.
How do I set it up so context is stored in/on the filesystem?
(Just to check:)
(now things are getting vague for me)
I have seen some nodes talking about context (gate for instance) but then the switch/button node has no mention of this.
I want the switch (as in dashboard type) to get their previous state back if the machine is rebooted.
How old is the settings.js file?
It's easy to keep updating node-RED (which does not update the settings.js file), and then find that new options have been added which require a setting in the settings file.
Compare your settings file with the current version - available from github.
If you just want to add the context storage, just add & edit this, to your settings;
// Context Storage
// The following property can be used to enable context storage. The config$
// provided here will enable file-based context that flushes to disk every $
// Refer to the documentation for further options: https://nodered.org/docs$
//
//contextStorage: {
// default: {
// module:"localfilesystem"
// },
//},
// Anything in this hash is globally available to all functions.
// It is accessed as context.global.
// eg:
// functionGlobalContext: { os:require('os') }
// can be accessed in a function block as:
// context.global.os
functionGlobalContext: {
// os:require('os'),
// octalbonescript:require('octalbonescript'),
// jfive:require("johnny-five"),
// j5board:require("johnny-five").Board({repl:false})
myDeviceName: "BedPi"
},
Oh, is that more for global context rather than general context?
Ok, so I may not be actually doing the right thing then.
I'm not sure.
If I want the switch nodes to go back to the state they were in before an unexpected reboot, is that under this of which I am now asking - or that you showed me - or something else?
And other things as well.
Reboots can be painful if I am not here/on site.
I get that some things will default to things, but a lot of stuff I want to go back to how it was before the reboot.