Device tag value max size

I’m assuming the device tag value portion of the key/value is a string. What is the maximum number of characters that the value portion can hold?

Values can be a maximum of 255 characters, with no limits on the acceptable characters.

Keys must also be no longer than 255 characters, but they come with the added limitation that they may only contain uppercase and lowercase letters; numbers; and underscores (_) and hyphens (-).

Thanks. How may tags can a device have?

Devices - and other resources that can support tags - can have a maximum of 100 entries. (What I said about keys and values also applies to tags on other resource types as well.)

Two key differences about device tags vs. others …

  • Device tags can support multiple values per the same tag while other resources support one value per tag key.
  • Because of this, if you are using the REST API directly, you will find that device tags are treated as an array of objects with key and value` properties …
{
  "tags": [{"key": "foo", "value": "bar"}]
}

… whereas other tag-supported resources store the tags under an object, where the tag keys are object keys and the tag values are the values per key.

{
  "viewTags": {
    "foo": "bar"
  }
}

Hi @Dylan_Schuster,

I’ve hit 100 tags for a particular device application. (Storing various thresholds and labelling fields).

Storing these in a small array could reduce my tag count by 75% if this works, however I can’t seem to get my syntax correct.

If I store a tag called:
D2_TEST
With a value of:
{“key”: “foo”, “value”: “bar”}

Can I reference this address in a Gauge label for example?

I can read in a single char:
{{ ctx.deviceId-0.tags.D2_TEST.[0].[0] }}

However I can’t seem to address:
{{ ctx.deviceId-0.tags.D2_TEST.key }} for example

I hope the above makes sense, many thanks in advance.