Skip to content

Data Transfers

A Data Transfer periodically pushes variable values from one project to another, optionally running a statistical calculation first — counter diffs, hourly averages, multi-site aggregation, etc.

Data Transfers

FieldTypeRequiredDescription
nameString (≤100)YesTransfer name
dscString (≤255)NoDescription
periodInteger (ms, ≥100)YesScheduler period
projectIdStringYesOwning project

period is how often the transfer fires — e.g. 3 600 000 ms for an hourly transfer.

Each Data Transfer owns one or more detail rows. Each row is a source-to-target mapping:

FieldDescription
sourceVariableIdSource variable
targetVariableIdTarget variable
calcTypeStatistical calculation (VariableStatCalculationType)
rangeTypeTime range (VariableStatRangeType)
thresholdOptional statistical filter

Source and target can live in different projects — this is how cross-project data sync is built.

VariableStatCalculationType enum — 11 values:

TypeMeaning
MinMinimum over the range
MaxMaximum over the range
AvgArithmetic mean
SumSum
CountSample count
First ValueFirst recorded value in the range
Last ValueLast recorded value in the range
Max DifferenceLargest sample-to-sample delta
Last First Differencelast − first (ideal for cumulative counter deltas)
Middle ValueValue at the temporal midpoint of the range
Median ValueSorted median

VariableStatRangeType enum — 10 values (Current / Previous × 5 time scales):

TypeRange
Current HourFrom the top of the hour to now
Previous HourThe full previous hour
Current DayFrom midnight to now
Previous DayThe full previous day
Current WeekFrom week start to now
Previous WeekThe full previous week
Current MonthFrom month start to now
Previous MonthThe full previous month
Current YearFrom year start to now
Previous YearThe full previous year

The Previous * types are ideal for one-shot computations when the range closes — e.g. emitting “yesterday’s average” every morning.

From a cumulative meter:

  • Source: Energy_kWh (cumulative)
  • Target: Hourly_Consumption
  • calcType: Last First Difference (last − first = hourly consumption)
  • rangeType: Previous Hour
  • period: 3 600 000 ms (fires on the hour)
  • Source: Temperature_C
  • Target: DailyAvg_Temperature
  • calcType: Avg
  • rangeType: Previous Day
  • period: 86 400 000 ms

Mirror site values into a central project:

  • Source (site project): Site1_Power_kW
  • Target (central project): Site1_Power_kW_Mirror
  • calcType: Last Value
  • rangeType: Current Hour (short range for live value)
  • period: 10 000 ms
// Attach the transfer to the scheduler
ins.scheduleDataTransfer("hourly_energy_calc");
// Attach every transfer in the project
ins.scheduleDataTransfers();
// Cancel
ins.cancelDataTransfer("hourly_energy_calc");
ins.cancelDataTransfers();
// Check status — "Scheduled" or "Not Scheduled"
var status = ins.getDataTransferStatus("hourly_energy_calc");

Scheduled means attached to the scheduler, not currently running.

Details: Data Transfer API → | REST API Reference → (Data Transfer Controller group)