Skip to content

Cookie preferences

We use cookies for our own analytics, to see how our campaigns perform and, if you allow it, to load content from other services such as the Google site search. We never sell your data. Necessary cookies keep the site working and cannot be switched off. See our Cookie Policy for details and our Privacy Policy for how we handle personal data.

Security, load balancing and remembering your cookie choice.

Show us which pages people read, how they find the site and where they get stuck, so we can improve it (Google Analytics, Microsoft Clarity).

Show us which of our ad campaigns bring visitors to the site and remember the campaign or partner link you arrived from (Google Ads, LinkedIn, Meta, partner program). We do not use these cookies to build advertising profiles.

Load the site search from Google when you use it. Google sets its own cookies and shows ads in the search results.

© 2026 The ThingsBoard Authors

ThingsBoard Cloud

Choose your data region

Your data stays in the region you choose, for residency and compliance. No credit card required.

Rather run it yourself? Install on your own servers

Calculate Three-Phase Power Factor per Phase and Total

  • Calculated Field
  • 0 installs
  • v1.0.1
  • Nov 13, 2026
  • MIT license
  • v4.3+

Calculate three-phase power factor (PF, cos φ) for each phase and in total from L1, L2 and L3 active power, voltage and current. For energy meters, power analyzers, motors, compressors and switchboards that report power but no power factor. Find the phase with poor power quality and watch the total against your utility’s reactive power penalty limit.

Type
  • Script
Category
  • Energy
  • Custom Formula
Use Cases
  • Smart Energy
  • Smart Metering
  • Industrial Automation
  • Smart Building

Who it’s for

Energy managers, facility engineers and electricians asking “what is the power factor on each phase?”, “is our cos φ low enough to pay a reactive power penalty?”, “which phase of the motor or switchboard has the poor power factor?” — when the meter reports active power, voltage and current for L1, L2 and L3 but no power factor.

What it does

Reads the latest powerL1, powerL2 and powerL3 (active power, W), voltageL1, voltageL2 and voltageL3 (V) and currentL1, currentL2 and currentL3 (A) telemetry. It writes the power factor of each phase as powerFactorL1, powerFactorL2 and powerFactorL3, and the power factor of the whole load as powerFactor:

three-phase-power-factor

When the phases are strongly unbalanced, engineers define the total power factor in more than one way. This field uses the arithmetic one shown above, because the readings of any meter allow it. A meter that computes its own total in another way can show a very different number. For example, with one phase at power factor 1 and two phases at 0.5, this field shows 0.80 and such a meter can show 0.92.

The voltage must be phase-to-neutral (for example 230 V), not phase-to-phase (400 V). With phase-to-phase voltage every result is too low.

A minus means power flows to the grid. Some meters use another convention, where the sign shows an inductive or capacitive load. When some phases consume and others export, for example on a site with solar panels, their active power cancels out in the total, so powerFactor can be close to 0 while every phase is fine. Watch the phase keys on such sites. Meters round their readings, so active power can be a little higher than voltage × current. The field then writes 1 or −1.

A phase with no current, or with a reading that is not a number such as ERR, gets no new value, so its key keeps the last value. The total then comes from the other phases, and when no phase carries current the field writes nothing.

If your meter already sends powerFactor for the whole load, rename the powerFactor output of this field, as described in How to customize. With the same key, the field writes over the meter’s own value.

How to customize

  • To use this on your meter’s keys — change the Time series key on the nine arguments, from powerL1 to currentL3 (e.g. powerL1 → activePowerA, voltageL1 → voltageA, currentL1 → currentA).
  • To rename the outputs — open the Script and replace the keys in the values object (e.g. powerFactor → totalPowerFactor).
  • To show 3 decimals — open the Script and change 100 and 100.0 in the pf function to 1000 and 1000.0.
  • To timestamp the results with server time — open the Script and change the last line to return values only, without ts.
  • To filter, transform, or forward the result to external systems — switch Strategy to Process via Rule Chains. Rule nodes then receive the values and can drop them, change them, save them conditionally, or push them to an external system.

See also

To raise an alarm when the power factor stays below the tariff limit:

Low Power Factor Alarm Dmytro Shvaika

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.