xoseperez / hlw8012

HLW8012 library for Arduino and ESP8266 using the Arduino Core for ESP8266.
GNU General Public License v3.0
126 stars 48 forks source link

Sonoff POW v2 #20

Closed Urs-Eppenberger closed 4 years ago

Urs-Eppenberger commented 4 years ago

Hello Xose Thanks for your library. I used the one from Andreas Spiess https://github.com/SensorsIot/Sonoff-POW before. It does not work anymore, probably because of updates in other Arduino libraries. I'm not good enough to debug this.

So I use your library for my own code, running on the Sonoff POW v2 devices. I measure power and current, the voltage is 230V (very stable in Switzerland). From the code with the 25W bulb I get a power-reading of 25.0 , perfect. For this I ran the calibrate() routine once in my code. Here is the output: (D) [HLW] New current multiplier : 14484.49 (D) [HLW] New voltage multiplier : 408636.51 (D) [HLW] New power multiplier : 11754104.24 Question 1: can I use the readings and set them in all my sonoff POW devices without calibration? For example with something like: hlw8012.setCurrentMultiplier(14484.49);

Question 2: the current reading is always 0.0 I use exactly your code, just added a wireless connection and the telnet debug library to get the debug output via telnet without electrocuting my poor MacBook. Do you have any hints?

Urs-Eppenberger commented 4 years ago

Question 1 is solved. I checked in the source code and found the commands to do this. Question 2 is solved too. I created a minimal sketch with Wifi and Telnet-Debug in order to safely measure a light bulb (purely resistive load). It worked. But I have a new question. I will open another topic for this.