Skip to content
Stand with Ukraine flag

Overall Equipment Effectiveness (OEE)

  • Calculated Field
  • 2 installs
  • v1.0.0
  • Aug 10, 2026
  • MIT license
  • v4.2+

Calculates Overall Equipment Effectiveness from availability, performance, and quality — the standard manufacturing KPI for how well a line or machine is running versus its full potential. Outputs each sub-factor plus a combined OEE score.

Type
  • Script
Category
  • Custom Formula
  • Statistical
Use Cases
  • Industrial Automation
  • Predictive Maintenance
  • SCADA

Who it’s for

For plant and production managers who need a single, trustworthy number for line performance — “is Line 3 actually running efficiently, or does it just look busy?”, “which shift had the worst changeover losses today?”, “is this line ready for a predictive-maintenance rollout?”

What it does

This SCRIPT calculated field combines five inputs into the three OEE factors — Availability, Performance, and Quality — and multiplies them into a single OEE score:

calculated-field-oee

All four values are written as time series, rounded to one decimal place (e.g. 74.8), so they plot directly on charts and can drive alarms without further transformation.

How to set up

  1. Add the field to a device or, better, to a device or asset profile — installing on the profile (e.g. a “Production Line” asset profile) applies OEE to every entity of that type at once, including lines added later, instead of configuring each one individually.
  2. Configure the five arguments:
    • goodCount, totalCount, operatingTime — time series keys your line already publishes (counts and running time per interval).
    • idealCycleTime, plannedProductionTime — server attributes with sensible defaults (1 and 25200 seconds) that you can override per entity.

⚠️ Important — operatingTime, plannedProductionTime, and idealCycleTime must all use the same time unit. Pick one — seconds, minutes, or milliseconds — and use it consistently across all three. The calculation compares operatingTime against plannedProductionTime directly, and multiplies idealCycleTime against a count before dividing by operatingTime; if one of the three is in a different unit than the others, the math still runs and returns a number, it’s just the wrong number — there’s no error to alert you. Double-check this when wiring up the entity’s attributes and telemetry, not just when reading the script.

  1. Save. The four output series (availability, performance, quality, oee) start populating once real count and time data arrives — an idle or unconfigured line simply doesn’t emit until then, rather than showing a fabricated score.

How to customize

  • To point the count inputs at your keys — change the Time series key on goodCount / totalCount / operatingTime to match what your line publishes.
  • To rename the outputs — open the script and change the keys in the return object (availability / performance / quality / oee) so downstream dashboards and alarms bind to meaningful keys.
  • To set the ideal cycle time or planned production time per entity — set the idealCycleTime / plannedProductionTime server attribute on the entity itself. Each entity then carries its own value, and the Default value is only the fallback until one is set.
  • To read them from different attribute keys — change the Attribute key on those two arguments.
  • To adjust rounding — change the Math.round(x * 1000.0) / 10.0 calls in the script if you need more or fewer decimal places.

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.