The scripts will give you Import, Export and (consumption if you supply the solar generation).
It is not possible to get the solar generation from the Shelly on the mains, as the house load with use some/all of it.
You would need another Shelly on the Inverter to get Solar generation
Returned Energy is the sum of all phases where Energy returned to grid.
Net import or export is the sum of all phases, both Energy in and out.
Net is how your meter works it sums up all the + and - energy flows, which is not the same aa just the returned energy.
It will be incorrect when house load is bigger than solar production:
Phase A = 1000W - 500W(3 phase solar gen) = 500W
Phase B= 1000W - 500W(3 phase solar gen) = 500W
Phase C= 0W - 500W(3 phase solar gen) = -500W
For one hour if the above was static:
Total Active Energy = 1000Wh
Total Active Returned Energy will be 500Wh
Net Energy would really be 500+500-500 = 500Wh(import)
Ok, I understand what it is about, I feed 3-phase but the consumption on the 3 phases is different and the sum of the 3-phases of input and output is the actual consumption.
Consumption is what the house/load is using, which is different from Net import and export, which is the sum of the phases.
It is different due to self consumption of solar production or a battery being present.
It seems like the empty string returned by the first if statement in power_consumption causes errors in the current version of Home Assistant. Iām getting the following error in my log:
ValueError: Sensor sensor.power_consumption has device class 'None', state class 'None' unit 'W' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: '' (<class 'str'>)
Iāve updated the sensor to return None in the first if statement, although Iām not sure if itās better to return Unavailable or Unknown. Note: Iāve just made this change so Iām not 100% sure if this fix works.
# Template sensor for values of power consumption
power_consumption:
friendly_name: "Power Consumption"
unit_of_measurement: 'W'
value_template: >-
{% if (states('sensor.power_export')|float(0)) > 0 and (states('sensor.power_solargen')|float(0) - states('sensor.power_export')|float(0)) < 0 %}
None
{% elif (states('sensor.power_export')|float(0)) > 0 and (states('sensor.power_solargen')|float(0) - states('sensor.power_export')|float(0)) > 0 %}
{{ (states('sensor.power_solargen')|float(0)) - states('sensor.power_export')|float(0) }}
{% else %}
{{ states('sensor.power_import')|float(0) + states('sensor.power_solargen')|float(0) }}
{% endif %}
I would like to show you a solution for communicating with Shelly 3PM using InDriver software and visualizing it with Grafana.
You can download InDriver for free from the http://inanalytics.io website.
How to connect InDriver with Shelly 3PM is explained in the video you can find on the InAnalytics web page.
Hereās what a sample Grafana data visualization looks like. Grafana
So, you have a complete set of information on how to make use of the Shelly meter.
Also this forum thread is full of confusion of what net metering etc. means.
What the Shelly (Pro) 3EM directly supports actually is net metering:
simply take the sum of the three phases, including negative values (when at least on one phase there is more production than consumption).
This way, it does not matter whether the energy accumulation (Riemann sum) over time is done before or after.
In effect, the household essentially takes the grid as a free energy storage,
or in other words, sells excess energy to the utility at retail price,
which is why utilities do not like this model, thus it is forbidden in many countries.
What the HA configuration described in this thread provides is something else, namely two-way metering (typically used for feed-in tariff, German word: ZweiwegezƤhler, see also SolarInfo: StromzƤhler und RĆ¼cklaufsperre):
In each moment, at first the three power values on the three phases are summed up (balance, German word: Saldierung).
Then accumulate all positive balances in one register (import) and all negative ones in another (export).
This way, energy import (consumption) can be billed independently of export (production).
At least in Germany, utilities by default do not compensate for energy export.