Supergiovane / node-red-contrib-knx-ultimate

Control your KNX intallation via Node-Red! A bunch of KNX nodes, with integrated Philips HUE control and ETS group address importer.
https://youtu.be/egRbR_KwP9I
MIT License
141 stars 34 forks source link

Context Store of KNX Ultimate #248

Closed gtnscebba closed 1 year ago

gtnscebba commented 1 year ago

Hello, how are you?

My request is for an enhancement.

Many variables in my Node Red project, that are in the context store (global and flow), are in a "default" container that goes on the filesystem. Since I use a Raspberry PI I'm optimizing the accesses to the microSD; I then created a container which I called "RAM" which goes in memory. I use it for all those variables (global and flow) that I don't care to "survive" at NodeRed restart. I use KNX Ultimate (very very satisfied) and I also use the "KNX Global Context node" a lot which though (unless my mistake) it doesn't allow me to choose the container, it just goes into the "default" global context and then onto the file system. Is there the possibility of being able to choose the container in which to insert it? If yes, I will certainly put it in memory since it makes no sense to have the values valid at Node Red restart. I hope for a positive response.

Supergiovane commented 1 year ago

Ciao Gaetano. with "container", are you referring to a docker container, or what?

gtnscebba commented 1 year ago

Ciao Massimo, no, I'm referring to the standard of NodeRed. As you know, in NR you can create many containers for the context store, described in "setting.js". For me, it is: contextStorage: { default: { module:"localfilesystem" }, RAM: { module:"memory" } } The context store "default" goes to the filesystem and each variabile in this context, will survive at Node Red startup. The context store "RAM" goes in memory and each variabile defined here, dies (you must recreate in the flow). If you don't specify anything at the call, NR uses "default". If you want use "RAM" container at the call you must issue

var mia_var = global.set("MIA-VAR", xx, "RAM"). (for example)

In this mode you "protect" the microSD of the Raspberry PI from a useless load. I hope now is more clear my request. Ciao!

Supergiovane commented 1 year ago

Ciao Gaetano Ok, understood. Never used such container option. I've used once an industrial grade SD-Card instead. Let me ditch into that. I'll keep you informed.

Supergiovane commented 1 year ago

Archivio.zip

Ciao Gaetano can you unzip the file into the pi/.node-red/node_modules/node-red-contrib-knx-ultimate/nodes folder and restart node-red? You can specify the context data store name, in the config window. Please let me know if it works.

gtnscebba commented 1 year ago

Hi, I have unzipped the 2 objects in the destination (I've backed up the previuous :-) ). However, I did not understand how to modify the name/location. In the config window of the KNX connection, I don't see anything different from before. Could you be more specific please? Regards

Supergiovane commented 1 year ago

Ciao Write "RAM" here.

Node-RED
gtnscebba commented 1 year ago

Massimo, it works perfectly! Thank you!

Immagine

Supergiovane commented 1 year ago

Perfetto. Ciao!