I have one Aeotec ZW095 Home Energy Monitor on my breaker panel measuring my total, not net, energy draw (load) and a second HEM on the output of my old solar inverter measuring my solar energy production. But the dashboard has no place to configure my total load. Instead, the only place that load can be specified is under “Electricity grid”, which only allows me to specify the portion of the energy drawn from grid along with the energy returned to the grid such as smart meters report.
In the ideal situation, I would have a bidirectional smart meter (that reports both directions of power flow as positive numbers) and a PV inverter both of which I could read into HA, but I have older equipment so I added monitors that simply measure total consumption and total production separately. With all of the energy monitors, smart meters, smart meter interfaces, and battery systems out there, there must be many home energy systems that don’t fit the present model of the HA Energy Dashboard. I know it will complicate things for the developers but I request that the dashboard be modified to provide a total, in contrast to net, load meter and to handle signed power and energy readings everywhere.
If I add my total load monitor as “Grid consumption” and my solar production monitor as “Return to grid”, the dashboard computes everything assuming the total consumption is the sum of these two, which is wrong because a portion of my total load was met by my solar production.
You just need to create the required template sensors to calculate the non-measured values based on what you do have measured.
Also, you might want to change the thread category to ‘Feature Request’.
I intended to categorize this as a feature request so, after your alert, I did. Sorry about that.
I tried using template sensors earlier to make my negative PV power production positve, and succeded in the Lovelace entity card, but the Energy Dashboard configurator would not recognize these sensors. I guess I needed to declare the proper device class and unit of measure somewhere but I couldn’t get that to work either. I could use some coaching here. I am able to do the math in Grafana but this dashboard is more accessible and looks to have a lot of potential.
I have the below example to try and help.
sensor:
- platform: template
sensors:
solar_to_grid:
unit_of_measurement: "W"
value_template: >
{% if float(states('sensor.iotawatt_grid_total')) < 0 %}
{{ float(states('sensor.iotawatt_grid_total')) | abs }}
{% else %}
0
{% endif %}
iotawatt_grid_consumption:
value_template: >
{%if states('sensor.iotawatt_grid_total') | float < 0 %}
0
{% else %}
{{states('sensor.iotawatt_grid_total')| float}}
{% endif %}
iotawatt_grid_feed:
value_template: >
{%if states('sensor.iotawatt_grid_total') | float < 0 %}
{{states('sensor.iotawatt_grid_total_positive')| float}}
{% else %}
0
{% endif %}
To make the sensors Energy panel ‘compliant’ you will need to go to Configuration > Customizations, select the above sensor and add the required attributes for device class etc.
Thanks! I was missing the Customizations piece. With the fix in 2021.9.3, this template sensor, and the recently found absolute value parameter in my home energy monitor, I have 3 solutions to handling negative power flow.
1 Like