Data Model Type Definitions
This is a reference document. Use it to look up the types that a data model field accepts and the errors the validator may raise.
A field's value type is declared at one of two levels. A data model field references a type with _payloadshape (a named payload shape) or _refModel (another data model). Inside a payload shape, each field declares a scalar directly with _type.
Field Types (_type)
A payload shape field's _type is one of:
_type
Meaning
Example value
string
Text
"running"
number
Any numeric value, decimal or whole
42.5, 42
boolean
True / false
true
Any other value is rejected: unsupported UMH type: <type>.
Timeseries payload shapes are inherently typed
When defining the _payloadshape to be timeseries data, the name of the payload shape already states the type. As such, no additional type definition is needed.
Payload shape
value type
Use for
timeseries-number
number
Numeric readings (temperature…)
timeseries-string
string
Text status values
timeseries-boolean
boolean
On/off, true/false state
Each built-in timeseries shape also carries timestamp_ms (a number) next to value. Both fields come from the built-in shape definition, so you never declare timestamp_ms yourself. See Built-in Shapes for the full payload structure.
A _payloadshape reference must name one of the three built-ins above or a shape defined under payloadShapes:. Any other name fails validation with referenced payload shape '<name>' does not exist.
Examples
Data model with several timeseries fields:
Nested folders, and a field that references another data model (_refModel):
Multiple versions of one model:
Define a custom payload shape (top-level payloadShapes:), then reference it:
Rules a data model field must follow:
A leaf field references its type with
_payloadshapeor_refModel, never both.A folder (a field with subfields) has neither
_payloadshapenor_refModel.
Validation Errors
referenced payload shape '<name>' does not exist
_payloadshape names a shape that is not built-in and not defined
Use a built-in, or define the shape first
unsupported UMH type: <type>
A field _type is not a supported type
Use string, number, or boolean
field cannot have both _payloadshape and _refModel
A leaf field sets both keys
Keep one
leaf nodes must contain _payloadshape, _relational, or _refModel
A leaf field has no value-type key
Add _payloadshape or _refModel, or give the field subfields
non-leaf nodes (folders) cannot have _payloadshape
A field with subfields also sets _payloadshape
Remove _payloadshape from the folder
Related
Data Modeling - Concepts and the component chain
Payload Shapes - Built-in and custom shapes
Data Models - Structure,
_refModel, versionsData Contracts - Enforcement at ingress
Payload Formats - UNS payload structure
Note: the
integertypeThe YAML validator also accepts
_type: integerinside a custom payload shape defined in an instance's config file. However, there is no built-intimeseries-integershape and the data-model editor does not offer it, so most models never need it. Usenumberfor numeric values.integeris only relevant when a custom payload shape must reject fractional values (for example a discrete count or an ID).
Last updated

