Energy (AC) - HLW8012/BL0937

Power measuring sensor used to measure (AC) voltage, current, power and power factor.

Plugin details

Type: Energy (AC)

Name: HLW8012/BL0937

Status: ENERGY

GitHub: P076_HLW8012.ino

Maintainer: TD-er

Used libraries:


The easiest way to configure this plugin, is to select the right device from the Device list in the “Predefined Pin settings”. After saving the settings, all parameters will be set.

When enabling the device, it will load the default calibration values.

If some specific setting is needed to support some device not in the list, this Device selection must be set to Custom.

Supported hardware

Sonoff POW (r1), Huafan SS, KMC 70011, Aplic WDP303075, SK03 Outdoor, BlitzWolf SHP, Teckin, Teckin US, Gosund SP1 v23

Commands available

Command (GPIO/Value)

Extra information



hlwcalibrate,229 to set the current reported voltage to 229V AC

hlwcalibrate,0,0.1 To set the calibration to report 100 mA as actual current.

Will set the used calibration factors to some known current value. For example, if the device using this sensor is plugged into mains power, it may report 200 Volt AC, while it actually is 229V. So the value given to this command should then be 229, since that’s what is supposed to be read.

The last two parameters are optional, but their position determines what unit it represents. If the setting for current has to be updated, at least 2 parameters must be given of which the first must then be set to 0.


Will reset the calibration values used in the sensor’s library.

Change log

Changed in version 2.0:

added 2019-01-06 Added pre-defined config selector for several devices this sensor is used in.