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.