Hello! @Dylan_Schuster this is to augment the request you already submitted regarding storage of JSON data with devices. Vis for @Heath.
We need to store static data with devices quite often. Our only option to do this currently is via tags. Unfortunately tags aren’t really up for the task of storing more complex data, and are themselves unable to be tagged. Thus I’m requesting storable semi-static device properties very similar to the way attributes are structured:
- statically typed (string, number, bool, JSON)
- taggable with key/value pairs
Here’s the example:
We want to render a table in an experience page. This table should pull all data from an array of devices and format them into columns…a unique column name for each unique property found. However, due to a large number of variable device properties, it doesn’t make sense to hard-code the column names…that would increase the operational requirements of the front-end. Instead, I’d like to dynamically create the columns based on the properties found on the device (such as name, id, etc). Any custom static properties are assigned via tags…this is awkward but workable as long as we keep it simple. However…now let’s say we only want certain properties to render in the table…perhaps there are some private properties. Ideally I’d assign a tag to this property…something like visibility:hidden or something. Using tags I’m forced to either explicitly filter hidden tags in the JavaScript of the table component, or if I want to do so dynamically I’d have to use a prefix or something in the tag name… hidden_someProperty for example…then perform pattern matching in the JavaScript (this is my current plan). What about setting the display name for the column? Either I split on a delimiter like my last example, then do some funny translation of the remaining key text…or I have to statically define it in the JavaScript with IF statements or something. Again the ideal solution: I’d assign a tag called displayName: Some Property Name…that way I could pull the property object and as I’m rendering the table, pull properties of that object for various fields.
In a completely different workflow, I have drivers I write for many of our devices. These drivers are defined in JSON and offer the instructions to various edge workflows on how to get data from a given device make/model. Currently I define these drivers in the globals of a Driver edge workflow, then assign that workflow to a device via tags (by the flowId). Much simpler would be to allow me to just store the JSON with the device itself. Tags on the JSON property would be very valuable too.
Perhaps this problem is best solved by creating server-side attributes and client-side attributes (ala thingsboard). Server-side attributes give us a place to statically define the attribute value instead of receiving it via via MQTT or otherwise. They should also be perpetual…and may not even need to be stored as time-series. Client-side attributes operate just like the current attributes do.
Hopefully this makes sense and I’m happy to meet with anyone to discuss the use cases further.
Happy Friday!