Skip to content
Stand with Ukraine flag

Monthly Motor Runtime Total

  • Calculated Field
  • 0 installs
  • v1.0.0
  • Aug 13, 2026
  • MIT license
  • v4.3+

Sums each cycle’s active and inactive motor duration into running monthly totals — sumActiveDuration and sumInactiveDuration.

Type
  • Entity Aggregation
Category
  • Aggregation
Use Cases
  • Industrial Automation
  • Predictive Maintenance
  • Smart Building
  • Smart Home

Who it’s for

Maintenance and operations teams who need one running number per month — how long a motor was actually running, and how long it sat idle — without querying and summing raw telemetry themselves.

What it does

Reads motorActiveDuration and motorInactiveDuration and sums each independently into sumActiveDuration and sumInactiveDuration, bucketed by real calendar month in the configured timezone. Produce intermediate result is enabled, so both totals keep updating throughout the month rather than only appearing once the month closes.

calculated-field-monthly-motor-runtime-total

Note on update timing: intermediate results are periodic, not instantaneous. A new duration is picked up on the next update cycle rather than the moment it arrives, so the running totals trail the latest cycle slightly.

How to set up

This field reads motorActiveDuration and motorInactiveDuration. Pair it with the upstream field that produces them:

Calculate Motor Runtime Duration Mykhailo Kornieiev

Install this field on the same device that field is installed on, or on its device profile so every device of that profile is covered, including ones added later. Every metric has a default value, so no per-entity setup is required before this field starts evaluating.

How to customize

  • To change the aggregation period — edit Aggregate interval type (e.g. Week, Day) instead of Month.
  • To change the time zone the monthly boundary is calculated in — edit Time zone (currently UTC) to the zone the operator works in.
  • To show something other than 0 for months with no activity — the metrics’ Default value is already set to 0; change it if you’d rather show a different placeholder.
  • To read differently named input keys — change the Time series key on the motorActiveDuration / motorInactiveDuration arguments to match what your upstream field emits.
  • To rename the totals — change the Metric name on sumActiveDuration / sumInactiveDuration so dashboards and alarms bind to the key you want.
  • To filter, transform, or forward the totals to external systems — switch Strategy to Process via Rule Chains.

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.