Cerbo gx - Node red persistent variables

today i updatet to 3.50, but now the persistent variables are not anymore at all persistent… Few are, but not all. I turn on this feature in settings.js, also now in venussettings.js. What is changed in 3.50?

According to this,
https://communityarchive.victronenergy.com/questions/155949/node-red-config-files.html

you should be using:

  1. /data/home/nodered/.node-red/settings-user.js is used to override and/or extend the second file and will survive Venus OS updates. You are allowed to edit this file if you please, but don’t be too surprised if that causes Node-RED to break after an upgrade.

I read this allready, but i don’t have such file there, only config.users.json but there is nothing to uncommend. Should i insert there?
I noticed that the context is saved right, but the ui-control dont remember anymore the value.

@andreask, did you ever get an answer regarding persistent context variables? I have search and found that the information about the locating of the settings file is dated and wrong in the newest software.

I hate to start a new topic if this has been answered recently.

I have been struggling with this one too. After much digging I found the settings.js file in the folder root@einstein:/usr/lib/node_modules/node-red. I edited the file to un-comment the relevant part but context variables still don’t seem to persist. i.e. the option is not there in the change node.

Has anyone done this successfully on the Cerbo GX??

@SimonGrey , I ran into this and was not finding a solution. Then I talked to a friend who was also doing some programming and he suggested that I try an Ai program.

I do not consider myself a programmer but I am learning. I tried my friends suggestion and the Ai bot suggested this Java Script change to the Setting.js file.

First, backup your setting.js file. I did not do this the first time and I created my own headaches.
Second, do not delete the stock software. I left it commented out.

I added this code:

contextStorage: {
default: {
module: “memory”
},
file: {
module: “localfilesystem”
},
},

I have been using this code in my settings.js file for about a week and I have one persistent variable that is being written to and read from my RPI 5.

I found the storage location under '~/.node-re

d/context/global’ and the file name was global.json. When I do a ‘cat global.json’ I get
{
“g13_originalShorePower”: 26
}

In my flows, I have been using
global.set(‘g13_originalShorePower’ , some_value, ‘file’)
to store a value and
global.get(‘g13_originalShorePower’ , ‘file’)
to retrieve the value.

I hope that this helps.

Hello,
Was just wondering what the status of this is too.
Anyone using this, are these instructions still valid:

I also need this, I’m going to change settings.js for now

Hello @JeroenSt
If you test the contextStorage part that is commented out in current Venus OS Large, I would certainly appreciate a comment. Will try it out in the coming week also on a remote off-grid system. If I dare that is :wink:

I decided not to go this way, because after an update I might lose (long term) context data.

I thought one of the pretty clear points was that this file is not altered by updates. Do you have other info? Many thanks.

I don’t have other info, it’s just an assumption.

This seems to be a bit of an older thread, but the process described here still is accurate.

The part on the configuration files (Venus OS Large image: Signal K and Node-RED [Victron Energy]) is also still valid:

If you don’t have the /data/home/nodered/.node-red/settings-user.js file yet, you can safely create it. It will be read by restart of Node-RED if it exists.

Thanks @dfaber !
..and great timing as I had time to test this on an off-grid system that I rarely visit, so I can confirm that it appears to work as expected with a Cerbo GX and Venus OS Large 3.62
FWIW. Many thanks.

So will this file:
/data/home/nodered/.node-red/settings-user.js
survive updates of Venus OS Large? Many thanks.