Using environment variables (or other ways) to link values in settings of configuration nodes

I have developed a project that i will push out to multiple external devices. I am using an mqtt sparkplug node and i want to have a unique id (Sparkplug Name) for every device. Therefore I have been looking into env variables to make links to values within the configuration nodes.

I am able to use custom env variables in flows, but i am looking for a simple way to use custom env variables in configuration nodes. I am aware I can add to the settings.js file and restart node-red, but that requires more steps than just changing the configuration nodes manually. Is there a quick and simple way to link values into configuration nodes?

My best attempt has been to use ${USER} as a unique id (Sparkplug Name) and then changing the username for each raspberry pi, but that causes issues with the file structure in the raspberry pi that requires extra steps to fix.

If you are using latest node-red, there is a way to configure global environmental variables.

Alternatively, you can declare env vars in a tab or a group for greater portability.

Updating from 3.01 to 3.1 worked!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.