Energy dashboard does not work well. My setup:
I use a Shelly pro3em to measure all three phase of grid.
Then I have a Balcony power plant (Balkonkraftwerk) which is putting in Energy but on one phase only. Now the gist:
If we have a little sun, there is energy less than on that phase consumed from the house, that means we use Power from all three phases. But when the sun is strong and powerful shining, then we have returned energy on phase 1, but even if we return energy on phase 1, we still consume energy on phases 2 and 3.
Formula:
For energy, grid consumption: (Power plant is attached to phase a)
{% if states(“sensor.shellypro3em_a0dd6ca1972c_phase_a_active_power”) | float(0) > 0 %}
{{states(“sensor.shellypro3em_a0dd6ca1972c_total_active_energy”) | float(0) | round (4) }}
{% else %}
{{(states(“sensor.shellypro3em_a0dd6ca1972c_phase_b_total_active_energy”) | float(0)) + (states(“sensor.shellypro3em_a0dd6ca1972c_phase_c_total_active_energy”) | float (0)) | round(4) }}
{% endif %}
Now I have created myself a problem: In the energy dashboard we see some large energy returned values.
If these massive value changes negative and positive both are within the hour, then it is just fine. But if it is negative and then a full hour goes by, then the value is displayed as a massive negative stripe. And so is the returned energy value. That corrects itself until the day ends. But I had several cases where the cost value did not. Thats not good.
The reason for this is to be found in template above.
Every time the value of the phase 1 changes from positive to negative, the energy value changes. An example: No sun, Shelly total active energy is lets say 450kWh. And then the sun comes out, the value of phase 1 gets negative and then it states the addition of phase b and c total active energy which is lets say 200kWh. That makes a jump in the statistics which explain these massive jumps in the strips in the energy dashboard.
I did a Feature request to have it implemented in HA for future but as long as it is not implemented, I will have this problem.
Maybe anyone has a hint on how to prevent this bars from doing wrong to the cost part.
I know how to correct such values within the statistics but I don’t like to do this every second day because its just so many values to correct, specially on some clouds days as the sun appears and disappears every 5 minutes or so and that creates a massive amount of statistics energy and costs to correct.
Now I am a new user and so I need to split this pics in several posts. I am doing 1 to 4 in Order:
Here is the stripes and below the picture with the cost that recovered
1