Monthly Motor Runtime Total
Sums each cycle’s active and inactive motor duration into running monthly totals — sumActiveDuration and sumInactiveDuration.
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.
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:
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 ofMonth. - 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/motorInactiveDurationarguments to match what your upstream field emits. - To rename the totals — change the Metric name on
sumActiveDuration/sumInactiveDurationso 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.