Shelly 3EM 3-phases Energy sensor

Hi guys, I’m new HA user, I’m trying home Assistant and I’m still very new to it. I have a question for you, during the first installation (Raspberry 4 on an operating system installed on SD with the whale software) it offered me devices found on the net, including all the Shellys scattered around the house. All right, but I noticed that the Shelly 3Em (gen1) didn’t show the A and B calipers, but only the C. Why? They don’t even appear in the entities, and I’m only using the A. I tried deleting them all to reintegrate them, and now instead of looking for them, it asks me for the ip and inserts them one by one. The 3Em again with only one clamp, the C…


Where am I wrong? If you help me understand something I would be grateful :pray:

Do they apear in the WebConfig of the Shelly itself?

Hi all,

For the last 7 months my Shelly 3EM has been working fine.
However, I noticed an issue/errror yesterday. As you will see it thinks I’m returning energy. I don’t have solar PV and whilst I’d love a refund of £400 this is clearly an error.

Any idea what is causing this and any idea if I can retrospectively fix it as it’s making everything else look wrong.

Thanks!

I wonder if this correction could be done automagically by HA itself. I have the same “issue”. I dont tried the templates here but I also submitted a ticket. Id like a solution, not a workaround. Any new user will face the same issue, right?

Was there any statement from Allterco? I read that some users created tickets.

Hello Guys,

ineed your help, I can’t select the created sensor (total energy) in the energy dashboard. Does anyone have an idea?

template:
  - sensor:  
     - name: "Wärmepumpe Verbrauch aktuell" 
       unique_id: Wärmepumpe_Verbrauch_aktuell
       state: >-
            {{ states('sensor.shellyem3_485519d7a7b9_channel_a_energy')|float(0) +
               states('sensor.shellyem3_485519d7a7b9_channel_b_energy')|float(0) +
               states('sensor.shellyem3_485519d7a7b9_channel_c_energy')|float(0) }} 
       unit_of_measurement: kWh
       device_class: energy 
       state_class: total_increasing
     - name: Batterie_Umrechnung 

thank you

I included mine below as a comparison. The only thing that stands out is that you have Upper Case letters in the unique_id name, and I didn’t think those were allowed, or at least HA will convert those to lower case. And I’m not sure how the ä character is handled. Does the wärmepumpe_verbrauch_aktuell entity show up in HA and have a valid value? I also recall that it takes some time (about an hour) before it can collect enough data to generate the statistics for it to show in the Energy Dashboard.

(I’m only using 2 of the 3EM channels)

template:
  - sensor:
    - name: "Total Energy Used"
      availability: >
        {{ states('sensor.channel_1_energy') not in ['unavailable', 'unknown'] and
        states('sensor.channel_2_energy') not in ['unavailable', 'unknown'] }}  
      state: >-
        {% set state1 = states("sensor.channel_1_energy")|float(0) %}
        {% set state2 = states("sensor.channel_2_energy")|float(0) %}
        {% if is_number(state1) and is_number(state2) %}
        {{ ( state1|float(0) + state2|float(0)) | round(2) }}
        {% endif %}
      unit_of_measurement: "kWh"
      device_class: energy
      state_class: total_increasing

yes the name in unique id is the problem,.

thank you :slight_smile:

took me quite a while, but I ended up getting 3 helpers to define time of use. It’s been working solid for months now. here was my project Power management with CT clamp's 3P meter + PV Solar and TOU tarrif

2 Likes

Hello Guys,

I have a question about the Pro 3EM. The device works perfectly, it has been connected for six months. It is connected directly behind the clock to measure the energy produced by the solar panel and also the consumption of the house. However, I thought I could display the consumption and production separately. But the device just subtracts the value from each other and only shows me the data, that is if the solar system is producing then the value is minus (in case of excess production of course) if not then plus and only the consumption is shown.
I will give you an example. If there is 3000 watts of solar production and the apartment consumes 500 watts then the -2500W value is shown and not separately it comes in as 3000W production and 500W consumption. Can this be solved with one device or should there be two devices, one close to the solar panel and one close to the apartment consumption?

There are currently three entities coming in from shelly that report separate consumption/production data for the three phases.
sensor.shellypro3em_ec6260976820_phase_a_active_power, sensor.shellypro3em_ec6260976820_phase_b_active_power, sensor.shellypro3em_ec6260976820_phase_c_active_power

Is there a solution?

Thanks in advance for your reply!

Shelly Pro 3M can only measure how much power is moving through the wire it’s on.

In your case if you want to measure two different things you should have two Shelly 3EM-s.

  1. One in front of the solar inverter to measure solar production
  2. Second one on the wires to grid to measure grid power. Postive number if you are buying from grid and negative number if you are selling back

Then you can calculate own consumtion, solar production and grid buy/sell.

Maybe you could integrate your solar inverter to HA and get the production number from inverter and then can move Shelly 3EM to grid wire?

Thank you very much for your reply!
Unfortunately, I was right to think that I need two instruments if I want to measure separately. The integration is already done, using a cloud solution, but only 15 minutes of data is received, I would need a physical cable connection between the inverter and the HA to receive real data with a few seconds update, which I don’t know how to do, but then I will probably contact the installer and ask for help to connect the cable.
Thanks again for the reply, I thought maybe it could be done, but then it is not possible.

New Shelly 3EM user. Finaly can track all my power usage. I did already have a lot of smart plugs and other Shelly 2.5 relays that also report energy. I’ve added another Shelly EM in the energy box, to track two fuses for refridgerator and one for microwave oven and oven to which I have no access to. Overall I am doing pretty accurate measurings with those individual devices alone.

All my Shellies were out of their Cloud but since I put the Shelly 3EM to it I can see the value of it. Detailed collection of energy and great overviews. So I will use it also.

Very satisfied with it all. If you have more tips on how to use it even more, please share. Thank you.

what dashboard is this? your card, or some integration?

Oh this is just plain Grafana charts. Simple graph with InfluxDB datasource that I fill from Home Assistant.

Hello, i was using this template for long time, but now i see it gives me error. Im not a dev, anyone to help resolve it? :wink:

TemplateError('ValueError: Template error: float got invalid input ‘unavailable’ when rendering template '{{ (((states(‘sensor.shelly_em3_channel_a_power’)|float) *

# Total power 3EM
template:
  - sensor:
      - name: "Power Total"
        unique_id: power_total
        state: >-
          {{ (states('sensor.shelly_em3_channel_a_power')|float +
              states('sensor.shelly_em3_channel_b_power')|float +
              states('sensor.shelly_em3_channel_c_power')|float) }}
        unit_of_measurement: W
        device_class: power
        state_class: measurement
      - name: "Power Factor Total"
        unique_id: power_factor_total
        state: >-
          {{ (((states('sensor.shelly_em3_channel_a_power')|float) * (states('sensor.shelly_em3_channel_a_power_factor')|float) +
                (states('sensor.shelly_em3_channel_b_power')|float) * (states('sensor.shelly_em3_channel_b_power_factor')|float) +
                (states('sensor.shelly_em3_channel_c_power')|float) * (states('sensor.shelly_em3_channel_c_power_factor')|float)) /
              (states('sensor.shelly_em3_channel_a_power')|float + states('sensor.shelly_em3_channel_b_power')|float + states('sensor.shelly_em3_channel_c_power')|float))
              |int }}
        unit_of_measurement: "%"
        device_class: power_factor
        state_class: measurement

Please replace your

float
to
float(0)

Are you using the Pro 3EM to monitor separate single phase wires? If so, Shelly recently released a firmware update that allows you to set the Pro 3EM into Monophase mode. This means that the 3 different readings will be more clearly separated, and values will no longer be automatically combined. Note that changing this option will delete several old entities from HA, and create some new ones. It might be cleaner to delete the device first, then set it up as new. The downside, of course, is that you’ll lose any history attached to the old entities.

2 Likes

Hoping someone can help considering I have no solar or energy return, and just a plain old US residential split phase service. I had the electrician wire the Shelly as depicted in the appropriate wiring diagram, using just clamp A and C. It appeared to be working fine, but after integrating into Home Assistant the total energy usage/cost is low compared to what my utility provider is reporting. Whether using “monophase” or “triphase” and the “total active energy” sensor, my total daily usage in kw/h seems to be about a 3rd of what it actually is. The graphs between HA and the Utility provider are pretty much on par with what appears to be the total hourly consumption, but the daily totals are out of whack.
I’m at a loss as to whether the electrician didn’t hook it up right, I don’t have the shelly config right, or its a HA energy calc problem. Here’s a link to my current 3EM Pro sensor readings from the shelly and HA, do these look right for USA residential?

They were supposed to wire the voltage reference connections for each of the three phases. If you are using it for single phase measurements, the same phase needs to be wired three times. Its why you have no voltage on the EM1(0). With no voltage, its not calculating active/apparent power

Hi, is there a way to enter the actual counter state? So i don’t have to read out the meter by hand.

I have this with my gas meter. I would like to have that with electricity too.

Thanks