Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#101 Post by LisaM » 12 Jul 2017, 12:37

papperone wrote:
12 Jul 2017, 09:54
LisaM wrote:
12 Jul 2017, 09:03
I don't have a clamp, but do have two multimeters. I'll put both of them to work to measure (V) and (I) at the same time... A 60W light bulb should do the trick being the load.
surely you can, I do have a clamp and it's easier :) but you can do it with 2 multimeter of course.
I tested with both 100W filament and 12W LED, I then used the calibration done with LED bulb as the W readings are more stable.
the library also calculate VA power but as it's a simple V*A I decided to report apparent power (W) and if someone needs VA power it can always be calculated externally.

I don't know if I can report more than 4 readings and let user to choose what to see, will check if this is possible.
Would be nice to have three webform fiels and a calibrate button, so it's no longer needed to send the calibrate command manually.

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#102 Post by LisaM » 12 Jul 2017, 13:58

60W lamp attached, switch on:
esp cali.JPG
esp cali.JPG (16.04 KiB) Viewed 9210 times
Are the new multipliers saved automatically?

Device:
esp pow.JPG
esp pow.JPG (59.82 KiB) Viewed 9210 times
Still not good...

No such debug statement in my syslog:
HLW8012: Calibration to values
Shouldn't this be the case?

Added (float) but still no data (and yes, controller with idx 1172 was added to hlw8012):

Code: Select all

 Error: MQTT: Invalid data received!
 MQTT: Topic: domoticz/in, Message: {"idx":1172}

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#103 Post by papperone » 12 Jul 2017, 16:57

you are sending the URL not correctly, it shoudl be:

Code: Select all

xxx.xxx.xxx.xxx/control?cmd=hlwcalibrate,VVV,AAA,WWW
as well can you try to send the commands via the WEB interface:
Capture.JPG
Capture.JPG (13.03 KiB) Viewed 9192 times
in both cases calibration parameters are saved automatically, and this you can verify looking at the device configuration as they are supposed to changed if all goes well.

I will explore your suggestion about the possibility to RESET/CALIBRATE via web interface, not a bad idea at all! ;)

About Domoticz interface I can't help as I don't use it at all and have no experience, but I'm sure other forum member can help here :)
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#104 Post by LisaM » 12 Jul 2017, 17:42

papperone wrote:
12 Jul 2017, 16:57
you are sending the URL not correctly, it shoudl be:

Code: Select all

xxx.xxx.xxx.xxx/control?cmd=hlwcalibrate,VVV,AAA,WWW
Done, however there is no feedback like 'OK'. It made me unsure wheather the calibration worked or not.

Checking the device, it seems like the calibration worked since the multipliers where updated:
esp cali2.JPG
esp cali2.JPG (23.69 KiB) Viewed 9186 times
The other data seems to be correct also:
esp pow2.JPG
esp pow2.JPG (60.31 KiB) Viewed 9187 times
Time to add Sonoff POW to the supported hardware list? ;)

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#105 Post by papperone » 12 Jul 2017, 23:08

good to hear it works for you!!
now maybe we can wait at least some more users to confirm as well in order to make sure it's at least not a coincidence :mrgreen:
anyhow I'll be out 3 weeks for my summer vacation, bringing the family to Japan, so I will not be able to work on further development / bugfix until my return!
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#106 Post by LisaM » 13 Jul 2017, 00:49

papperone wrote:
12 Jul 2017, 23:08
good to hear it works for you!!
now maybe we can wait at least some more users to confirm as well in order to make sure it's at least not a coincidence :mrgreen:
anyhow I'll be out 3 weeks for my summer vacation, bringing the family to Japan, so I will not be able to work on further development / bugfix until my return!
I'll be gone to. Captain of a 30ft yacht, sailing the high seas... :mrgreen:

Domoticz does get the values through http, not through mqtt...

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#107 Post by papperone » 13 Jul 2017, 08:10

LisaM wrote:
13 Jul 2017, 00:49
papperone wrote:
12 Jul 2017, 23:08
good to hear it works for you!!
now maybe we can wait at least some more users to confirm as well in order to make sure it's at least not a coincidence :mrgreen:
anyhow I'll be out 3 weeks for my summer vacation, bringing the family to Japan, so I will not be able to work on further development / bugfix until my return!
I'll be gone to. Captain of a 30ft yacht, sailing the high seas... :mrgreen:

Domoticz does get the values through http, not through mqtt...
ok this needs to be explored, as my Raspberry+NodeRed is getting MQTT info from the test module as it should! :)

if a Domoticz expert can help to understand how to fix this would be great!

Have fun with your "little toy" :D
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

User avatar
ManS-H
Normal user
Posts: 232
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#108 Post by ManS-H » 13 Jul 2017, 10:32

Is it possible to download the bin.file? I will try it on my Sonof Pow but i have on this moment not the skills to make my own bin file.

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#109 Post by LisaM » 13 Jul 2017, 20:23

ManS-H wrote:
13 Jul 2017, 10:32
Is it possible to download the bin.file? I will try it on my Sonof Pow but i have on this moment not the skills to make my own bin file.
Bin file: https://drive.google.com/open?id=0B8G4U ... HJLU3dTYjQ

Char's:
- 1M/128k
- espeasy 2.0.10

4M/1M will work to, but for testing it's probably better to have it as small as possible...

Annoying: domoticz can only receive all values by using a text virtual sensor... :shock:
domo.JPG
domo.JPG (31.5 KiB) Viewed 9111 times

User avatar
ManS-H
Normal user
Posts: 232
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#110 Post by ManS-H » 13 Jul 2017, 21:55

@LisaM,

Thanks for the bin file, work for me at the weekend :)

rol-rider
Normal user
Posts: 33
Joined: 02 Oct 2016, 12:36

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#111 Post by rol-rider » 27 Jul 2017, 10:26

J'ai testé chez moi sur Jeedom.

sorry I do not speak English !

Image

Après Calibration (ampoule 60W)

Image
ça fonction très bien pour mes premiers tests ! bravo et merci pour ce plugin !
https://www.jeedom.com/forum/viewtopic. ... 12#p495412

BerndJ
Normal user
Posts: 84
Joined: 28 Sep 2015, 06:57

Little Bug: forgets the calibration

#112 Post by BerndJ » 27 Jul 2017, 12:28

Hi,

when the device lost the power and it came back then we found the "old" settings and the measure values are wrong.

Go to Devices --> Click Edit (the HLW8012) --> Click Submit --> Click Close

and he uses the calibration values.

Could the developer correct?

best wishes

BerndJ

rol-rider
Normal user
Posts: 33
Joined: 02 Oct 2016, 12:36

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#113 Post by rol-rider » 27 Jul 2017, 13:40

I have a calibration problem.
1 - I calibrated with a 50W bulb ---- reading ok.
2 - I connected a 500W electric radiator ---- fake reading.
3 - I calibrated with the measured values (multimeter) of the radiator ---- reading ok
4 - I connected the bulb.----fake reading
P and V = ok.
I = nok (1.94A read for 0.25A measured)??

The value of the calibrations (radiator) remained in memory.

BerndJ
Normal user
Posts: 84
Joined: 28 Sep 2015, 06:57

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#114 Post by BerndJ » 27 Jul 2017, 14:07

Hi,

is the 50W bulb a resistor load, or an electronic? with rectifier and capacitor.

What is the power factor?

rol-rider
Normal user
Posts: 33
Joined: 02 Oct 2016, 12:36

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#115 Post by rol-rider » 27 Jul 2017, 17:20

is a Incandescent light bulb (resistor)

Image

Calibration done with the radiator data.

The bulb can not consume 1.96A ! but 0.25A With my multimeter.

I continue my tests, thank.

rol-rider
Normal user
Posts: 33
Joined: 02 Oct 2016, 12:36

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#116 Post by rol-rider » 28 Jul 2017, 09:55

Hello,
I think there is a problem with the value I (Current).
My calibration was:
Xxx.xxx.x.xx / control? Cmd = hlwcalibrate, 234,0.25,58.5
For the bulb the values are good.

I tested with a toaster (750W)
Everything looks good except I (Current) = 0.43A this is not possible!
Image
I think there is a problem on I (Current), or that I have done something wrong!

I will wait for the return of Papperon and LisaM.

BerndJ
Normal user
Posts: 84
Joined: 28 Sep 2015, 06:57

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#117 Post by BerndJ » 28 Jul 2017, 12:06

Hi,

make a calibraton with the toaster, he had a power factor of 100%, and this is ideal for calibration.

Take a look to yr light, power factor ??

when u use this part for calibration there is no way for 100% results.

best wishes

BerndJ

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#118 Post by LisaM » 30 Jul 2017, 20:47

rol-rider wrote:
28 Jul 2017, 09:55
Hello,
I think there is a problem with the value I (Current).
My calibration was:
Xxx.xxx.x.xx / control? Cmd = hlwcalibrate, 234,0.25,58.5
For the bulb the values are good.

I tested with a toaster (750W)
Everything looks good except I (Current) = 0.43A this is not possible!
Image
I think there is a problem on I (Current), or that I have done something wrong!

I will wait for the return of Papperon and LisaM.
A toaster might have a thermostat, or other regulator settings that decrease the power/current, did you also have a multimeter in line to measure the current?

I don't trust radiators, toasters or other electrical equipment since they might regulate the power flow independantly of you (surprise!). To calibrate you need something simple that cannot change the power/current...

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: Little Bug: forgets the calibration

#119 Post by LisaM » 30 Jul 2017, 20:54

BerndJ wrote:
27 Jul 2017, 12:28
Hi,

when the device lost the power and it came back then we found the "old" settings and the measure values are wrong.

Go to Devices --> Click Edit (the HLW8012) --> Click Submit --> Click Close

and he uses the calibration values.

Could the developer correct?

best wishes

BerndJ
Your browser might automatically fill in the 'old' values, so:
- calibrate
- Save settings in a file
- Save settings
- Lose power
- Check calibration values with values in file...

rol-rider
Normal user
Posts: 33
Joined: 02 Oct 2016, 12:36

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#120 Post by rol-rider » 30 Jul 2017, 23:07

Hello,

I calibrated by noting and checking the "calibration values"
When the calibration is done on the toaster (no thermostat).
The values correspond to my readings (multimeter).

If I connect the radiator:
Read value with espeasy 489W 2.56A 225V 85PF --- OK

But when I use a bulb (60W incandescent)
Read value with espeasy 51W 1.94A 209V 25PF

Current I = 1.94A ????? Not possible 0.25A to the multimeter which is logical for a 60W bulb P = UI (cos pi = 1) 230X0.25 = 57.5W


If I calibrate with the values of the bulb,
OK for the bulb.

With the radiator
Read value with espeasy 471W 0.43A 225V 100PF
I = 0.43 ???? Not possible

Sorry for english is google translate

rol-rider
Normal user
Posts: 33
Joined: 02 Oct 2016, 12:36

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#121 Post by rol-rider » 30 Jul 2017, 23:48

Hi,
I think I have found my problem!

I calibrated with the "bulb" values:
xxx.xxx.x.xx / control? cmd = hlwcalibrate, 234,0.25,60

Calibration values in the plugin
Current Multiplier = 1849.00
Voltage Multiplier = 442689.56
Power Multiplier = 12168954.98

Reading with the espeasy bulb P = 59W U = 226V I = 0.25A PF = 100

More read (relay on/off/on/off) always ok.

Now if I disconnect the Sonoff

After recovery on my network:

Calibration values in the plugin (not changed)
Current Multiplier = 1849.00
Voltage Multiplier = 442689.56
Power Multiplier = 12168954.98


Reading with the espeasy bulb P = 50W U = 209V I = 1.92A PF = 12


Conclusion: the calibration does not remain in memory. Is this normal?


rol-rider
Normal user
Posts: 33
Joined: 02 Oct 2016, 12:36

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#123 Post by rol-rider » 31 Jul 2017, 19:10

Ok for this bug!
That I had not understood. (Google translate... or me!)

Rest The I current!

With these two measures
Image
Bulb, correct value.

Image
toaster ? Only the Current (A) is NOK!
How active power can be good and not Current ?


papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#125 Post by papperone » 05 Aug 2017, 11:34

HI, I will be back home tomorrow and I'll look into the plugin based on your comments to fix bugs (like the one that calibration is nor surviving a reset/power down).
About the "Active Power" of course if you calibrate with a resistive load then you try to measure a reactive load the values are wrong!
The units is not meant to be used like this, and the chipset is an economic one so I doubt this can be managed differently.
This is not a multi-purpouse power measure unit nor a home monitor, Sonoff POW (better, chipset HLW8012) is designed to monitor one single device thus you must calibrate it vs, that specific defice.
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Little Bug: forgets the calibration

#126 Post by papperone » 11 Aug 2017, 17:48

BerndJ wrote:
27 Jul 2017, 12:28
Hi,

when the device lost the power and it came back then we found the "old" settings and the measure values are wrong.

Go to Devices --> Click Edit (the HLW8012) --> Click Submit --> Click Close

and he uses the calibration values.

Could the developer correct?

best wishes

BerndJ
Thanks for spotting it, just submitted pull-up request with this bug fixed!! (just waiting to be merged with master branch)
About the ActivePower calculation this is done by the chip and as I wrote it's based on how you calibrate it, so if you change load type you need to calibrate it again to take this into consideration...
I am expecting this is standard behaviour of this chip, but wouldbe interesting to know how other firmware behaves on the POW (like the original ones or the Espurna) as they are supposed to work exactly the same way!
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

User avatar
ManS-H
Normal user
Posts: 232
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#127 Post by ManS-H » 24 Aug 2017, 20:27

papperone en LisaM, Thanks for the work your both did for community so that we can work with the Itead, Sonoff Pow. It works fine.

I have only one question, papperone in a earlier message you mentioned this:
I will explore your suggestion about the possibility to RESET/CALIBRATE via web interface, not a bad idea at all! ;)
Is this command allready in the software? and yes, how do i used it.

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#128 Post by LisaM » 25 Aug 2017, 00:16

ManS-H wrote:
24 Aug 2017, 20:27
papperone en LisaM, Thanks for the work your both did for community so that we can work with the Itead, Sonoff Pow. It works fine.

I have only one question, papperone in a earlier message you mentioned this:
I will explore your suggestion about the possibility to RESET/CALIBRATE via web interface, not a bad idea at all! ;)
Is this command allready in the software? and yes, how do i used it.
Thx, but it was papperone who did the build work. i just tested it.
As far as i know, the calibrate option isn't there yet but shouldn't be to difficult to make.
The current calibrate function uses http:

Code: Select all

xxx.xxx.xxx.xxx/control?cmd=hlwcalibrate,VVV,AAA,WWW
Where VVV = Voltage (230 here in continental europe)
AAA = ampere (current)
WWW = Watts (like 60 for a light bulb).

@Papperone:
PLUGIN_WRITE, PLUGIN_WEBFORM_SAVE and PLUGIN_WEBFORM_LOAD (add function selector) need some rewriting, so that write and save can call the calibrate function.

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#129 Post by papperone » 25 Aug 2017, 09:23

LisaM wrote:
25 Aug 2017, 00:16
@Papperone:
PLUGIN_WRITE, PLUGIN_WEBFORM_SAVE and PLUGIN_WEBFORM_LOAD (add function selector) need some rewriting, so that write and save can call the calibrate function.
indeed, that's the idea in order to implement the calibration via WEB interface and not only issueing command...
honestly I had put this in lower priority as I do have the calibration in my home automation gui via MQTT but it's definitely an improvement that shoudl be done in the GUI of this plugin :)
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#130 Post by papperone » 17 Sep 2017, 11:32

All current bugfixes have been merged in the Playground repository...
About the calibration via WEB I'm not sure is a good place as we cannot have buttons and the previous calibration values are not stored anywhere.
I don't think it makes sense to add this complexity in storage as this will anyhow run the calibration process any time the device page is submitted.
I still believe the right way if to use the already available command and to create (if you wish like I did) a possibility of remote calibration in your GUI.
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

homeautomator24
Normal user
Posts: 4
Joined: 17 Sep 2017, 12:10

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#131 Post by homeautomator24 » 17 Sep 2017, 12:13

Dear Papperone,

Would you mind to provide a link to the .bin file with the firmware you merged your updates into?
This would it make it easier to test and to provide further feedback.

Thank you for your great contribution to this topic.

Best
Homeautomator24

phoenix_e
Normal user
Posts: 2
Joined: 17 Sep 2017, 19:58

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#132 Post by phoenix_e » 17 Sep 2017, 20:06

Dear Papperone,

I second that request from Homeautomator24.
Spend the last couple of hours trying to compile the bin file.
But on two different systems using both the latest Arduino software and the older version 1.6.12 it kept throwing errors.

If you could make the bin available for a 4mb esp I would greatly appreciate it.

With kind regards,
E


homeautomator24
Normal user
Posts: 4
Joined: 17 Sep 2017, 12:10

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#134 Post by homeautomator24 » 20 Sep 2017, 18:43

Thank you, Rol-rider.
After flashing, I get errors with looping reset during boot: see below.
Any idea why this happens? Anybody can reconfirm? Using a 4M Sonoff Pow.

UART Messages:
ets Jan 8 2013,rst cause:1, boot mode:(3,6)

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v09826c6d
~ld
⸮U


INIT : Booting version: (custom)
INIT : Warm boot #29
FS : Mounting...
FS : Mount successful, used 72288 bytes of 113201
INIT : Free RAM:26568
INIT : I2C
INIT : SPI not enabled

Exception (29):
epc1=0x4000e1c3 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000018 depc=0x00000000

ctx: cont
sp: 3fff3900 end: 3fff3da0 offset: 01a0

phoenix_e
Normal user
Posts: 2
Joined: 17 Sep 2017, 19:58

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#135 Post by phoenix_e » 20 Sep 2017, 23:00

Hi Rol-Rider,

I also tried it on a Sonoff POW 4M.
For me it works fine.

It took a couple of tries before the flashing completed succesfully.
But that was the same case with the standard ESPEasy bin files.
Might be the cheap USB serial adapter.

You really helped me out. :D

Merci Beaucoup

rol-rider
Normal user
Posts: 33
Joined: 02 Oct 2016, 12:36

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#136 Post by rol-rider » 21 Sep 2017, 00:32

@ homeautomator24,

sonoff pow is 1M not 4M.

I had the same thing through OTA.

I have (with USB serial adapter)
--flash R120 V1(file ESPEasy_R120_1024.bin)
(wait erase sector)
--and flash the file in V2.0.0
after it's good.

sorry for my English (google translate)

homeautomator24
Normal user
Posts: 4
Joined: 17 Sep 2017, 12:10

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#137 Post by homeautomator24 » 21 Sep 2017, 18:16

Merci Beaucoup, Will try again :-) A bientot

homeautomator24
Normal user
Posts: 4
Joined: 17 Sep 2017, 12:10

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#138 Post by homeautomator24 » 22 Sep 2017, 17:47

Dear, rol-rider, All,

I took the recent .bin file provided by rol-rider, configured HLW8012 with GPIO-5/-13-14 as described many times above. Needed to free up I2C GPIOs now to GPIO-1/-3.
Power Factor and Power works fine after calibration.
However, Voltage and Current remain in 0.

Anybody any idea why this happens?
Would anybody like to post the assignment of GPIO pins in a working Sonoff Pow environment?

Thank you.
Homeautomator24

BerndJ
Normal user
Posts: 84
Joined: 28 Sep 2015, 06:57

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#139 Post by BerndJ » 22 Sep 2017, 20:36

rol-rider wrote:
21 Sep 2017, 00:32
....sonoff pow is 1M not 4M......
Hi,

meanwhile i had 15 pcs of the pows and all have 4M.

best wishes

BerndJ

sm0k0
Normal user
Posts: 15
Joined: 24 Sep 2016, 10:41

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#140 Post by sm0k0 » 21 Nov 2017, 16:41

Hi around there.
maybe somebody could help me with compiling P170_HLW8012.

I have installed Atom (1.22.1 / 64) and PlatformIO at version Home 0.3.2·Core 3.5.0b3. following the entire HowTo`s and use the latest Mega-branch on an Win10 x64.
I have installed all required deps and libraries.
Compiling for normal/test/dev at 4096 is working fine with the current GIT sources but as soon as i try to compile with _P170_HLW8012.ino i run into an error :
Linking .pioenvs\test_4096\firmware.elf
c:/users/sm0k0/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pioenvs\test_4096\firmware.el
f section `.text' will not fit in region `iram1_0_seg'
collect2.exe: error: ld returned 1 exit status
*** [.pioenvs\test_4096\firmware.elf] Error 1
I have already searched around Google and checked for the given hints on this issue (like heap.c and umm_malloc.c changes) deleted a lot of other plugins but no way........... :?

Any ideas to get that sorted would be much appreciated.

regards
sm0k0

sm0k0
Normal user
Posts: 15
Joined: 24 Sep 2016, 10:41

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#141 Post by sm0k0 » 22 Nov 2017, 15:35

Hi again,

looks like the issue is the poor memory on the ESP .....

i have used workaround in the meantime :
  • remove all unwanted plugins by excluding them from compiling, add at the very beginning of each plugin
#ifdef PLUGIN_BUILD_DISABLED

and as a last line in desired plugin to exclude
#endif
  • remove all unwanted libraries from the lib folder
in my case that gives me a image size of 426204 text and 7900 data (without _P170 @ 421440 text and 7860 data) with the minimum core plugins and which seems to run properly.

Btw: plugins like those for Oled, Wifigateway and RGBW and this Candle thing are eating a lot of the memory so you should get rid of them first.

best regards
sm0k0

NealXu
Normal user
Posts: 1
Joined: 22 Dec 2017, 16:27

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#142 Post by NealXu » 22 Dec 2017, 16:34

Hi...i am a new user here. As per my knowledge many ESPEasy users would like to see support for the SonoffPOW in their favorite software, until 2 weeks ago I was one of them, until I received my SonoffPOW from china by the mail.I was willing to give Espurna a chance, installed PlatformIO, learned to work with the basic commands and flashed my SonoffPOW.The webinterface looks indeed much different than the webinterface of ESPEasy but it works very intuitive. You have to use MQTT as protocol with a server. No other protocol is supported in Espurna. Domoticz can work with MQTT and communicates perfectly together with Espurna/SonoffPOW.

blind vias pcb

Irtimid_NL
Normal user
Posts: 1
Joined: 05 Mar 2018, 21:01

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#143 Post by Irtimid_NL » 05 Mar 2018, 21:14

Hello you all,

A newbie to Sonoff here and new to this forum too :)
First of all let me thank all of you who are looking into this Sonoff POW to get it to work with ESPEasy, it's much appreciated !

If been reading this thread a few times, looking on the Internet/YouTube and visited some other sites in order to get the POW to work with ESPEasy. However no luck so far :(
I've seen that a few of you people managed to get it to work, but unfortunately I don't understand how to get there.
So far I have tried different versions of ESPEasy but I don't get the "Voltage & Current" Selection in the Devices tab.
Reading this thread I noticed that some people build a .bin file to be used, but how do I transfer it to the POW and add it properly so the device will understand what to do with it ?

All I want to do with this POW I have is to switch on/off my small kitchensink boiler (which should work just fine as it is now, I just have to add it to Domoticz), but if I am able to read out the time it takes to heat up I can tweak the time to switch it on (&off). And hey, as I bought a POW I might aswell use the features it supports, right ?

Thanks in advance if you take time to help me out on this one. I really want to learn more about these devices and how they can help me to automate my house.

Irtimid

xury
Normal user
Posts: 44
Joined: 02 Apr 2018, 12:54

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#144 Post by xury » 24 Apr 2018, 21:40

Please help me.
How to set PLUGIN_SET_SONOFF_POW to compile in Arduino?

TD-er
Core team member
Posts: 1486
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#145 Post by TD-er » 24 Apr 2018, 22:00

xury wrote:
24 Apr 2018, 21:40
Please help me.
How to set PLUGIN_SET_SONOFF_POW to compile in Arduino?
By far the easiest is to write on the first line of ESPEasy.ino:

Code: Select all

#define PLUGIN_SET_SONOFF_POW
Please note that it is not yet tested, so please test with care and please report any issues.

xury
Normal user
Posts: 44
Joined: 02 Apr 2018, 12:54

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#146 Post by xury » 25 Apr 2018, 00:36

Thank You TD-er. I think at least I understood the define system.
Only one question:
I would like not touch too much in main files as I far away from code developing. So I read some info And prepare Custom.h file.
So can I put my custom definitions on custom.h ?
For eq

Code: Select all

#undef PLUGIN_BUILD_NORMAL
#define PLUGIN_BUILD_CUSTOM
#define PLUGIN_SET_SONOFF_POW // I don't know is the rigt place here (bottom) or on top?
#define <PLUGIN_WHAT_I_NEED>  // 
etc

kostett
Normal user
Posts: 2
Joined: 17 May 2018, 08:43
Contact:

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

#147 Post by kostett » 07 Aug 2018, 12:39

How to calibrate HLW8012 device in ESPEasy mega web interface?
Why does I receive only Voltage and no other values?

Added:
Check that you're not using GPIO-14 elsewhere in settings explicit HLW8012 device.

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests