Skip to content
Stand with Ukraine flag

Manufacturing Plant Output Per 8-Hour Shift

  • Calculated Field
  • 99 installs
  • v1.0.0
  • Jun 15, 2026
  • MIT license
  • v4.3+

Aggregate production output, fleet kilometres, or shift kWh on a non-calendar 8-hour shift window aligned to the factory’s shift start time.

Type
  • Entity Aggregation
Category
  • Aggregation
  • Statistical
Use Cases
  • Industrial Automation
  • Smart Energy

Who it’s for

Operators on shift schedules asking “how many units did this shift produce?”, “is the night crew ahead of the day crew?”, “did we hit the shift target by the handover?” — when the meaningful reporting period is the shift, not midnight-to-midnight.

What it does

Aggregates one shift total from a per-period delta telemetry — the default reads unitsProduced and emits shiftUnitsProduced. The input must be a per-period delta (units produced since the last report), not a cumulative counter.

Shift aggregation diagram

How to set up

If your device already publishes a per-period delta (units produced since the last report), the template works as-is — just set the source argument’s Time series key to match.

PLCs and MES systems often publish lifetime totals instead of per-shift deltas. Pair with the upstream Script template below — it converts the raw reading into a per-period delta this template can aggregate. To connect, change the source argument’s Time series key to the upstream CF’s output key (readingsDelta), and rename the Metric name to match your domain (e.g. shiftUnitsProducedshiftPalletsPacked).

Calculate Delta from Pulse Counter Dmytro Shvaika

How to customize

  • To aggregate a different telemetry key — change the Time series key on the source argument (e.g. unitsProducedpalletsPacked).
  • To rename the output for a different domain — change the Metric name (e.g. shiftUnitsProducedshiftPalletsPacked) so downstream dashboards and alarms bind to a meaningful key.
  • To compute a different roll-up — change the metric’s Function to AVG, MIN, MAX, or COUNT, or click Add metric for additional outputs. Each metric defines one output key and its function.
  • To change the shift length or start time — adjust Aggregate interval value (default 8 hours) and Offset value (default 6 hours after midnight, matching a 06:00 shift start) to your schedule. Align Time zone with the operator’s local time so boundaries land on local shift hours.
  • To recalculate intervals when telemetry arrives late — enable Apply await timeout for delayed telemetry and set the Duration. When a reading arrives after the shift boundary, the shift’s aggregate is recomputed. Useful for LoRaWAN, NB-IoT, or batched uploads where data can lag minutes to hours behind the wall clock.
  • To turn off in-progress “current interval so far” updates — disable Produce intermediate result. The CF then emits only one value per shift, at the boundary.
  • To turn off the database write, WebSocket push, or downstream CF re-evaluation — under Process right away, toggle Save to time series, Save to latest values, Send to WebSockets, or Send to Calculated fields.
  • To filter, transform, or forward the result to external systems — switch Strategy to Process via Rule Chains. Rule nodes then receive the output and can drop it, change it, save it conditionally, push it to an external system, or anything else the chain defines.

Share Your Calculated Field with the Community

Built a useful data transformation? Export it as a JSON from ThingsBoard and publish it to the IoT Hub. Share it with thousands of ThingsBoard developers worldwide.