Electricity Grid should allow a single "Grid total"

Right now the Energy dashboard config asks for both “Grid consumption” and a “return to grid” values. I imagine it wants these both to be positive values. We should be able to provide a single “Grid total” which, when negative, is considered solar surplus returned to the grid.

Most energy monitoring solutions provide this by default. I had to do a lot of configuration to split this up and invert the returned value. It also doesn’t work correctly right now with Iotawatt.

I have an IotaWatt, too, and I can’t figure out how this is supposed to work. I can set up outputs on the IotaWatt but what exactly does “Return to grid” want?

Good question, in the same boat here. It seems to require both grid in and grid out sensors. I created two outputs in IoTaWatt, Grid In and Grid Out, using min/max so that one or the other to zero depending on flow and making grid_out positive. This doesn’t seem to work, showing something like 10,000% energy from the grid. My next try is to make grid_out negative and see if that solves it.

I think there’s an issue with the IotaWatt min/max functions and watt-hours accrual. I opened an issue in Github: API query not accruing correctly when using min/max · Issue #303 · boblemaire/IoTaWatt · GitHub

Still, I’d love to see some intelligence with net metering: positive = grid consumption, negative = grid return. Seems simple enough. Just add a checkbox that specifies “net metering.”

1 Like

try putting your max and min functions at the end, not the start. These work for me.
i have 3 phase power but only single phase solar.

image

I throw these outputs into EmonCMS, and use that to convert power to energy.

1 Like

I’m experimenting with EmonCMS, and that seems to be working for me.

I forgot to add … my return to grid sensor is a positive kWh value of th energy exported from my generated solar back into the grid. That seems to be what it expects.

I had the same issue; my energy data comes from Tesla Solar as net consumption so it goes negative. As a workaround, I created 2 template sensors to turn this single value into separate import and export sensors.

- sensor:
  - name: "Integral SCE Grid Import"
    unit_of_measurement: "kWh"
    state: >
      {% if states('sensor.integral_net_grid_import') | float >= 0 %}
        {{ states('sensor.integral_net_grid_import') }}
      {% else %}
        0
      {% endif %}
    state_class: total_increasing
    device_class: energy

- sensor:
  - name: "Integral SCE Grid Export"
    unit_of_measurement: "kWh"
    state: >
      {% if states('sensor.integral_net_grid_import') | float < 0 %}
       {{ states('sensor.integral_net_grid_import') | float * -1 }}
      {% else %}
        0
      {% endif %}
    state_class: total_increasing
    device_class: energy