Skip to main content

SearchExistingEnergyQuantities@1

Node SearchExistingEnergyQuantities@1 compares new energy data with energy quantities that are already stored in the runtime. It returns the RtIds of all stored quantities whose period overlaps a new quantity (so they can be deleted) together with the new quantities (so they can be inserted).

Adapter Prerequisites​

Node Configuration​

For fields path, targetPath, targetValueWriteMode, and targetValueKind, see Overview.

transformations:
- type: SearchExistingEnergyQuantities@1
path: $.energyData # one EnergyData object
existingEnergyQuantitiesPath: $.existing.Rows # stored energy quantities (query result rows)
energyQuantityFromPath: $.Values[0] # 'From' within one row
energyQuantityToPath: $.Values[1] # 'To' within one row
energyQuantityQualityPath: $.Values[2] # 'Quality' within one row
targetPath: $.changes
PropertyTypeRequiredDefaultDescription
pathstringNo$Path to one EnergyData object with the new quantities
existingEnergyQuantitiesPathstringYes-Path to the array of stored energy quantities, e.g. the rows of a query result; each item needs an RtId
energyQuantityFromPathstringYes-Path to the start (From) within one item of the array
energyQuantityToPathstringYes-Path to the end (To) within one item of the array
energyQuantityQualityPathstringYes-Path to the quality within one item of the array (read, currently not used for the decision)
targetPathstringNo$Path where the result is written

Behavior​

  • If no EnergyData is found at path, the node writes nothing.
  • All times are compared in UTC. A stored quantity overlaps a new quantity if new.To > stored.From and new.From < stored.To. If From or To of a stored item is missing, 0001-01-01 is used.
  • Stored items without RtId are ignored.

Output​

The result is a pair (tuple) written with the property names Item1 and Item2:

PropertyDescription
Item1Array of the RtIds of stored energy quantities that overlap a new quantity (each RtId once)
Item2Array of all new energy quantities of the EnergyData

The configuration properties are documented in the API reference.