_historian
2 minute read
Topic structure
Message structure
Our _historian
messages are JSON containing a unix timestamp as milliseconds (timestamp_ms
) and one or more key value pairs.
Each key value pair will be inserted at the given timestamp into the database.
Examples:
{
"timestamp_ms": 1702286893,
"temperature_c": 154.1
}
{
"timestamp_ms": 1702286893,
"temperature_c": 154.1,
"pressure_bar": 5,
"notes": "sensor 1 is faulty"
}
If you use a boolean value, it will be interpreted as a number.
Tag grouping
Sometimes it makes sense to further group data together. In the following example we have a CNC cutter, emitting data about it’s head position. If we want to group this for easier access in Grafana, we could use two types of grouping.
Using Tags / Tag Groups in the Topic: This will result in 3 new database entries, grouped by
head
&pos
.Topic:
umh/v1/cuttingincorperated/cologne/cnc-cutter/_historian/head/pos
{ "timestamp_ms": 1670001234567, "x": 12.5, "y": 7.3, "z": 3.2 }
This method allows very easy monitoring of the data in tools like our Management Console or MQTT Explorer, as each new
/
will be displayed as a Tree.
What’s next?
Find out how the data is stored and can be retrieved from our database.