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
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
path | string | No | $ | Path to one EnergyData object with the new quantities |
existingEnergyQuantitiesPath | string | Yes | - | Path to the array of stored energy quantities, e.g. the rows of a query result; each item needs an RtId |
energyQuantityFromPath | string | Yes | - | Path to the start (From) within one item of the array |
energyQuantityToPath | string | Yes | - | Path to the end (To) within one item of the array |
energyQuantityQualityPath | string | Yes | - | Path to the quality within one item of the array (read, currently not used for the decision) |
targetPath | string | No | $ | Path where the result is written |
Behavior
- If no
EnergyDatais found atpath, the node writes nothing. - All times are compared in UTC. A stored quantity overlaps a new quantity if
new.To > stored.Fromandnew.From < stored.To. IfFromorToof a stored item is missing,0001-01-01is used. - Stored items without
RtIdare ignored.
Output
The result is a pair (tuple) written with the property names Item1 and Item2:
| Property | Description |
|---|---|
Item1 | Array of the RtIds of stored energy quantities that overlap a new quantity (each RtId once) |
Item2 | Array of all new energy quantities of the EnergyData |
The configuration properties are documented in the API reference.