Value Point

Value, Status, Time and measurement unit

Module: thinkiq.history.value_point

ValuePoint — a single time-series data point (Value, Status, Timestamp) with an optional measurement unit.

ValuePoint

class thinkiq.history.value_point.ValuePoint(value, status, timestamp, measurement_unit=None)

Represents a single time-series point with an optional measurement unit. This extends basic VST (Value, Status, Timestamp) with unit metadata.

Initialize with a value, status, timestamp and MeasurementUnit

Represents a point in time that combines: - value (data point) - status (quality or reliability) - timestamp (when it occurred) - measurement unit (semantic context)

Properties:

value: bool, int, float, str, datetime.datetime

The actual recorded value.

status: int

OPC-compatible status code. 0 usually means ‘Good’.

timestamp: datetime.datetime

The time the value was sampled or recorded.

measurement_unit: thinkiq.model.measurement_unit.MeasurementUnit = None

Optional context unit (e.g., kg, °C, %, etc.)

Methods:

__init__(value, status, timestamp, measurement_unit=None)

Instantiate a ValuePoint — a simple VST point with optional measurement unit.

Parameters:
  • value (bool, int, float, str, datetime, or None) – The actual value recorded at a specific point in time. Can represent numeric measurements, string statuses, booleans, timestamps, or be None if data is missing or invalid.

  • status (int) – The OPC-compliant status code representing the quality or reliability of the value. A status of 0 usually indicates ‘Good’.

  • timestamp (datetime) – The precise time at which the value was observed or recorded.

  • measurement_unit (thinkiq.model.measurement_unit.MeasurementUnit, optional) – Optional ThinkIQ MeasurementUnit object, e.g., Celsius, PSI, %, etc. Provides context for interpreting the value (e.g., 25 with °C vs. 25 with °F). If not provided, the value is considered unitless.

get_vst()

Convert ValuePoint to a basic (unitless) Vst.

Return type:

Vst