Support for Shelly 3EM #13515
Replies: 72 comments 261 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.
-
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.
-
Is it with tasmota also possible to use the 3em not as 3 phase measure device but as 3 seperate circuits in a single phase installation? In which case kwh is calculated separately per ct coil? In the last few pictures I saw the kwh is summed. I want to use one coil for grid measurement, one coil for ess and one coil for backup power. According to shelly documentation, this functionality is included in the original shelly firmware, but I prefer Tasmota. |
Beta Was this translation helpful? Give feedback.
-
Is it also possible to monitor the N connection ADE7880 > pins 15 & 16 as a separate measurement? |
Beta Was this translation helpful? Give feedback.
-
I flashed the 3em with 14.3.0 and defined USE_ADE7880 on building with tasmocompiler. I also did rule3 with the calibration data but still I have no readings. I also applied the template and selected the template in the settings. What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
-
Using this template:
|
Beta Was this translation helpful? Give feedback.
-
A powercycle fixed it all. Thank you for support! |
Beta Was this translation helpful? Give feedback.
-
Is it possible to set the amps to 0? They have an offset of 13mA. |
Beta Was this translation helpful? Give feedback.
-
I also found a small bug, active power disappears and show again. I thought it was only hidden when 0 but it is sometimes also show when it is 0. |
Beta Was this translation helpful? Give feedback.
-
I found another little issue. As I have solar panels, my current is flowing backwards, but the current shown in Tasmota is still shown as a positive value and should be a negative value. Watt is indeed negative, which is right. |
Beta Was this translation helpful? Give feedback.
-
I also have a 0 reading once in a while, is this a know issue?
|
Beta Was this translation helpful? Give feedback.
-
For anyone that isn't able to compile tasmota for Shelly3EM here is a prebuild binary tasmota 14.4.0 shelly3em tls.bin.gz These lines where added in user_config_override.h: |
Beta Was this translation helpful? Give feedback.
-
Hello, Can I use Tariff for off-peak configuration with shelly 3em? If yes, does it works for each phase or summary for all phases? |
Beta Was this translation helpful? Give feedback.
-
Hello. Strange situation I configured Off-Peak tariff, but it calculation is wrong: 08:05:31.893 MQT: stat/Shelly_3EM/RESULT = {"Tariff":{"Off-Peak":{"STD":"23:00","DST":"23:00"},"Standard":{"STD":"07:00","DST":"07:00"},"Weekend":"OFF","Forced":"1"}} My time is 8:10. It should set value to tariff 2, but it still set value to tariff 1: 08:10:23.268 MQT: tele/Shelly_3EM/SENSOR = {"Time":"2025-01-20T08:10:23","ENERGY":{"TotalStartTime":"2025-01-19T00:04:06","Total":33.509,"TotalTariff":[33.508,0.000],"Yesterday":2.279,"Today":31.231,"TodaySumImport":31.230,"TodaySumExport":0.000,"ExportActive":[0.000,0.226,0.194],"ExportTariff":[0.420,0.000],"Period":[75,28,44],"Power":[5270,1706,2671],"ApparentPower":[5303,3356,5141],"ReactivePower":[593,2890,4392],"Factor":[0.99,0.51,0.52],"Frequency":[50,50,50],"Voltage":[223,216,217],"Current":[23.801,15.543,23.725],"CurrentNeutral":0.012}} |
Beta Was this translation helpful? Give feedback.
-
Hi, I wonder If it's also possible to get THD (total harmonic distortion) from ADE7880 (the chip itself supports this parameter)? |
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