Support for Shelly 3EM #13515
Replies: 59 comments 224 replies
-
Any news about support this device? Is it possible or will be possible it the feature? I also have this device and want to go to tasmota firmware. |
Beta Was this translation helpful? Give feedback.
-
ADE7880 looks interesting from datasheet view. |
Beta Was this translation helpful? Give feedback.
-
Ok, I'm interested in that one, too. |
Beta Was this translation helpful? Give feedback.
-
Hi @goodkiller , The reason I started to develop this integration is the fact that I have a 3-phase grid connection without neutral (3x230V, 230V between phases). This is not supported by standard Shelly firmware, however the ADE7880 supports it. Basically, a specific register inside the ADE chip has to be set to a specific value. (Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ADE7880.pdf ) Currently I’m still stuck with some issues in setting up the integration. If someone could help me out with that, it would be a win-win: not only my ESPhome integration would be ready then, it would also be a solid base for a Tasmota integration. The issues I’m still facing:
|
Beta Was this translation helpful? Give feedback.
-
I don't have the hardware.
|
Beta Was this translation helpful? Give feedback.
-
Any progress with it? Community, lets pump it up! :) |
Beta Was this translation helpful? Give feedback.
-
Shelly is advertising this product that it can detect leaks and energy theft using optional neutral clamp but failed to deliver. I'm starting to think Tasmota is the answer, Shelly has not responded to this issue since July. |
Beta Was this translation helpful? Give feedback.
-
I got my device and did a little bit of research. Obligatory safety warning: Do not try to repeat this without the necessary equipment. There are voltages inside the Shelly that can kill you. I powered the Shelly off an isolation tranformer, ran the USB through a USB isolator and put the whole setup into an IKEA SAMLA box before plugging it in. Note that I had the current transformer flipped, so everything is reported as negative. Oopsie, sorry for that. First some more photos of the PCB. The core part magnified: Datasheets: ADE7880, PCF85363A I took three captures, one while having the ESP externally powered by 3.3V (the power rails of ESP and ADE are not directly connected, but it seemed to answer anyway), one with an incandescent light bulb (242 V, 0.11 A, PF 100, 27.9 W) and one with a CFL lamp I had lying around (242 V, 0.09 A, PF 52, 11.5 W). Here are the original captures, they can be opened with Saleae Logic 2: In general the communication looks like this: 1: After powerup the ESP will first talk to the PCF85363A RTC (7-bit I2C address 0x51) that is also on board. Ignoring this here. As described in the datasheet on page 76 the ADN follows a register read/write pattern for all(?) I2C communication, so I have interpreted the I2C communication in terms of register reads/writes like this:
Those only show the communication with the ADN and you should be able to easily identify the conversations from the relative timestamps in the first column. The datasheet (p. 79) describes a burst mode to read multiple registers. I believe in my file those would simply show up as a long read, but the longest read I observed was 4 bytes, so it doesn't seem to use the burst mode. (Of course those 4-byte reads might be multiple 1-byte or 2-byte registers, I didn't check the register lengths.) |
Beta Was this translation helpful? Give feedback.
-
Based on the above information I wrote the driver for the Shelly 3EM (ade7880). It is default disabled (USE_ADE7880) so you'll need to compile it first. I haven't tested it as I do not have the hardware yet so if someone is willing to, be my guest and report back. Remember to make a firmware copy first before installing tasmota. |
Beta Was this translation helpful? Give feedback.
-
Did some research and for now it's very important to make a 4M firmware dump BEFORE you install tasmota with ADE7880 support. The Shelly 3EM firmware dump contains calibration parameters in a JSON file called
The parameters in this file currently need to be added in to file
Once done the possibly negative power values turn to the correct values like As I mounted all three current sensors on the same power line one can see I have an issue with L3 constantly showing wrong values. I plan to release this driver on a 4M tasmota image allowing to use our filesystem to strore the |
Beta Was this translation helpful? Give feedback.
-
Great progress, thank you @arendst . With my limited, rusty coding skills this would have taken me ages... ;-) Would it be possible to support different wiring configurations? Standard settingWith the current/standard register settings, the ADE7880 is capable of measuring three single-phase loads or a 4-wire wye load: Possibility to measure 3-wire delta loadI would like to use the Shelly 3EM in configurations with a 3-wire delta load (some homes have a 3-wire connection without neutral, a delta configuration). This can be enabled by setting a specific register of the ADE7880: |
Beta Was this translation helpful? Give feedback.
-
Well.... thats funny now. I installed my 3EM to electricity enclosure and did proper installation. After trying to install custom firmware, device resets itself. This happens after applying template ({"NAME":"Shelly 3EM","GPIO":[1,1,288,1,32,8065,0,0,640,8064,608,224,8096,0],"FLAG":0,"BASE":18}):
What makes it odd is that before installation (using only one phase) works well... |
Beta Was this translation helpful? Give feedback.
-
Something different. As Tasmota currently cannot calibrate the device it's important to start the Shelly firmware at least once. Then add the device to your network and access webpage http:///calib.dat. Store the information in a safe place as it is needed again when Tasmota is installed. |
Beta Was this translation helpful? Give feedback.
-
I flashed a build with these flags enabled via OTA, applied the template, the calibration data as Rule and enabled Option 21. (many times :)) I am not sure why, but wanted to leave this here for people struggling at the same point. |
Beta Was this translation helpful? Give feedback.
-
Do I have to anything else than what's described in https://templates.blakadder.com/shelly_3EM.html ? |
Beta Was this translation helpful? Give feedback.
-
It is very unlikely that the meter provided by the grid company would not balance the phases. It does! If you have an OBIS / SML meter it will sum up consumption in cells 1.8.x and the production in 2.8.x. So if you consume 1000 watt on phase 1 and 2 each and produce 5000 watt on phase 3, it will be counted as 3000 watt production. Tasmota's set of counters work differently: The main counter goes up and down according production and consumption, but then there are the "ExportActive" counters that go only even up (integrate) but integrates only at moments where there is a net export. By some calculations, you could infer the official 1.8.0 and 2.8.0 counters, too. |
Beta Was this translation helpful? Give feedback.
-
Did somebody try to get the harmonics part of the ADE7880? It might be interesting to play with this information. |
Beta Was this translation helpful? Give feedback.
-
Hi guys. I am trying to use a bigger CT with a shelly 3EM. Standard ones are 120A/40mA. The ones I am trying to configure is 400A/40mA. The readings should be 3.33 times bigger but I am not able to callibrate the device with the new CT. Any idea? |
Beta Was this translation helpful? Give feedback.
-
Hi, Volage, Frequency are correct, the Current I dont now The wiring must fit because everything was displayed correctly before the switch to Tasmota. My rules3: rule3 on file#calib.dat do {"rms":{"current_a":3019559,"current_b":3362201,"current_c":1329104,"current_n":1219168,"current_s":266669599,"voltage_a":-700535,"voltage_b":-695400,"voltage_c":-687116},"angles":{"angle0":156,"angle1":168,"angle2":168},"powers":{"totactive": {"a":-4279903,"b":-3932160,"c":-7019040}}} endon How can I fix it? |
Beta Was this translation helpful? Give feedback.
-
Hi, I am trying to flash my 3EM. I have compiled (vscode, pio) the latest tasmota version with #define ade7880. After that I try to upload it to via my ftdi adapter connected to the 1,27mm header at the side of the 3EM. I have, of course crossed tx and rx. I get constantly "A fatal error occurred: Failed to connect to ESP32: No serial data received." Of course I have changed the tx and rx but with straight tx to tx and rx to rx nothing happens at all, not at least "No serial date received". I believe I cant set 3EM into bootloader mode. I have tried to have GPIO0 connected to GND while booting or connect RESET to GND while having GPIO0 even connected to GND. Nothing puts the 3EM into bootloader mode. Is there a specfic baud rate the 3EM is communicating. When I open the serial monitor (vscode) I get solely rubbish but no readable infos. Maybe I missed something but I have not found any specific hints how to flash an 3EM via usb adapter and interface at the side of the 3EM. Thanks |
Beta Was this translation helpful? Give feedback.
-
if we got a cent donated for the sentence "it worked before" Tasmota crew could by many test devices ;-) |
Beta Was this translation helpful? Give feedback.
-
FYI: After noticing that the most recently Shelly firmware has a 'Clamp Calibration' function, it became clear to me that at least some of the values in |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm using a Shelly 3EM with Tasmota version 13.1.0 for all my 3 phases (one with a solar energy plant). I did not notice any errors when importing the calibration. Does anyone have the problem that the value (Energy Today / Total) becomes negative when the solar system overproduces? My solar system is on L1 and if its consumption value is negative I can watch the total value decrease until it is negative. Is it possible that negative consumption values are not included in the total? Ty. |
Beta Was this translation helpful? Give feedback.
-
I did someting stupid , I flashed my Shelly 3EM ota with the file shellyem3-esp8266-0.4.6.zip that worked fine. Then I upgrade to the latest version 13.2. I reset the device with Reset 5 and started over but still no reading. _```
|
Beta Was this translation helpful? Give feedback.
-
Hi! |
Beta Was this translation helpful? Give feedback.
-
Thanks for your answer! I connected 4 cables: L1, L2, L3 and N and double checked each. I even dropped the braker for each L on their own to make sure that the order is correctly. For the clamps: I also double checked the clamps. L1 -> A clamp, L2 -> B clamp, L3 -> C clamp. And for all clamps the arrow shows reverse from the house to the power plant. This is what I get: Another strange thing is that the sum of all three phases is always about 0 W. |
Beta Was this translation helpful? Give feedback.
-
I had the problem with one of my hall-sensors too. I checked if there is no reverse current and after that simply turned the sensors arround. After that I checked with a multimeter that current is (nearly) the same to the 3EM. Since then it works for me ... I am quit sure my sensors are mounted "backwards". |
Beta Was this translation helpful? Give feedback.
-
Hi, sorry I am still at a loss combing through this gigantic thread. I am suprised to see the relevant Driver is not part of the firmware yet (it was developed >1 year ago and mentioned in like release ~11.1). So I guess I will need to compile it myself. I tried using TasmoCompiler, there I selected the What is the minimal needed setup to compile tasmota to support my Shelly 3EM including the energy sensors as well as the available flash chip? Really looking forward to your input, maybe I am just missing the obvious part? Kind regards |
Beta Was this translation helpful? Give feedback.
-
Hello together, I have Flashed the Shelly 3EM with this Instruction : "https://www.congenio.de/infos/shelly3em.html" Both Firmware Upgrades i have installed at the Shelly. Actually i can switch the relais in the shelly. But no Measurement will be shown. (see Picture) i2cscan in the console : 01:36:13.351 CMD: i2cscan The ADE Chip will be found for a short time. Is this normal ? i2cdriver in the console : 09:58:50.830 CMD: i2cdriver rule0 in the console : 01:39:20.309 CMD: rule0 Can anyone help me with this Problems ? |
Beta Was this translation helpful? Give feedback.
-
This thread seems to be the only resource for the 3EM, so I hope it's okay that I turn here with a question… two actually. I had a spare 3EM and so decided to do a total house measurement. It's wired up right behind the "official" utility meter. I saved and restored My first question is: Is there a way to calibrate the meter in its current position, using the data from the official meter? Second, when I try to use Can someone shed some light on this, or maybe refer me to a better forum (I have already posted this on Discord, but nobody replied…)? Thank you! |
Beta Was this translation helpful? Give feedback.
-
Hello
#11909
Seems like Shelly 3EM is not supported yet. Shelly 3EM is 3 phase energy monitor. It's very similar as regular EM and 2.5.
Unfortunately both templates does not work currently well. 3EM is using ADE7880 chip.
Here is some information what I already digged out.
A terminal is connected to ADE7880 > pins 7 & 8
B terminal is connected to ADE7880 > pins 9 & 12
C terminal is connected to ADE7880 > pins 13 & 14
N terminal is connected to ADE7880 > pins 15 & 16
Some library to communicate with ADE7880
https://github.com/NazimBL/ADE7880
ESPhome component
https://github.com/michaelpiron/esphome/blob/dev/esphome/components/ade7880/ade7880.h
Many thanks!
Beta Was this translation helpful? Give feedback.
All reactions