Skip to Content
This documentation is provided with the HEAT environment and describes this HEAT instance.
DevelopersRunnerscore-utilsentity-state-to-flight-stats

entity-state-to-flight-stats

entity-state-to-flight-stats reduces one numeric field on one entity to its minimum, maximum and average. It emits a single value channel for the StatsSummary widget.

Entity-state records are the JSON records array that hydrate-protobuf-v2 emits with extractionTarget: EntityState. The node reads valueField through JMESPath (a query language for JSON) on every record for the chosen entity and rounds the three results to decimals places. One node instance covers one metric on one entity. Add a second instance for a second metric and bind both to the same widget row.

It is not a time series. Use entity-state-to-chart-data when you need the values over time.

When to use

Use this node when a Next dashboard needs a stat block such as altitude or speed summarised for one entity.

Pipeline position

hydrate-protobuf-v2 (EntityState) -> entity-state-to-flight-stats -> json-merge -> dashboard-v2

The node reads the latest output of one parent.

Configuration

Configuration is required. valueField must be a non-empty string.

KeyTypeRequiredDefaultDescription
entriesPathstringNorecords[*]JMESPath to the array of time-ordered records.
entitiesPathstringNoentity_state.entityJMESPath from each record to its entity object or array of objects.
entityNameFieldstringNonameDotted path from each entity to its name.
entityNamestringNo""Entity to read. When empty, the first entity that yields a value for valueField is used and then locked in.
valueFieldstringYesnoneJMESPath from the entity to the numeric value.
decimalsintegerNo1Decimal places for the rounded results.
realmNamestringNooverviewRealm name.
channelIdstringNoflight-statsChannel id.
channelNamestringNoFlight StatsDisplay name.
groupIdstringNostatssummaryGroup id. The group display name equals the group id.

Output

A data service payload with one value channel.

{ "$heat-dataservice": { "version": "1.0", "groups": [{ "id": "statssummary", "name": "statssummary" }], "realms": [ { "name": "overview", "channels": [ { "id": "flight-stats", "name": "Flight Stats", "groupId": "statssummary", "shape": "value", "data": { "value": { "min": 120.5, "max": 4692.0, "avg": 2410.3 } } } ] } ] }, "dashboard_users": [] }

Bind the channel to a StatsSummary widget and name min, max and avg in statsItems.columns[].

Limitations

  • One parent, latest output only.
  • Non-numeric values are skipped. The node fails when no numeric value is found for the chosen entity.
  • One metric per instance.
Opens your browser's print dialog. Choose "Save as PDF" as the destination.