Calculate Power Factor from Active Power, Voltage and Current
Calculate power factor (PF, cos phi) from active power, voltage and current for single-phase energy meters, smart plugs, motors, pumps, compressors and HVAC units. Gives a true power factor key for load dashboards, low PF alarms and reactive power penalty checks, and skips readings when the load is off.
Who it’s for
Energy managers, facility engineers and electricians asking “what is the power factor of this motor?”, “is our PF low enough to get a reactive power penalty?”, “how much of the current does useful work?” — when the meter reports power, voltage and current, but not the power factor.
What it does
Reads the latest power (active power, W), voltage (V) and current (A) telemetry, divides the power by voltage × current, and writes the result as powerFactor:
A heater or another load that only makes heat has a power factor of 1. A motor has about 0.85 at full load and much less with little load, down to about 0.2 when it runs with no load. Many utilities add a reactive power penalty when the power factor stays below the limit in the tariff, typically somewhere from 0.90 to 0.95.
This is the true power factor. It equals cos φ only when voltage and current are clean sine waves. With frequency drives, LED lighting and other electronics it is lower than the cos φ that some meters show.
When voltage × current is 0 or below, the load is off or the supply is down, and a power factor has no meaning. The field writes nothing, so powerFactor keeps its last value instead of showing a false low reading. Meters round their readings, so power can come out a little above voltage × current. The field then writes 1.
With the IEC convention, a minus means power flows to the grid, so powerFactor goes down to −1. This needs a meter that puts the minus on power. A meter that puts it on current gets no value while it sends power to the grid. Some meters use the IEEE convention instead, where the sign shows an inductive or capacitive load.
The field works on one phase. With the total power of a three-phase meter it shows 1 for most loads, and no error tells you. Give it the power, voltage and current of the same phase, or use this field for all three phases at once:
Calculate Three-Phase Power Factor per Phase and Totalpower must be the active power that the meter measures. Power computed as voltage × current always gives a power factor of 1. If your meter already sends powerFactor, you do not need this field.
How to customize
- To use this on your meter’s keys — change the Time series key on the
power,voltageandcurrentarguments (e.g. power → activePower, current → lineCurrent). - To use a meter that reports power in kW — in the Script, change
power / apparenttopower * 1000 / apparent. - To rename the output — in the Script, replace
powerFactorin thereturnline with your own key (e.g. pf). - To show more decimals — in the Script, change the
2intoFixed(pf, 2)to the number of decimals you need. - To timestamp the result with server time — in the Script, return
{ powerFactor: toFixed(pf, 2) }without thetsandvalueswrapper. - To filter, transform, or forward the result to external systems — switch Strategy to Process via Rule Chains. Rule nodes then receive the value and can drop it, change it, save it conditionally, or push it to an external system.
See also
To find the reactive power behind a low power factor, install the template below on the same device and change the Time series key on its powerFactor argument from cosPhi to powerFactor:
To raise an alarm when the power factor stays below the tariff limit:
Low Power Factor AlarmShare 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.