Skip to content

Metadata

Metadata is extra key-value pairs that you attach to workspaces, groups, channels, and devices (and to accounts, by an administrator). Metadata is used for notes, locations, buildings and floors, and as the data source of the Map and Building Overview widgets.

On a detail page, the Metadata tab has two views:

  • Entries: a table of Key, Type, Value, and modification time, with the Add metadata button, edit, and delete.
  • JSON: raw editing.
Type Value
Text Text.
Number A number.
Boolean True or false.
JSON A JSON object or array, with validation.
Location A point on the map {lat, lng}. Click or drag the marker.
Perimeter An area on the map: polygon (3 to 200 points), circle (center and radius in meters), or rectangle (bounds).

The storage format:

{
"location": { "value": { "lat": -6.2088, "lng": 106.8456 }, "type": "location" },
"warehouse-area": {
"value": { "shape": "circle", "center": { "lat": -6.2088, "lng": 106.8456 }, "radius": 150 },
"type": "perimeter"
},
"building": { "value": "A", "type": "text" },
"floor": { "value": "1", "type": "text" }
}

Other perimeter shapes:

{"shape": "rectangle", "bounds": {"south": -6.21, "west": 106.84, "north": -6.20, "east": 106.85}}
{"shape": "polygon", "points": [{"lat": -6.208, "lng": 106.845}, {"lat": -6.209, "lng": 106.847}, {"lat": -6.207, "lng": 106.848}]}

lat must be between -90 and 90, and lng between -180 and 180; entries outside the range are skipped.

  • A typed entry (keys only value, type, and optionally updatedAt) is validated according to its type. An invalid value is refused with a 422 error.
  • updatedAt is stamped by the server. Its value is kept when the value and type do not change.
  • Old free-form entries (not {value, type}) are still accepted and shown, but the Map widget reads typed entries only.
  • The Map widget: location entries become markers and perimeter entries are drawn as areas. See Dashboards.
  • The Building Overview widget: reads text or number entries with the keys building and floor (the keys can be set in the widget).
  • Your own filters and lookups through the API.