Configuring Shelly EM Energy Meter

Yup. I have since flipped the clamp and readings are positive now.

1 Like

Tasmota has a firmware upgrade option somewhere in it’s web interface (I haven’t used it for ages). Upload the official .bin file using that web interface and you should be back to factory default.

That doesn’t work :frowning:
Original firmware is a zip file with several .bin

The answer is a bit hidden at the top of this thread. The total energy reported by the Shelly is in Watt-minutes; change your value_template to:

value_template: '{{ value_json.meters.0.total | float / 60000 }}'
1 Like

For anyone using Shelly EM you can now reset the totals

"Commands are accepted on:
shellies/shellyem-<deviceid>/emeter/<i>/command accepts message reset_totals to reset total and total_returned energy counters to 0 "

So if you want daily usage you can create an automation in home assistant to reset them daily at midnight.

    - service: mqtt.publish
      data:
        topic: shellies/shellyem-<DEVICEID>/emeter/0/command
        payload: reset_totals
        qos: 1
3 Likes

A question for other users of Shelly EM: does it send 0, when there is no current flowing? It looks like mine only sends numbers if they are different than 0, which makes use of HA filters (like simple average) wrong, they never fall to 0, since 0 readings are missing.
Has anyone else this problem?

I don’t have such a problem. Mine sends 0s without any issues. For instance I only use ch0 and ch1 is reporting 0 for everything.

Hello,

My Shelly EM works almost fine, except one point.
One clamp is connected on my heater. When my heater is switched off : power = 0W, when it is switched on but in standby, power = between -12W and -8W, and then when it is heating it goes up to 4000W as expected.

The clamp is put in the correct way.

It looks exactly like this :

Does anybody have observed anything similar ?

1 Like

I am in the same boat with an inductive cooker. Negative W reports as if the cooker is generating energy in standby.

I have posted the problem in the Facebook support group. Let’s see if someone answer it.

1 Like

Your heater may be connected to the power socket with a three core wire with ‘Live’, ‘Neutral’ and ‘Earth’ running through what looks like a single wire. The clam needs to be on the ‘Live’ wire, and will not work if you are running all of the wires through it. While its possible you are not doing this, your readings suggest something similar. I hope it helps.

Thanks for your answer.
Unfortunately no, only live wire is going through my clamp, the one on the right :


And the clamp is in the correct direction.

I might however try to put the clamp somewer else where I could have more space between wires. Maybe the proximiy of the neutral wire is the cause of my negative measures.

@Shaad, my setup is very similar to yours. I even have more clamps and cables very close to the one doing the measure. However, it seems the only one that gets affected by this (the clams close to the one that reads negative is for the lights circuit and does not show this problem). That’s why my guess is still a problem in the appliance itself: an inductive cooker in my case or heater in yours… :frowning:

Unlikely. It’s a closed magnetic circuit (a transformer with one turn). Speaking of which…

You could try putting two turns through the current clamp if your cabling is long enough. As long as you don’t exceed the clamp current rating rating this will make it twice as sensitive and may pick up the actual current in standby better.

4000W @ 240V = 16A, x2 = 32A. = OK
4000W @ 110V = 32A, x 2 = 64A = NOT OK for a 50A clamp.

I can’t remember if the Shelly EM allows custom clamp types (this would now be a 25A clamp for an originally spec’d 50A version), if not you will have to use template sensors to divide your readings in half.

Very interesting.
I’m on a 20A, so it should be fine even when doubled.
Unfortunately the wire will not be long enough, everything is already really tight in there.

What I’v not tried yet (I think…) is to swap clamps, to see if I have the same behaviour on this cable with the other clamp.

Soy nuevo en esto.?Tengo un Shelly em pero no se hace visibles su red WiFi
Alguien podría ayudarme

Hey Javier,

Any news about your request with the Shelly support about the Shelly EM ? :slight_smile:

I think I will take time to switch my 2 clamps next week-end.

Thanks,
David

No news @Shaad,

I managed to get another meter from another brand (Engage Sub-metering Kit - Individual circuit and solar generation) and it does not read negative values so there is something going on with the shelly. I’ll try to swap clamps to see if anything improves in my setup.

I’am currently with a ticket open in allterco but things progress very slow as they answer me every 4-5 days…

I’ll let you know if I manage to further investigate this, keep me also informed if you make any progress!! Let’s see if we can figure it out…

1 Like

Since this seems to be one of the main threads around setting up a ShellyEM and using the utility_meter component… I thought I’d add my “tweak” to help out any others.

I have 3 ShellyEM devices, all monitoring different circuits I care about.
I had 5 of the total sensors kWh values added together to make a “Total kWh” sensor for my whole house. I then used that total kWh value to feed into my various utility_meter sensors. The problem occurred when my WiFi went down for 10 minutes one day. The individual kWh values all went to “unknown”, but the summed “Total kWh” showed 0 while the WiFi was down, then jumped back up when it was restored.

As some of you already know, when the utility_meter sensor sees a value of 0, then back to a high value, it calculates that as a normal “jump” and it causes a huge spike in the kWh being tracked. Throwing out of wack all the graphs. It basically looked like I instantly consumed a few hundred kWh in a few minutes. oops.

The solution in the end was actually quite simple. My total kWh sensor is simply setup to show “unknown” if ever any 1 of the raw sensors is offline. Now, my utility_meter values don’t go out of wack when any or all of the kWh values are not valid.


- platform: template
  sensors:
    power_total_kwh:
      friendly_name: Power Total kWh
      icon_template: mdi:transmission-tower
      value_template: >-
        {% set p1a = states('sensor.power1a_kwh')|float(-1) %}
        {% set p1b = states('sensor.power1b_kwh')|float(-1) %}
        {% set p2a = states('sensor.power2a_kwh')|float(-1) %}
        {% set p2b = states('sensor.power2b_kwh')|float(-1) %}
        {% set p3a = states('sensor.power3a_kwh')|float(-1) %}
        {{ 'unknown' if p1a == -1 or p1b == -1 or p2a == -1 or p2b == -1 or p3a == -1 else (p1a + p1b + p2a + p2b + p3a) | round(1) }}
      unit_of_measurement: "kWh"
    power_total_watts:
      friendly_name: Power Total Watts
      icon_template: mdi:transmission-tower
      value_template: "{{ 
        (states('sensor.power1a_watts')|float 
        + states('sensor.power1b_watts')|float 
        + states('sensor.power2a_watts')|float 
        + states('sensor.power2b_watts')|float 
        + states('sensor.power3a_watts')|float) | round(1) }}"
      unit_of_measurement: "W"

Hope that helps some out.

3 Likes

hi,
I am new to shelly community. Bought shelly 3em.
Can you tell me how to configure the update interval of mqtt service. Default is 30s and I want it to be 1s. Also which is the UI you are using?

I think I read somewhere that Shelly only updates every 5 minutes. Scanning any faster will only get you the same values. If you are using rest platform set to

scan_interval: 300
1 Like