Skip to content

02.1 Tag Points

Daniel Dunn edited this page Jul 15, 2024 · 1 revision

Tag Points

Tag Points are a concept in Kaithem borrowed from SCADA systems. They are essentially subscribably variables with some extra features.

Every tag point that exists shows up in the tag points page, which gives you lots of options:

  • Setting alerts when a tag value is out of range
  • Setting up a logger to log every change, or the min, max, or average over time
  • Setting an override value that causes the normal data to be ignored
  • Viewing changes in real time

Tag points are created on demand with the default value(usually 0 or empty string), if anything tries to access a tag that doesn't exist, it gets created. They disappear when there are no references to them remaining.

Tag points may be created in code via the kaithem.tags API, via the tags page, or automatically by many builtin features.

There are four kinds of tags. Numeric, String, Object(Can hold any JSON serializable value), and Binary.

Tags can have subscribers, created in code or in chandler events, or any number of other ways. These subscribers only fire when the value changes.

It is possible to "set the default value" which will set the tag's value only if the tag has never had any "real" data.

Timestamps and annotations

When setting a value, you also set the tag's "timestamp", normally the current time, and the "Annotation", an arbitrary object which can be anything.

When setting the default value, the timestamp will be zero.

Claims

Setting a tag's value really sets it's "default claim" which has priority 50. Overrides work by setting another claim with higher priority. Most of the time it's useful for something to be controlled from multiple sources, so the only things that should usually ever use claims are manual overrides.

Clone this wiki locally