# Parameter Dashboard

**URL:** <https://discourse.nodered.org/t/parameter-dashboard/42883>\
**Category:** General\
**Created:** [19 March 2021 13:35 UTC](https://discourse.nodered.org/t/parameter-dashboard/42883 "2021-03-19T13:35:37Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![eddee54455](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/eddee54455/32/43350_2.png) [@eddee54455](https://discourse.nodered.org/u/eddee54455)\
**Post date:** [19 March 2021 13:35 UTC](https://discourse.nodered.org/t/parameter-dashboard/42883/1 "2021-03-19T13:35:37Z")

</div>

Heyhey,,,

Here's a brain teaser for all you geniuses out there... Unfortunately I am not in this group!!

I am on the point of writing a "Parameter Dashboard" for my daft little setup....

My requirements are:  
Parameters to be easily accessible through drop down menus and sliders.(Pretty Easy)  
They must be written to a file when set/updated.  
They must have a "default safe value" should the parameter file not exist.(Not Difficult)  
The system must create the parameter file automatically in its "Default Location" wherever that may be and it should be a plain text file for easy external manipulation.  
The system should not only read the values on cold startup, but peek at them every so often to look for changes made externally.  
Any "New" parameters that come about due to system development should be appended to the setup file.

Now... The million dollar question! How would YOU go about it?

Cheers  
Ed

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [19 March 2021 13:52 UTC](https://discourse.nodered.org/t/parameter-dashboard/42883/2 "2021-03-19T13:52:59Z")

</div>

> [@eddee54455](#):
>
> The million dollar question! How would YOU go about it?

The 10¢ answer...

You play. You learn. You watch the thousands of tutorials. You read the forum. You get stuck. You pop back with a specific question. We answer the specific question. You move on. Rinse and repeat. 🙂

Clues....

- Look into (search) persistent context (for storage)
- install dashboard and drop some elements on screen.

Honestly, this is not as difficult as you imagine. Give stuff a go and you'll be flying in no time.

---

<div class="post-metadata">

**Author:** ![eddee54455](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/eddee54455/32/43350_2.png) [@eddee54455](https://discourse.nodered.org/u/eddee54455)\
**Post date:** [19 March 2021 14:38 UTC](https://discourse.nodered.org/t/parameter-dashboard/42883/3 "2021-03-19T14:38:35Z")

</div>

Thanks for the pointer, @Steve-Mci ..

Went into the "Working with context" pages and tried to set:

```auto
contextStorage: {
   default: "memoryOnly",
   memoryOnly: { module: 'memory' },
   file: { module: 'localfilesystem' }
}

```

I appended it to the end in the settings.js file... then did the inevitable node-red-restart to get things going...

Node red wouldn't restart/start until I removed those lines... Any Idea where I am going wrong?

Tia  
Ed

PS - as you probably guess, I am more than a little out of my league here!! (but I will get there!!)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [19 March 2021 14:48 UTC](https://discourse.nodered.org/t/parameter-dashboard/42883/4 "2021-03-19T14:48:41Z")

</div>

> [@eddee54455](#):
>
> `I appended it to the end in the settings.js file.`

Why didn't you use the section that is already there?

```auto
    // Context Storage
    // The following property can be used to enable context storage. The configuration
    // provided here will enable file-based context that flushes to disk every 30 seconds.
    // Refer to the documentation for further options: https://nodered.org/docs/api/context/
    //
    //contextStorage: {
    // default: {
    // module:"localfilesystem"
    // },
    //},

```

If you want to learn more, take a look at this thread: [A guide to understanding 'Persistent Context'](https://discourse.nodered.org/t/a-guide-to-understanding-persistent-context/4115)

---

<div class="post-metadata">

**Author:** ![eddee54455](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/eddee54455/32/43350_2.png) [@eddee54455](https://discourse.nodered.org/u/eddee54455)\
**Post date:** [19 March 2021 14:56 UTC](https://discourse.nodered.org/t/parameter-dashboard/42883/5 "2021-03-19T14:56:52Z")

</div>

The section isnt there... I have an early version settings file carried over from a few years back, but the NR et al has been upgraded to the latest...

I did read it, and its exactly what I am after... Just trying to get the sections "enabled"...

Regds  
Ed

---

<div class="post-metadata">

**Author:** ![eddee54455](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/eddee54455/32/43350_2.png) [@eddee54455](https://discourse.nodered.org/u/eddee54455)\
**Post date:** [19 March 2021 15:02 UTC](https://discourse.nodered.org/t/parameter-dashboard/42883/6 "2021-03-19T15:02:53Z")

</div>

My settings file is actually pretty basic:

```auto
/**
 * Originale latest version: https://raw.githubusercontent.com/node-red/node-red/master/settings.js
 **/

var fs = require("fs");
var i2c = require("i2c-bus");
var mySettings;
try {
	mySettings = require("/home/pi/.node-red/redvars.js");
} catch(err) {
	mySettings = {};
}

module.exports = {
    uiPort: process.env.PORT || 1880,
    mqttReconnectTime: 15000,
    serialReconnectTime: 15000,
    debugMaxLength: 1000,
    flowFile: 'flows.json',
    flowFilePretty: true,
    httpStatic: '/home/pi/.node-red/public',
    functionGlobalContext: {
        os:require('os'),
        moment:require('moment'),
        fs:require('fs'),
		i2c:require('i2c-bus'),
        mySettings:mySettings
    },
    logging: {
        console: {
            level: "info",
            metrics: false,
            audit: false
        }
    },
    adminAuth: 
//<Section Removed>

    editorTheme: { projects: { enabled: false }
    }

    // By default, credentials are encrypted in storage using a generated key. To
    // specify your own secret, set the following property.
    // If you want to disable encryption of credentials, set this property to false.
    // Note: once you set this property, do not change it - doing so will prevent
    // node-red from being able to decrypt your existing credentials and they will be
    // lost.
    //credentialSecret: "a-secret-key",

    //https: {
    // key: fs.readFileSync('privatekey.pem'),
    // cert: fs.readFileSync('certificate.pem')
    //},
    //requireHttps: true

    /* <Remarked this section out to keep going meantime>
     //* Context Storage
     //* The following property can be used to enable context storage. The configuration
     //* provided here will enable file-based context that flushes to disk every 30 seconds.
     //* Refer to the documentation for further options: https://nodered.org/docs/api/context/
     //* 
     //* Default is to use 'memory' only.
     //* 'memory' and 'localfilesystem' are both synchronous.
     //*
    contextStorage: {
        default: {
            module:'memory',
        },
        file: {
            module: 'localfilesystem',
            // config: {
            // flushInterval: '30', // default is 30s
            // },
        },
    },
    */
}

```

---

<div class="post-metadata">

**Author:** ![eddee54455](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/eddee54455/32/43350_2.png) [@eddee54455](https://discourse.nodered.org/u/eddee54455)\
**Post date:** [19 March 2021 15:09 UTC](https://discourse.nodered.org/t/parameter-dashboard/42883/7 "2021-03-19T15:09:46Z")

</div>

Node Js Version - v14.16.0  
Node Red 1.2.9  
Running Pi4 - 4gb

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [19 March 2021 15:49 UTC](https://discourse.nodered.org/t/parameter-dashboard/42883/8 "2021-03-19T15:49:42Z")

</div>

> [@eddee54455](#):
>
> Node red wouldn't restart/start until I removed those lines... Any Idea where I am going wrong?

If you look at the 2nd (full) settings.js posting you made, there is no comma `,` from the above section ending and the bit you added starting...

See here - your settings file MINUS the commented out parts...

```auto
module.exports = {
   // snipped out for brevity

    editorTheme: { projects: { enabled: false }
    } <<<<<< Missing comma

    contextStorage: {
        default: {
            module:'memory',
        },
        file: {
            module: 'localfilesystem',
            // config: {
            // flushInterval: '30', // default is 30s
            // },
        },
    },
    */
}

```

↑ look, no comma between `editorTheme` and `contextStorage`

---

<div class="post-metadata">

**Author:** ![eddee54455](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/eddee54455/32/43350_2.png) [@eddee54455](https://discourse.nodered.org/u/eddee54455)\
**Post date:** [19 March 2021 15:59 UTC](https://discourse.nodered.org/t/parameter-dashboard/42883/9 "2021-03-19T15:59:24Z")

</div>

Steve!!!!!!

Holy smoke.... I wouldn't have spotted that in a month of Sundays!!

Thanks ever so much!!

Now I can actually "experiment" with the file store parameters!! You are a star!!

Cheers  
Ed

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [2 April 2021 16:00 UTC](https://discourse.nodered.org/t/parameter-dashboard/42883/10 "2021-04-02T16:00:13Z")

</div>

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