Energy dashboard options

To measure energy, the energy dashboard does a good job if:

  • you have just a single tariff for energy cost
  • you have solar energy which returns energy on all three phases. (Many users of HA have three phase power from grid)

For my case it does just not work well without a helper to correct for energy.

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.

So we need an option in HA energy dashboard to define on which phase we have our power plant. Also we need to have formulas to correct energy consumption for the two cases I described above, using an entity who measures if we have positive value power on the phase of the power plant and use total power or if it is a negative value and we therefore need to use power adding phase 2 and 3 because phase 1 is not consuming.

Because otherwise it just thinks, that we return energy and therefore have no consumption which is wrong in a 3 phase grid with a single phase balcony power plant.

Here is my formula to have correct energy consumption:

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 %}

Another thing that needs upgraded is the energy cost part of the energy dashboard. There should be another option to select: 2 tariff option, where you then have an option to tell which time tariff 1, and otherwise its tariff 2. And then also to add the value of these two tariffs. For returned energy I have just a single tariff, but I don’t know if there are other users who have the need to add two tariffs as well.

I did a helper using schedule to define tariff 1 and else tariff 2. Then I used another helper to state tariff value. Below is my workaround:

{% if is_state(‘schedule.hochtarif’, ‘on’) %}
{{ states(‘input_number.hochtarif’) | float(0) | round(4) }}
{% else %}
{{ states(‘input_number.niedertarif’) | float(0) | round(4) }}
{% endif %}

Thank you.

Both things you describe are already possible. Simultaneous import and export happens too if you have a 3 phase solar system. The only way to do it correctly is to have both the grid import and the grid export sensors configured, as well as the solar production. That way HA can see you are importing from grid at the same time you are exporting, and know which part of solar is going towards the house.

As for tariffs: it does not matter now many tariffs you have, what you need is an entity supplying the current price an use that in the energy dashboard as the price. If the price entity changes during the day, then the dashboard will then calculate the right price during the day. It is basically what you described, so I don’t understand how you think the dashboard can make it any easier. Some people have prices that change every hour or even faster. The price entity gives maximum flexibility.

Time has gone and I have now managed to have it run perfectly fine.
Since I now have some more experience, the tariffs are clear. I got that now.

On the other hand as you describe it does just work for 3 phase solar systems. But many don’t have that. Now I have 3 sensors for grid consumption and 1 sensor for solar production.
How does HA see how much we import from grid? In the description you gave that would mean that HA sees all 3 sensors consumption and the 1 sensor production. Then HA…

Shit. Now I got it.
I completely missed that I can add several sensors for Grid.
It would have been so easy. I did not see to add all 3 sensors to the energy config for grid. I just thought I needed to template together a single sensor for all of this. Because the next “add another Sensor” did show up after adding the first sensor…

The energy flow card on the other hand is a different story. For that I needed these template sensors. And that is not your part. Because of that, a change of energy config would not free up sensors.

But now it runs fine and I think i will leave it like this. Never touch a running system. (Or do a backup before)
My bad. And bad luck. All together. Hmpf!!

Thank you for explaining. Have a good day.

1 Like