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

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
Gamester17
Normal user
Posts: 32
Joined: 15 Sep 2016, 13:46

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

#1 Post by Gamester17 » 11 Oct 2016, 16:23

ITead Studio have released "Sonoff Pow" as a cheap hackable WiFi Power Switch with integrated Power Consumption Measurement (Watt Power Meter / Energy Monitor).

http://www.cnx-software.com/2016/10/10/ ... nsumption/

Before I buy one, could anyone here tell me if the latest ESP Easy firmware specifically supports using the Power Consumption Measurement functionality of this Sonoff Pow for Watt Power Meter / Energy Monitor?

This info below is the info I found on this specific devices:

https://www.itead.cc/sonoff-pow.html

The "Sonoff Pow" is a ESP8266 based hackable WiFi power-switch with Power Consumption Measurement (which probably uses ITead own PSF-A85 module that integrate ESP8285).

Sonoff Pow features a 16 Amp relay (max 3500W) and is suppose to be able to directly report wattage consumption. But it should be noted that none of these Sonoff devices have yet been FCC or CE certified, (though they confusingly have a "CE" marking but that in the case of these stands for 'China Export' and not Conformité Européenne). I would personally not connect anything higher than a 10 amp device to this, if even that.

For hackers, Sonoff Pow is exciting as prebuilt and flashable ESP8266 device. The programming header is labelled and goes like this: VCC, RX, TX, GND. The button is tied to GPIO0 so just press it while powering the board and you are in flash mode.

More technical details availalable in their wiki:

https://www.itead.cc/wiki/Sonoff_Pow

Xose Pérez (a.k.a. Tinkerman) have posted teardown of the previous Sonoff TH10 & TH16 models with tests of sensors, actuators, and displays:

http://tinkerman.cat/sonoff-th10-th16-s ... actuators/
Last edited by Gamester17 on 18 Nov 2016, 12:43, edited 1 time in total.

pppp33
Normal user
Posts: 67
Joined: 25 Oct 2015, 17:53

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement?

#2 Post by pppp33 » 11 Oct 2016, 22:22

Hi there,
It uses HLW8012 for power measurement....Anyboby did hear about it ?
regards
paolo

f-fish
Normal user
Posts: 9
Joined: 19 Sep 2016, 04:11
Location: Johannesburg - RSA
Contact:

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement?

#3 Post by f-fish » 12 Oct 2016, 04:14

Hmmm seems like they are going all out with this unit.

https://www.itead.cc/sonoff-pow.html

Jerry Shi Mod Roger • a day ago
It's "European Conformity". We will provide the test report when it is ready.

Later Ferdie

Gamester17
Normal user
Posts: 32
Joined: 15 Sep 2016, 13:46

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement?

#4 Post by Gamester17 » 19 Oct 2016, 14:37

FYI; I sent a mail to ITEAD Studio asking about this and got a reply quite quickly from the product manager of Sonoff, Jerry Shi ( jerry.shi 'at' itead.cc), and he wrote that he knew about ESP Easy and that many of their customers flash their devices with third-party firmware, and that he would ask the engineer to check if they can contribute some code (driver for the power consumption detect IC) to ESPeasy project.

Interestngly he also mentioned that they currently sell over 10,000 Sonoff devices per month, and they think that they in the future will be able to make Sonoff devices more friendly to the hacker-community, which is also why they already expose the port to users and can have information in their wiki on how-to flash third-party firmware.

f-fish
Normal user
Posts: 9
Joined: 19 Sep 2016, 04:11
Location: Johannesburg - RSA
Contact:

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement?

#5 Post by f-fish » 20 Oct 2016, 06:17

That does sound promising, thanks for the feedback.

Later Ferdie

kr0815
Normal user
Posts: 132
Joined: 18 Nov 2015, 18:24

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement?

#6 Post by kr0815 » 21 Oct 2016, 09:14

Here is how the HLW8012 works:

https://sites.google.com/site/tgmaxx/en ... -wifi-plug

the question is, how to meassure frequency in ESPEasy ?

ambassadoro
Normal user
Posts: 40
Joined: 17 Nov 2015, 15:58

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement?

#7 Post by ambassadoro » 21 Oct 2016, 12:56

Some weeks ago, I already mentioned this device. The frequency is for espeasy a kind of pulse-count I guessed, but how many pulses can espeasy afford?

pacitzu
Normal user
Posts: 17
Joined: 11 Oct 2015, 16:47

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement?

#8 Post by pacitzu » 21 Oct 2016, 13:46

For this device some esp8266 experminental firmware is under test.

Look here:

https://github.com/arendst/Sonoff-MQTT-OTA-Arduino/wiki

Gamester17
Normal user
Posts: 32
Joined: 15 Sep 2016, 13:46

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement?

#9 Post by Gamester17 » 24 Oct 2016, 11:01

pacitzu wrote:For this device some esp8266 experminental firmware is under test.

Look here:

https://github.com/arendst/Sonoff-MQTT-OTA-Arduino/wiki
Does that cover the Power Consumption Metering chip for Energy Monitoring Measurement in the Sonoff Pow as well?

And if so could that code for Power Consumption Metering & Energy Monitoring Measurement be ported to ESPeasy?

https://github.com/arendst/Sonoff-MQTT- ... r_config.h

#define HLW_SEL 5 // GPIO 05 = HLW8012 Sel input (Sonoff Pow)
#define HLW_CF1 13 // GPIO 13 = HLW8012 CF1 voltage / current (Sonoff Pow)
#define HLW_CF 14 // GPIO 14 = HLW8012 CF power (Sonoff Pow)
#define SEND_TELEMETRY_ENERGY // Enable sending energy telemetry


Looks like GPIO 13 is used to read voltage and current via the HLW8012 CF1 chip that Sonoff Pow uses to measure it.

Gamester17
Normal user
Posts: 32
Joined: 15 Sep 2016, 13:46

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement?

#10 Post by Gamester17 » 18 Nov 2016, 12:38

Support for HLW8012 IC (by HLW Technology) for power monitoring have now added support to ESPurna firmware for ESP8266 by Xose Pérez (a.k.a. Tinkerman):

http://tinkerman.cat/hlw8012-ic-new-sonoff-pow/

https://bitbucket.org/xoseperez/hlw8012 ... LW8012.pdf

Tinkerman have released HLW8012 library for Arduino and ESP8266 as free open software licensed code here:

https://bitbucket.org/xoseperez/hlw8012

Wonder if this HLW8012 library could also be implemented into ESP Easy firmware too if copied from ESPurna firmware?

https://bitbucket.org/xoseperez/espurna

ESPurna firmware supports current monitoring through his EmonLiteESP library (based on the EmonLib library):

https://bitbucket.org/xoseperez/emonliteesp

https://github.com/openenergymonitor/EmonLib

It could be tested with Sonoff POW by ITead Studio:

https://www.itead.cc/sonoff-pow.html?ac ... 42636b55fb

User avatar
lucaberta
Normal user
Posts: 59
Joined: 09 May 2016, 11:26
Location: Lausanne, Switzerland
Contact:

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

#11 Post by lucaberta » 27 Nov 2016, 11:37

Theo Arends also has code for the Sonoff Pow:

https://github.com/arendst/Sonoff-MQTT- ... lw8012.ino

It should not be too complicated to add the HLW8012 support into ESPEasy at this stage, given the code already available.

Ciao, Luca

HarpieC
Normal user
Posts: 17
Joined: 20 Mar 2016, 20:33

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

#12 Post by HarpieC » 04 Dec 2016, 12:12

I found this video on YouTube- perhaps it is usefull:
https://youtu.be/hv_FpBqWFrg

Unfortunately the sonoff pow is currently sold out (again!) so I have to wait a little bit longer for own tests.

adrianmihalko
Normal user
Posts: 51
Joined: 15 Sep 2016, 00:20

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

#13 Post by adrianmihalko » 13 Dec 2016, 18:04

It would be nice to make this Sonoff SC compatible with ESP Easy
https://www.itead.cc/sonoff-sc.html

User avatar
paveleremin
Normal user
Posts: 12
Joined: 29 Dec 2016, 10:19

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

#14 Post by paveleremin » 03 Jan 2017, 12:34

Any updates on it?
Is ESP Easy can work with the Sonoff POW?

Dylantje
Normal user
Posts: 255
Joined: 11 Oct 2015, 16:51

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

#15 Post by Dylantje » 03 Jan 2017, 12:52

mmm that sonof have nice devices...
Should this one work with Espeasy?
https://www.itead.cc/smart-home/motor-r ... witch.html

Mariete
Normal user
Posts: 13
Joined: 05 Nov 2015, 19:16

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

#16 Post by Mariete » 11 Jan 2017, 11:36

Any news about Sonoff POW support in ESPEASY?

lavvy
Normal user
Posts: 1
Joined: 10 Jan 2017, 19:04

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

#17 Post by lavvy » 14 Jan 2017, 23:00

please house, the sonoff pow has started shipping . Has the firmware included the support for the energy monitor. this is actually the shining feature of this device. Please can someone support it for us please. @pacitzu what about the one you mentioned that is on testing ?

User avatar
SuperToma
Normal user
Posts: 14
Joined: 08 Apr 2016, 08:33

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

#18 Post by SuperToma » 25 Jan 2017, 13:53

I tried Espurna and it works really well with my Sonoff Pow !

You can find the repository here : https://bitbucket.org/xoseperez/espurna/overview
I built the firmware with ArduinoIDE, you can find the how-to here : https://bitbucket.org/xoseperez/espurna ... uinoIDE.md

You need to checkout the version 1.5.0 (1.4.4 was not working for me)

- The information of status, current, power consuming, ... is sent well to my MQTT broker
- Blue led is lightning when wifi is working
- Red led when the switch is ON
- And you can manually switch on/off the Sonoff with the button on the box

Thanks to Xose Pérez !

gajotnt
Normal user
Posts: 13
Joined: 22 Feb 2017, 15:07
Location: Portugal
Contact:

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

#19 Post by gajotnt » 23 Feb 2017, 17:59

SuperToma wrote:I tried Espurna and it works really well with my Sonoff Pow !

You can find the repository here : https://bitbucket.org/xoseperez/espurna/overview
I built the firmware with ArduinoIDE, you can find the how-to here : https://bitbucket.org/xoseperez/espurna ... uinoIDE.md

You need to checkout the version 1.5.0 (1.4.4 was not working for me)

- The information of status, current, power consuming, ... is sent well to my MQTT broker
- Blue led is lightning when wifi is working
- Red led when the switch is ON
- And you can manually switch on/off the Sonoff with the button on the box

Thanks to Xose Pérez !

Espurna looks like a nice project, but for people that dont have linux and not alot of knowhow (like myself) have a hard time understanding how to compile and flash de FW :(

mrwee
Normal user
Posts: 127
Joined: 31 Aug 2016, 12:52

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

#20 Post by mrwee » 23 Feb 2017, 19:25

gajotnt wrote:
SuperToma wrote:I tried Espurna and it works really well with my Sonoff Pow !

You can find the repository here : https://bitbucket.org/xoseperez/espurna/overview
I built the firmware with ArduinoIDE, you can find the how-to here : https://bitbucket.org/xoseperez/espurna ... uinoIDE.md

You need to checkout the version 1.5.0 (1.4.4 was not working for me)

- The information of status, current, power consuming, ... is sent well to my MQTT broker
- Blue led is lightning when wifi is working
- Red led when the switch is ON
- And you can manually switch on/off the Sonoff with the button on the box

Thanks to Xose Pérez !

Espurna looks like a nice project, but for people that dont have linux and not alot of knowhow (like myself) have a hard time understanding how to compile and flash de FW :(
I agree. Espurna is in many ways nice, but I have to admit that I really prefer espeasy :). But POW support is very high on my wishlist for espeasy ;)

psy0rz
Normal user
Posts: 232
Joined: 02 Feb 2017, 12:12

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

#21 Post by psy0rz » 27 Feb 2017, 12:05

I also mailed Jerry of Itead to see if i can help their devs on working on sonof support.

I also offered to implement it myself if he sends me a bunch of Sonof pows to work with.

I think official Sonof support in espeasy is a good thing for both ESPEasy and Itead.

Edwin
Please support ESPEasy development via Patreon or buy us a coffee.

hschroyen
Normal user
Posts: 6
Joined: 10 Oct 2016, 16:34

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

#22 Post by hschroyen » 05 May 2017, 14:06

Hello,

Any progress on this?
As you can see in this treat more people are interested.
https://www.letscontrolit.com/forum/vie ... pow#p15579

at psy0rz ...send me a private message...perhaps I could even send you a POW of mine...they are just collecting dust so if I could help the project move on I am glad to do so.

Regards

costo
Normal user
Posts: 490
Joined: 21 Nov 2015, 15:03

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

#23 Post by costo » 07 May 2017, 14:38

psy0rz wrote:
27 Feb 2017, 12:05
I also mailed Jerry of Itead to see if i can help their devs on working on sonof support.

I also offered to implement it myself if he sends me a bunch of Sonof pows to work with.

I think official Sonof support in espeasy is a good thing for both ESPEasy and Itead.

Edwin

I do not think it is wise to include support for SonoffPOW in ESPEasy.

I understand that 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.

The SonoffPOW has no other pins easy accessible than RX & TX. So it is nearly impossible to connect any other device/hardware unless you will use RX/TX for I2C.

But I strongly want to discourage to use the SonoffPOW for anything else than just do the power measurement because connecting any wire/device to any pin (including RX/TX) is extremely dangerous.

The way the HLW8012 works the chip needs to be connected direcly to the live powerline (115 or 230V) therefor the ground pin of the programming header is connected directly to the live input pin of the device. So touching any component/wire around the HLW8012 or ESP8266 is life threatening. There are NO optocouplers between the HLW8012 and the ESP8266. Touching 3.3V, Rx, TX, or signal GND is the same as touching the live powerline, when it is powered on.

You do not have to compile the sourcecode of Espurna you can flash a binfile found here: https://bitbucket.org/xoseperez/espurna/downloads/ which can be flashed very easy.
Only people who are too lazy to learn to work with the webinterface of Espurna will ask for including SonoffPOW in ESPEasy. :mrgreen:
If you want to use a different protocol than MQTT it is probably easyer to ask Xose Perez the maker of Espurna to include another protocol.
Besides, I think it is hard to make firmware , for a SonoffPOW, that works better than Espurna. There are 5 variables and I believe ESPEasy can only work with 4 variables per device. Calibration variables and calculation maths are included and saved in Espurna. making a comparable plugin may cost a lot of memory which in ESPEasy in not unlimited.

You can find a little manual on how I installed Espurna and integrated it in Domoticz in a earlier post of mine: https://www.letscontrolit.com/forum/vie ... 240#p15537

krikk
Normal user
Posts: 115
Joined: 28 Feb 2017, 07:57
Location: Austria
Contact:

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

#24 Post by krikk » 07 May 2017, 14:49

my thoughts on this:

why do we waste resouces the develop 2 different firmwares instead of one?? ...why did he develup espurna when there was espeasy already (or the other way around)? wouldn't one firmware which solves all, much better for the enduser... ...and are we here at the espeasy forum or on the "we promote espurna" forum...

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

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

#25 Post by toffel969 » 07 May 2017, 21:48

krikk wrote:
07 May 2017, 14:49
my thoughts on this:

why do we waste resouces the develop 2 different firmwares instead of one?? ...why did he develup espurna when there was espeasy already (or the other way around)? wouldn't one firmware which solves all, much better for the enduser... ...and are we here at the espeasy forum or on the "we promote espurna" forum...
Probably true for the development of two different firmwares doing very similar things.
However I support that espurna is used for such a niche application instead of reinventing the wheel in espeasy. There are other sensors to measure ac current in espeasy via analog if need to in an customized built.
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

costo
Normal user
Posts: 490
Joined: 21 Nov 2015, 15:03

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

#26 Post by costo » 08 May 2017, 01:57

Apparently Espurna software is almost unknown here. You cannot compare Espurna with ESPEasy, they are written with totally different users in mind. ESPEasy is made for experimenters who like to add sensors or devices to the ESP unit. Espurna is written for dedicated devices, there are no plugins for new sensors. Only dedicated devices like most Sonoff devices, wemos relay shield and just a few other hardware devices are supported. No extensions are supported.

Now look at the SonoffPOW, when you open it you may get the false idea that the high voltage is separated from the low voltage part. Several slots in the board between high and low voltage give you that illusion. But what it looks like is totally false, the high voltage and low voltage share a common ground. Totally opposite from a normal Sonoff wifi switch where the high and low voltage circuits have a decent separation.
Because of this false look unexperienced people may get the unholy idea that adding extra sensors to a SonoffPOW is safe.

Imagin what will happen if these unexperienced people have ESPEasy on a SonoffPOW . . . . . . . . some people ignore all warnings and will connect sensors or a display to the RxTx-I2C bus . . . . . . . just because they can.

So I say that ESPEasy on a SonoffPOW is potentally a very dangerous situation.

Why would the developer(s) of ESPEasy create a plugin that is potentially life threatining. It could give ESPEasy a bad name. Better leave the SonoffPOW to dedicated firmware like Tasmota or Espurna.

krikk
Normal user
Posts: 115
Joined: 28 Feb 2017, 07:57
Location: Austria
Contact:

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

#27 Post by krikk » 08 May 2017, 07:05

it does not matter which firmware you flashs, if you open a high-voltage device like the sonoff devices, you have to know what you do... yes we should include a warning, but i see no reason to "exclude" this device.

...what i noticed when looking on the espurna site is, that we still have no "supported hardware" page on the wiki... while we support much of the hardware espurna supports...

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

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

#28 Post by toffel969 » 08 May 2017, 09:19

krikk wrote:
08 May 2017, 07:05
it does not matter which firmware you flashs, if you open a high-voltage device like the sonoff devices, you have to know what you do... yes we should include a warning, but i see no reason to "exclude" this device.

...what i noticed when looking on the espurna site is, that we still have no "supported hardware" page on the wiki... while we support much of the hardware espurna supports...
I really have to support Costo's cause here.

This is what the "typical" ESPeasy device looks like

Image
Image

Maybe a solution could be to disable RxTx as well as I2C on SonoffPOW. --> in binary release we include a mechanism that disables the usage of the GPIO pins if the HLW8012 is being used as device. That way we make sure nobody (that doesn't use a selfcompiled version of ESPeasy of course...) can connect sensors in an unsafe way with a Stock ESPEasy.

Regards

Sebastian
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

Shardan
Normal user
Posts: 1112
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

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

#29 Post by Shardan » 08 May 2017, 13:37

Yes and no.

Not everyone who can code knows about electrical security and vice versa.
So such a locking looks a bit "Absurdistan" like to me. A coder without knowledge
can work around within 10 minutes and a security trained guy without coding
knowledge can not? Oh rly?

The people using ESPEasy usually are adults responsible for themselves.
You can't keep them from doing stupid things no matter what you try.
Trying to make life save, sound and sterile (and take away all self-responsibillity)
by ruling things down to uselessness is not the way from my point of view.
BTW would the next step be a surveillance plugin to check if users keep the rule??

You can buy wall outlets and wall switches, automatic fuses and much more
security relevant parts in every DIY shop. So denying via firmware .... no.

There should be a general warning in the forum and the wiki saying
one should leave working on mains voltage to trained persons.
Let's be honest - it does not stop you, right?
But it keeps forum and wiki out of responsibility.

Regards
Shardan
Regards
Shardan

Shardan
Normal user
Posts: 1112
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

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

#30 Post by Shardan » 08 May 2017, 13:43

toffel969 wrote:
08 May 2017, 09:19
I really have to support Costo's cause here.

This is what the "typical" ESPeasy device looks like

Image
Image

Maybe a solution could be to disable RxTx as well as I2C on SonoffPOW. --> in binary release we include a mechanism that disables the usage of the GPIO pins if the HLW8012 is being used as device. That way we make sure nobody (that doesn't use a selfcompiled version of ESPeasy of course...) can connect sensors in an unsafe way with a Stock ESPEasy.

Regards

Sebastian
BTW, i have several devices including some with mains power supply on the PCB or mounted besides the PCB.
So I won't say that my lab sample without powersupply is a typical device.

The "typical device" outside the experimenteer scene is one that can be directly used without
getting extra power supplies and this and that.
From that point of view Sonoff is far more the typical device then my lab tinkering.

Regards
Shardan
Regards
Shardan

mrwee
Normal user
Posts: 127
Joined: 31 Aug 2016, 12:52

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

#31 Post by mrwee » 08 May 2017, 13:50

costo wrote:
08 May 2017, 01:57
Apparently Espurna software is almost unknown here. You cannot compare Espurna with ESPEasy, they are written with totally different users in mind. ESPEasy is made for experimenters who like to add sensors or devices to the ESP unit. Espurna is written for dedicated devices, there are no plugins for new sensors. Only dedicated devices like most Sonoff devices, wemos relay shield and just a few other hardware devices are supported. No extensions are supported.

Now look at the SonoffPOW, when you open it you may get the false idea that the high voltage is separated from the low voltage part. Several slots in the board between high and low voltage give you that illusion. But what it looks like is totally false, the high voltage and low voltage share a common ground. Totally opposite from a normal Sonoff wifi switch where the high and low voltage circuits have a decent separation.
Because of this false look unexperienced people may get the unholy idea that adding extra sensors to a SonoffPOW is safe.

Imagin what will happen if these unexperienced people have ESPEasy on a SonoffPOW . . . . . . . . some people ignore all warnings and will connect sensors or a display to the RxTx-I2C bus . . . . . . . just because they can.

So I say that ESPEasy on a SonoffPOW is potentally a very dangerous situation.

Why would the developer(s) of ESPEasy create a plugin that is potentially life threatining. It could give ESPEasy a bad name. Better leave the SonoffPOW to dedicated firmware like Tasmota or Espurna.
I don't get what you're trying to achieve here... It can never be ESPEasy's problem that someone doesn't know how to handle flashing an Itead POW. Many of the Itead products are using mains and modifying the product with 3rd party firmware involves competance. If you don't know what you're doing, then don't. Flashing with Espurna firmware is not more safe than flashing with any other firmware, so why not support POW with ESPEasy, when that's what people in this forum are using?

But I do support the idea of a hardware guide like seen on Espurna's website incl. notes that you cannot connect mains and programming tool at the same time.. It should include a *disclaimer* stating that people themselves are responsible for that they are doing, that's never the responsibility of ESPEasy.

costo
Normal user
Posts: 490
Joined: 21 Nov 2015, 15:03

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

#32 Post by costo » 08 May 2017, 14:44

The discussion is going really nice ;)

The question is not : do we want support for the SonoffPOW in ESPEasy?
we do not support dedicated hardware devices from certain manufacturers in ESPEasy there is only support for certain hardware chips or these chips on a breakoutboard.

So the real question is: Do we want support for the HLW8012 in ESPEasy ?

There exists a HLW8012 breakout boards
on Ebay http://www.ebay.com/itm/Energy-Meter-HL ... SwuLZY4skR
on Electrodragon http://www.electrodragon.com/product/en ... ut-board/

and a wiki http://www.electrodragon.com/w/Energy_meter

So a experienced coder who wants to take the challenge can make an ESPEasy plugin for the HLW8012 . This plugin could then be added to the playground and those who like it can add the plugin in their own code and compile it.

But in my opinion the official developer(s) and the official wiki should stay away from this plugin. Much too dangerous for inexperienced hardware people.
Specially much too dangerous to include it in official binary firmware.

mrwee
Normal user
Posts: 127
Joined: 31 Aug 2016, 12:52

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

#33 Post by mrwee » 08 May 2017, 16:07

costo wrote:
08 May 2017, 14:44
we do not support dedicated hardware devices from certain manufacturers in ESPEasy there is only support for certain hardware chips or these chips on a breakoutboard.
But given the fact that many users are running ESPEasy on e.g. Itead products, then perhaps this should be revised? (I did not know that dedicated hardware devices were out-of-scope, that certainly puts a question mark on my usage of ESPEasy :) )

krikk
Normal user
Posts: 115
Joined: 28 Feb 2017, 07:57
Location: Austria
Contact:

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

#34 Post by krikk » 08 May 2017, 18:51

costo wrote:
08 May 2017, 14:44
we do not support dedicated hardware devices from certain manufacturers in ESPEasy there is only support for certain hardware chips or these chips on a breakoutboard.
where do you get this info??? do not spread false rumors! this is open source software, the user can run it on every hardware which is technically possible!!! i run it on itead hardware (sonoff th16 and a S20) myself, why not??

bluejedi
Normal user
Posts: 35
Joined: 26 Sep 2016, 14:27

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

#35 Post by bluejedi » 21 May 2017, 13:12

krikk wrote:
07 May 2017, 14:49
my thoughts on this:

why do we waste resouces the develop 2 different firmwares instead of one?? ...why did he develup espurna when there was espeasy already (or the other way around)? wouldn't one firmware which solves all, much better for the enduser...
Why do we have many different manufacturers and models for whatever type of device (including cars) you can think of?
That's why.
krikk wrote:
07 May 2017, 14:49
...and are we here at the espeasy forum or on the "we promote espurna" forum...
We are here to help each other. In this case about a question on support for Sonoff POW, which unfortunately ESPEasy does not currently support.

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?

#36 Post by LisaM » 25 May 2017, 14:41

costo wrote:
08 May 2017, 14:44
The discussion is going really nice ;)

The question is not : do we want support for the SonoffPOW in ESPEasy?
we do not support dedicated hardware devices from certain manufacturers in ESPEasy there is only support for certain hardware chips or these chips on a breakoutboard.

So the real question is: Do we want support for the HLW8012 in ESPEasy ?

There exists a HLW8012 breakout boards
on Ebay http://www.ebay.com/itm/Energy-Meter-HL ... SwuLZY4skR
on Electrodragon http://www.electrodragon.com/product/en ... ut-board/

and a wiki http://www.electrodragon.com/w/Energy_meter

So a experienced coder who wants to take the challenge can make an ESPEasy plugin for the HLW8012 . This plugin could then be added to the playground and those who like it can add the plugin in their own code and compile it.

But in my opinion the official developer(s) and the official wiki should stay away from this plugin. Much too dangerous for inexperienced hardware people.
Specially much too dangerous to include it in official binary firmware.
I agree with the second part: ESPEasy should be supporting chipset and hardware using those chipset can be verified by (one or more) users.

Regarding the FIRST part: who is in control of ESPEasy??? Who has the final say about important statement like this? There MUST be a referree who makes the final call, this can be one or more people... For example Gizmocuz controls Domoticz, he has the final word on Domoticz developments (and more important branche integrations).

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?

#37 Post by LisaM » 25 May 2017, 14:48

mrwee wrote:
08 May 2017, 13:50
costo wrote:
08 May 2017, 01:57
Apparently Espurna software is almost unknown here. You cannot compare Espurna with ESPEasy, they are written with totally different users in mind. ESPEasy is made for experimenters who like to add sensors or devices to the ESP unit. Espurna is written for dedicated devices, there are no plugins for new sensors. Only dedicated devices like most Sonoff devices, wemos relay shield and just a few other hardware devices are supported. No extensions are supported.

Now look at the SonoffPOW, when you open it you may get the false idea that the high voltage is separated from the low voltage part. Several slots in the board between high and low voltage give you that illusion. But what it looks like is totally false, the high voltage and low voltage share a common ground. Totally opposite from a normal Sonoff wifi switch where the high and low voltage circuits have a decent separation.
Because of this false look unexperienced people may get the unholy idea that adding extra sensors to a SonoffPOW is safe.

Imagin what will happen if these unexperienced people have ESPEasy on a SonoffPOW . . . . . . . . some people ignore all warnings and will connect sensors or a display to the RxTx-I2C bus . . . . . . . just because they can.

So I say that ESPEasy on a SonoffPOW is potentally a very dangerous situation.

Why would the developer(s) of ESPEasy create a plugin that is potentially life threatining. It could give ESPEasy a bad name. Better leave the SonoffPOW to dedicated firmware like Tasmota or Espurna.
I don't get what you're trying to achieve here... It can never be ESPEasy's problem that someone doesn't know how to handle flashing an Itead POW. Many of the Itead products are using mains and modifying the product with 3rd party firmware involves competance. If you don't know what you're doing, then don't. Flashing with Espurna firmware is not more safe than flashing with any other firmware, so why not support POW with ESPEasy, when that's what people in this forum are using?

But I do support the idea of a hardware guide like seen on Espurna's website incl. notes that you cannot connect mains and programming tool at the same time.. It should include a *disclaimer* stating that people themselves are responsible for that they are doing, that's never the responsibility of ESPEasy.
Mains voltage (110-230v) danger is highly overrated here, i have been electrocuted many, many times (hundreds of times). It always hurts my fingers, but nothing else. The real danger starts at 400v because then your muscles contract and you can no longer free yourself from the voltage source (that's why always 2 people should work on voltages starting at 400v, so the second guy can free you from the electrocution).

Furthermore is it NEVER the responsibility of the development team to what you do with the hardware, if you get electrocuted it's ALWAYS your own fault. If you can't stand the heat, get out of the kitchen....

psy0rz
Normal user
Posts: 232
Joined: 02 Feb 2017, 12:12

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

#38 Post by psy0rz » 29 May 2017, 01:14

LisaM wrote:
25 May 2017, 14:41
costo wrote:
08 May 2017, 14:44
The discussion is going really nice ;)

The question is not : do we want support for the SonoffPOW in ESPEasy?
we do not support dedicated hardware devices from certain manufacturers in ESPEasy there is only support for certain hardware chips or these chips on a breakoutboard.

So the real question is: Do we want support for the HLW8012 in ESPEasy ?

There exists a HLW8012 breakout boards
on Ebay http://www.ebay.com/itm/Energy-Meter-HL ... SwuLZY4skR
on Electrodragon http://www.electrodragon.com/product/en ... ut-board/

and a wiki http://www.electrodragon.com/w/Energy_meter

So a experienced coder who wants to take the challenge can make an ESPEasy plugin for the HLW8012 . This plugin could then be added to the playground and those who like it can add the plugin in their own code and compile it.

But in my opinion the official developer(s) and the official wiki should stay away from this plugin. Much too dangerous for inexperienced hardware people.
Specially much too dangerous to include it in official binary firmware.
I agree with the second part: ESPEasy should be supporting chipset and hardware using those chipset can be verified by (one or more) users.

Regarding the FIRST part: who is in control of ESPEasy??? Who has the final say about important statement like this? There MUST be a referree who makes the final call, this can be one or more people... For example Gizmocuz controls Domoticz, he has the final word on Domoticz developments (and more important branche integrations).
I think i'm currently the "Benevolent Dictator" that has final say in things, although Martinus will always be the BDFL (https://en.wikipedia.org/wiki/Benevolen ... r_for_life)

Regarding this issue: I think there is some confusion about the term "support". What does it mean if we say "ESPEasy supports a board of brand X"?

In programming terms it could mean: The software supports the core processor and chipsets of that board. It might mean we release additional binaries as well. (dev9 and higher have a ESP8285 binary as well, needed for that Sonoff board you where talking about)

If we dont have to do ugly hacks and can support stuff like this in a nice and generic way (like a HLW8012 plugin) I have no problem with it. (in software terms)

So in programming terms we shouldn't really talk about a Sonoff Pow, but instead about ESP8285 and a HLW8012 plugin. (plugin will probably also work with ESP8266 in that case)



Now the next step is support as in: Support for the endusers. Things like support on the forum and documentation on the wiki that says: For Sonoff Pow you need to use that binary and that plugin and you need to use these settings. And things like: LOOK OUT the sonoff pow is connected to mains, dont electrocute yourself and fry your equipment. Perhaps later there also will be additional wiki pages for another brand that uses HLW8012. Again i see no problem with this.


There the is support as in "We support this company": Now this is a different story. We probably should stay neutral? I dont know.


Also: Not supporting something (in either way), because its dangerous is a bit tricky: If we would do that, people would still create those plugins and upload them somewhere else. Perhaps they would put links to those plugins on the forum. Are we then going to ban those links? And maybe those links don't warn the users of the dangers involved.

So while the software developers are NOT be responsible for dangerous hardware, we as a community DO have a responsibility to warn the users. These warnings should be on the forums and in the wikis.

And no: Mains voltage is NOT overrated here. 220v/50hz is much more dangerous than 110v/60hz so you shouldn't compare those two like that. (both are dangerous is some cases) The effect depends on environmental factors: Types of shoes, type of carpet, is there a trip switch installed in the house. (One of my first studies was as an Electrician before i got into electronics and software engineering) Saying something stupid like this is very irresponsible!
Please support ESPEasy development via Patreon or buy us a coffee.

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?

#39 Post by papperone » 19 Jun 2017, 00:13

I hope not to create false expectations but I have received a couple of ElectroDragon HLW8012 modules which from a looking at schematics are identical to how the same chip is utilized on the Sonoff POW.
The only advantage is that you can use whatever PINs you want but that's not a big deal. I have already played a bit with them and succeed to have my own basic code to init the chip, and read both current and tension.
I'm still under testing, I want to better understand how the chip works and wihle it's true it's sharing GND with main live it's also true that many users here uses ESPEasy to operate Relays for live appliance so somehow they are already taking the risk to work with main live electricity; I agree that flashing a Sonoff POW is as dangerous but not less than any other ITEAD devices if you leave them connected to live power; about the fact to use then other sensors on the same "POW" device it's not a smart idea and shoudl be clearly stated.
I will definitely try to have support for HLW8012 in a ESPEasy plugin which is a fairy simple tasks but... due to the argumentation raised on this thread I'd like to consult with official ESPEasy developper before to eventually release it.
Still time to go as I don't have too much free time for the moment for this "hobby" but sooner or later it will be ready.

PS: techincally as well the 2 LEDs on POW are connected to GND, thus somehow to main live :)
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?

#40 Post by LisaM » 19 Jun 2017, 01:21

papperone wrote:
19 Jun 2017, 00:13
IPS: techincally as well the 2 LEDs on POW are connected to GND, thus somehow to main live :)
Everything is 'somehow' connected to main live...
Please show me what is then dangerous with the Sonoff here: https://www.letscontrolit.com/forum/vie ... f=5&t=3237
AC en DC circuits are neatly disconnected from each other, no danger there. Ofcourse is not wise to work on it with mains connected, that's always true when working with AC 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?

#41 Post by papperone » 19 Jun 2017, 07:05

LisaM wrote:
19 Jun 2017, 01:21
papperone wrote:
19 Jun 2017, 00:13
IPS: techincally as well the 2 LEDs on POW are connected to GND, thus somehow to main live :)
Everything is 'somehow' connected to main live...
Please show me what is then dangerous with the Sonoff here: https://www.letscontrolit.com/forum/vie ... f=5&t=3237
AC en DC circuits are neatly disconnected from each other, no danger there. Ofcourse is not wise to work on it with mains connected, that's always true when working with AC current.
I was not sarcastic, I am electronic engineer and took as well electrical certification for my previous job requirements so I know the danger of working with main live (I used to service industrial devices working with 400VAC 3 phases input).
I meant that every device which works with main is dangerous in the wrong hands; about Sonoff it's written everywhere to disconnect from mains before to program it first time, no matter which model.
It seems an obvious action to be done, but believe me I've seen many "so called electrician" doing things which are more than dangerous; I just wanted to highlight that the issue with working with main live is not related to POW only but to all devices operating with main live and that's a fact; then having a plugin which operates a realy or a plugin which read power consumption makes no changed to the fact you need to know and understand what you are doing!
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?

#42 Post by LisaM » 19 Jun 2017, 09:26

I'm an electrotechnical engineer (euro engineer in fact) and the 400vac you're mentioning is where it starts to get deadly, this is due to the fact that starting at 400vac your muscles contract and you no longer can free yourself. Regulations require that when working on 400v you're working in pairs, where the second is watching your back. I've worked for the largest gridco over here and i can tell horror stories about people stupid enough not to follow rules and getting themself fried.
I meant that every device which works with main is dangerous in the wrong hands;
A car in the wrong hands is also dangerous, just ask the britisch. It applies to most devices, regardless it's original function. 5vdc can kill a baby, in some cases, due to the much lower skin resistance.

Stupid people get darwin awards, regardless the warnings described here...
A generic warning to people, like this http://hypertextbook.com/facts/2000/JackHsu.shtml should be enough. No need to repeat this message over and over again. Let's get to business.

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?

#43 Post by papperone » 19 Jun 2017, 10:12

Agree and I think we are saying the same; I stated I'll work on and test the pluing, that's somethign I'm already started btw, and I'll release it in the playground when reliable enough.
As I don't have a Sonowff POW I will test it with a simulator using the ElectroDragon HLW8012 module which uses the same circuit as POW...
This means I won't be able to test and confirm it will run on POW without issues, in theory it should be ok but... no testing from my side on a real device ;)
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?

#44 Post by LisaM » 19 Jun 2017, 13:11

I'll order a pow from ali and are happy to test for you when it has arrived, i also have two dragon's which can be testbed's also.

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?

#45 Post by papperone » 19 Jun 2017, 13:21

LisaM wrote:
19 Jun 2017, 13:11
I'll order a pow from ali and are happy to test for you when it has arrived, i also have two dragon's which can be testbed's also.
Great! I has well 2 Dragon modules which I've started testing this weekend... so far so good :)
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

Shardan
Normal user
Posts: 1112
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

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

#46 Post by Shardan » 19 Jun 2017, 16:55

LisaM wrote:
19 Jun 2017, 09:26
.....the 400vac you're mentioning is where it starts to get deadly, this is due to the fact that starting at 400vac your muscles contract and you no longer can free yourself.
A global "starting from 400V = deadly" ignores that these things depends on a lot of circumstances.
One example: Someone using a pickaxe accidentally hit a phone cable in the ground - old analog phone with a ring signal just in that moment.
About 70 Volts - he was dead at once, standing in a wet roadside ditch. On the other hand: I'm 20.000V approved myself and obviously still alive, 2 days hospital for monitoring was all.

Oh and btw, the liability laws at least here might be different .... Just a "lets go to business" ignoring such facts might be a bit too easy.
Regards
Shardan

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?

#47 Post by LisaM » 19 Jun 2017, 20:42

Shardan wrote:
19 Jun 2017, 16:55
LisaM wrote:
19 Jun 2017, 09:26
.....the 400vac you're mentioning is where it starts to get deadly, this is due to the fact that starting at 400vac your muscles contract and you no longer can free yourself.
A global "starting from 400V = deadly" ignores that these things depends on a lot of circumstances.
One example: Someone using a pickaxe accidentally hit a phone cable in the ground - old analog phone with a ring signal just in that moment.
About 70 Volts - he was dead at once, standing in a wet roadside ditch. On the other hand: I'm 20.000V approved myself and obviously still alive, 2 days hospital for monitoring was all.

Oh and btw, the liability laws at least here might be different .... Just a "lets go to business" ignoring such facts might be a bit too easy.
Ah, stories exchange! Here's another one: a mechanic didn't wear the mandatory face protection kit (basically a clear plastic cover) while working on 10KVa installation. His collegue bumped into him by accident and this guy burned ALIVE when he touched the 10KVa lines. Obviously he died...
Even the 5V DC from the breadboard can be deadly, just not very likely. Everything can kill you, do we really need to warn for that?

Shardan
Normal user
Posts: 1112
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

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

#48 Post by Shardan » 19 Jun 2017, 20:48

Will you sign a paper that you will pay every liability for the forum resulting from this?

As nobody knows where a reader starts in the wiki or the forum it's better to keep warnings up.
Regards
Shardan

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?

#49 Post by papperone » 22 Jun 2017, 23:54

under testing... hope to relase it during the weekend ;)
Capture.JPG
Capture.JPG (39.9 KiB) Viewed 8344 times
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?

#50 Post by LisaM » 23 Jun 2017, 00:50

papperone wrote:
22 Jun 2017, 23:54
under testing... hope to relase it during the weekend ;)
Capture.JPG
You're to fast! ;) The pow is on it's way to me, but hasn't arrived yet. I'll test with the dragon also and when the pow get's here also.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests