I recently flashed a WiOn Smart Power Bar with energy monitoring with ESPHome and I am trying to obtain the power monitoring values.
Circuit:
The chip that measures everything is a Hiliwei Tech HLW8012. 3 wires (VS, VC, PC) lead from it to an unmarked chip. This unmarked chip outputs the data as seen in the screenshot below to the ESP8266.
The red trace is the data from the unmarked chip. The blue trace is the clock signal generated by the ESP8266.
In case it is not visible, the data is:
48 00 00 00 49 05 97 94 57 00 00 00 56 00 0A C1
The 48, 49, 57, and 56 are constant (headers?). The 3 bytes after 48 and 57 only show up under load. The data after 49 is all over the place and after 56 is relatively constant.
Currently, with a ~150W load (charging E-bike) the range of the values are:
48: 0 - 568
49: 5,000 - 56,000
57: 26,000 - 410,000
56: 2,600 - 2,700 (Jumps up and down. Others are smooth)
Without a load, the values are:
48: 0
49: 1,000 - 456,000 (random)
57: 0
56: 2,600 (Stable with rare jumps to ~400,000)
If these values are supposed to represent wattage, voltage, power factor, and current, they are obviously not correct as they are. I am expecting to see ~150W, 120V, 1.25A, and a PF between 0 and 1.
I have spent a couple of weeks trying to figure out how to turn these values into wattage, voltage, power factor, and current but with no luck. Due to the chips lack of markings, I was not able to find a datasheet for it and it doesnāt appear as if anyone else on Home Assistant has hacked a WiOn (OEM EcoPlugs) device with energy monitoring either.
If anyone has any suggestions or ideas on how to get the correct data, I would appreciate the help. Thanks!