Energy Dashboard: Question of understanding

I have a Shelly em3 for energy measurement (operator’s meter in the basement, Shelly in the fuse box in the apartment). Previously I had entered the 3 phases individually in the Energy Dashboard, so far so good. Since short I also operate a balcony power plant (PV) with a Hoymiles HM-800 inverter.

This hangs only on one phase (L2 for me) and therefore the view in the dashboard did not fit, of course, as far as the self-used solar power is concerned. The meter in the basement works balancing (german: saldierend).

Now I have summarized with the help of template sensors the consumption and the feed from the Shelly (each L1, L2, and L3 summed) and taken as sources for the dashboard. Somehow I do not understand the display in the dashboard:

So for example the time between 11:00 and 12:00:

- Power consumption:      0.09 kWh
- Injected:               0.47 kWh
- Consumed solar energy:  0,02 kWh
- Produced solar energy:  0,49 kWh

Why is it in the hours when the produced electricity is higher than the purchase? My expectation is, that The consumed solar Energie would be 0.09kWh

  • The source for consumption is the sum of consumption L1+L2+L3.
  • The source for feed-in is the sum of feed-in L1+L2+L3.
  • The source for photovoltaics is the inverter’s yield per day.

Where is my thinking error?

I summarize the phases as follows:

- sensor:
    - name: "Stromverbrauch Summe"
      unique_id: shelly3em_energy_total
      device_class: energy
      state_class: total_increasing
      unit_of_measurement: "kWh"
      state: >
        {{ 
        states('sensor.shellyem3_ab.........._channel_a_energy')| float(0) + 
        states('sensor.shellyem3_ab.........._channel_b_energy')| float(0) +
        states('sensor.shellyem3_ab.........._channel_c_energy')| float(0) 
        }}

- sensor:
    - name: "Einspeisung Summe"
      unique_id: shelly3em_return_total
      device_class: energy
      state_class: total
      unit_of_measurement: "kWh"
      state: >
        {{ 
        states('sensor.shellyem3_ab.........._channel_a_energy_returned')| float(0) + 
        states('sensor.shellyem3_ab.........._channel_b_energy_returned')| float(0) +
        states('sensor.shellyem3_ab.........._channel_c_energy_returned')| float(0) 
        }}

Conclusion

Ok, now that I’ve written this, I think I know where my mistake in thinking is. The Shelly actually measures what is really being fed in (only L2) and doesn’t balance the phases. So, I need to build a balancing meter with template sensors, right? Does anyone have an approach for me?

The energy dashboard does not work with the three separate phases, so you indeed have to sum the three phases like you do.
I think your set-up is correct as it is: The produced solar energy minus the consumed solar energy is the returned energy, or 0,49 – 0,02 = 0,47 kWh

I have a similar set-up: a three phase energy grid connection with a one phase solar panel system. I also have a Shelly Pro 3EM, but I am using it to measure the energy usage of my three phase heat pump. The three phase grid usage and return I get directly from my smart meter via a Youless LS120.
But I have my HA Energy Dashboard set-up the same as you, and the numbers add correctly for me.

By the way, do I understand it correctly that your Shelly 3EM has separate sensors for the delivery and return of each of the three phases, so six sensors in total? Or did you create these sensors yourself, for instance delivery when positive and returning when negative?

Correct, the Shelly em3 has separate sensors for each phase:

And as you have already recognized, I sum up the sensors of the three phases. The sensors that I use are pure meters, which count the drawn or fed energy in kWh, they are always positive (or even always increasing).

I think the problem is that the meter in the basement works in a balancing way. For example, I generate 150W PV power and take 50W from the grid on the phases L1 and L3, L2 0W (-100W), so 50W is consumed directly, and 100W is fed in.
The meter in the basement shows 0W consumption, the 100W left over from the PV system is charged to L1 and L3 ->100% PV self-consumption.
But the dashboard “sees” that 100W is fed in and also 100W is drawn. So only one-third of the 150W is consumed.
This is technically correct, but the reality with the balancing meters looks different :wink:

I have found a solution for me. I came across this post which got me going in the right direction.

With template sensors, I separate the instantaneous power into everything greater than zero (net consumption) and everything less than zero (net injection).

The meters for consumption and supply are then Riemann sum integral sensors (helper).

- sensor:
    - name: "Net power consumption"
      unique_id: "shelly3em_net_power_consumption"
      unit_of_measurement: "W"
      state: >
        {{ max(0,
           states('sensor.shellyem3_d8..._channel_a_power')| float(0) +
           states('sensor.shellyem3_d8..._channel_b_power')| float(0) +
           states('sensor.shellyem3_d8..._channel_c_power')| float(0)
        )}}
      availability: >
        {{
         [ states('sensor.shellyem3_d8..._channel_a_power'),
           states('sensor.shellyem3_d8..._channel_b_power'),
           states('sensor.shellyem3_d8..._channel_c_power')
         ] | map('is_number') | min
        }}

- sensor:
    - name: "Net power feeding"
      unique_id: "shelly3em_net_power_feeding"
      unit_of_measurement: "W"
      state: >
        {{ min(0,
           states('sensor.shellyem3_d8..._channel_a_power')| float(0) +
           states('sensor.shellyem3_d8..._channel_b_power')| float(0) +
           states('sensor.shellyem3_d8..._channel_c_power')| float(0)
        )| abs}}
      availability: >
        {{
         [ states('sensor.shellyem3_d8..._channel_a_power'),
           states('sensor.shellyem3_d8..._channel_b_power'),
           states('sensor.shellyem3_d8..._channel_c_power')
         ] | map('is_number') | min
        }}