Anyone using Shelly EM?

Apparently it has the ADE7953 inside, same as Shelly 2.5, which is supported.

I haven’t found anyone sharing their ESPhome config for it.

Is it the same gpio pins used for SPI with ade7953 ?, what about the relay pins?

1 Like

You don’t need to install ESPHome unless you specifically want to access it via the ESPHome api. It has a built in MQTT client. And other sensors can be implemented with RESTful sensors:

Yes, I am aware. I’m already using a bunch of ESPHome devices, and would prefer if I could use ESPHome with this one too.

1 Like

I’ I just got my shelly em, I hope to have the time to flash it in the days between christmas and new year’s eve.
I’m also using some 2.5s now you can find a sample config in the esphome pages, check them out!

hey @alessandro.gervaso, did you were able to flash it?

I got one shelly EM this week but I was not able to include it, maybe it is faulty or some other problem.
I would like try to replace the firmware maybe it might works

Hi, unfortunately I haven’t had much time so it’s basically still in the box. I’ve just tried to check if it was working (it didn’t connect to the network at first, then it made it).

I’m using a couple of Shelly EMs with esphome and Home Assistant. I use a 120A clamp for input A and a 50A clamp for input B. Calibration is different per channel and I’m putting this down to the clamp type because the original Shelly firmware makes you specify the clamp type per channel, so it makes sense that the calibration difference is attributed to this.

I calibrated an EM flashed with esphome against a stock EM with clamps connected to the same tails. To do this, I used a Tesla charger on a Tesla Model 3 ranging from a 5A to 32A charging rate. I also used various other lower power devices for values <1000W. I then cross-checked the values with a bunch of Shelly PMs on circuits downstream of the EM whose power usage values should add up to the total value reported by the EM and it seems pretty close (usually within 1…2%).

Here’s my config, though it looks like maybe a lambda applying a factor to the sensor value of ~1.143 for 120A clamps and ~1.157 for 50A clamps might also achieve the same thing.

substitutions:
  name: "shellyemworkshop"
  friendly_name: "Shelly EM Workshop"

esphome:
  name: ${name}
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: !secret ssid
  password: !secret ssid_password
  fast_connect: true

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "${friendly_name} FB"
    password: !secret fallback_password

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: !secret api_password

ota:
  password: !secret api_password

web_server:
  port: 80

switch:
  - platform: restart
    name: "${friendly_name} Restart"
    
i2c:
  sda: GPIO12
  scl: GPIO14

sensor:
  - platform: wifi_signal
    name: "${friendly_name} WiFi Signal"
    update_interval: 60
  - platform: ade7953
    voltage:
      name: Workshop Voltage
    current_a:
      name: Workshop Current
    current_b:
      name: Tesla Charger Current
    active_power_a:
      id: workshop_power
      name: Workshop Power
      filters:
      #Reading -> actual
      - calibrate_linear:
        - 5.5 -> 6.25
        - 22.0 -> 25.0
        - 48.0 -> 54.0
        - 70.0 -> 80.0
        - 76.0 -> 88.0
        - 83.0 -> 95.0
        - 89.0 -> 103.0
        - 142.0 -> 162.0
        - 155.0 -> 177.0
        - 159.0 -> 181.0
        - 280.0 -> 320.0
        - 283.0 -> 323.0
        - 1083.0 -> 1240.0
        - 1297.0 -> 1480.0
        - 1512.0 -> 1728.0
        - 1683.3 -> 1924.0
        - 1930.0 -> 2210.0
        - 2130.0 -> 2438.0
        - 2312.0 -> 2645.0
        - 2550.6 -> 2927.0
        - 2755.8 -> 3145.0
        - 2987.4 -> 3415.7
        - 3181.6 -> 3636.8
        - 3381.0 -> 3865.0
        - 3392.2 -> 3884.4
        - 3646.0 -> 4173.0
        - 3829.0 -> 4391.6
        - 4034.8 -> 4617.6
        - 4236.1 -> 4827.8
        - 4253.0 -> 4865.0
        - 4476.0 -> 5121.0
        - 4663.0 -> 5340.0
        - 4845.0 -> 5580.5
        - 5023.0 -> 5738.3
        - 5227.0 -> 5932.0
        - 5432.0 -> 6216.0
        - 5635.0 -> 6419.0
        - 5842.0 -> 6649.5
        - 6030.0 -> 6912.7
        - 6249.7 -> 7150.6
        - 6437.2 -> 7365.8
        - 6642.0 -> 7608.7
      - lambda: if (x <= 0.0) return 0; else return x;
    active_power_b:
      id: tesla_charger_power
      name: Tesla Charger Power
      filters:
      #Reading -> actual
      - calibrate_linear:
        - 3.0 -> 3.5
        - 1064.9 -> 1231.9
        - 1240.1 -> 1434.8
        - 1478.8 -> 1710.2
        - 1683.8 -> 1946.7
        - 1856.7 -> 2147.1
        - 2095.4 -> 2423.9
        - 2294.7 -> 2654.1
        - 2456.4 -> 2840.7
        - 2709.1 -> 3133.5
        - 2916.8 -> 3373.4
        - 3080.6 -> 3563.7
        - 3329.7 -> 3850.7
        - 3558.0 -> 4115.3
        - 3716.3 -> 4298.1
        - 3933.7 -> 4550.6
        - 4137.5 -> 4785.4
        - 4348.4 -> 5029.8
        - 4526.1 -> 5235.4
        - 4716.3 -> 5454.8
        - 4960.6 -> 5738.5
        - 5164.0 -> 5974.2
        - 5366.3 -> 6208.3
        - 5547.8 -> 6419.0
        - 5782.0 -> 6688.4
        - 5948.0 -> 6881.1
        - 6142.1 -> 7107.0
        - 6340.9 -> 7337.2
        - 6545.2 -> 7573.1
      - lambda: if (x <= 0.0) return 0; else return x;
    update_interval: 5s

status_led:
  pin: GPIO0
1 Like

I am buit din’t flash it

After playing around a bit, I’ve decided to go with the lambda approach on my two Shelly EMs. I’m now using the following:

  - platform: ade7953
    voltage:
      name: Workshop Voltage
    current_a:
      name: Workshop Current
    current_b:
      name: Tesla Charger Current
    active_power_a:
      id: workshop_power
      name: Workshop Power
      filters:
      - lambda: if (x <= 0.0) return 0; else return x*1.143207411;
    active_power_b:
      id: tesla_charger_power
      name: Tesla Charger Power
      filters:
      - lambda: if (x <= 0.0) return 0; else return x*1.156612516;
    update_interval: 5s

This gives a pretty decent value when comparing the sum of Shelly 1PMs on all downstream circuits:

image

1 Like

How did you manage to flash it?
With what tools?

Have pinned it correctly with a Velleman VMA440 (that has worked for me before, with other devices, no Shelly though) and a buck converter 5V -> 3.3V and can get info out of it when booting it up normally:

r
rBoot v1.2.1 - [email protected]
Flash Size:   32 Mbit
Flash Mode:   DIO
Flash Speed:  20 MHz
rBoot Option: Big flash

Booting rom 1 (0x108000).
V2
Mo
phy⸮⸮⸮⸮⸮
mode : softAP(a6:cf:12:b9:f2:26)
add if1
dhcp server start:(ip
bcn 0
del if1
usl
mode : null
mode : softAP(a6:cf:12:b9:f2:26)
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100
bcn 0
del if1
usl
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100


SHEM-B9F226 A4:CF:12:B9:F2:26

But when I ground GPIO0 to get it into boot mode, no tools seem to find it.
Have tried directly from HA/ESPHome addon.
Ardunio IDE
Misc esptool (pyhton as well as Windows compiled exes with UI).

But no luck.
“Cannot find headers”-ish is the closest to some error message that would be understandable.