Groov Data Store data types


#1

I’ve been using both groov and node-red to make various dashboards at work. I keep finding the structure of the groov date store to be restrictive. Is there any good reason the data store couldn’t have JSON as a data type option… this would make it so much easier to use in conjunction with node-red and it would make groov that much more flexible and web friendly to be able to use data within JSON with the various gadgets.


#2

That idea honestly hadn’t come to us. The data store’s meant to be a simple key-value store: what use case are you thinking of that would make storing arbitrary objects in it easier?

Strictly speaking, there shouldn’t be anything keeping you from storing JSON in a String tag in your data store (we don’t apply any length limits to them), but the gadgets won’t know how to do anything with it beyond displaying it.


#3

Strictly speaking, there shouldn’t be anything keeping you from storing JSON in a String tag in your data store

Yeah, I thought about this but then quickly realized that the gadgets wouldn’t know what to do with it as you mentioned.

This is an example of JSON that I currently generate via custom NodeJS modules I have created to interface with DC power supplies.

{
  "id": "TEST-1",
  "description": "BK Precision 9121A",
  "version": "v1.3.11",
  "ipAddress": "192.168.1.180:10001",
  "tag": "[ TEST-1 | BK Precision 9121A | 192.168.1.180:10001 | v1.3.11 ]",
  "range": {
    "amps": {
      "min": 0,
      "max": 5.1
    },
    "volts": {
      "min": 0,
      "max": 20
    },
    "watts": 100,
    "rippleAmps": 0.003,
    "rippleVolts": 0.003
  },
  "options": {
    "modeOfOperation": "CC"
  },
  "serialNo": "BK PRECISION,9121A,600161012706810004,V1.74",
  "addressGPIB": "1",
  "time": 1496243307886,
  "dateStamp": "5/31/2017",
  "timeStamp": "11:08:27",
  "responseTime": "1763ms",
  "errors": {
    "tcp": "",
    "data": {},
    "device": "",
    "msg": ""
  },
  "events": {
    "amps": {},
    "volts": {},
    "modeOfOperation": {},
    "msg": ""
  },
  "status": {
    "voltsSet": 3.25,
    "voltsOut": 0,
    "ampsSet": 2,
    "ampsOut": 0,
    "output": "OFF",
    "mode": "---"
  }
}

I’m wanting to use node-red to simplify and replace these various NodeJS modules. I am controlling hundreds of these DC power supplies so you can imagine the number of key/value pairs I would need to handle all of the data in the object above… plus with the data store store structure you can’t mix & match data types like you can in JSON and because the tables are array based they can’t be self-identified like JSON that contains an id key.

It is very easy to have node-red output the JSON shown above and if the groov gadgets were able to simply select a key from within JSON as a “tag” it would be pretty awesome!

I have several other examples I could share as well.