I have a Shelly 3EM Pro installed on the 3 main phases (L1, L2 and L3). After that the three phases are connected to my energy suppliers smart meter.
I get daily reports from that smart meter of how much electricity I consumed from the grid. The Shelly 3EM Pro is always off by ~10% or more.
I also have a PV connected which supplies energy over L3 (so only one phase).
Initially I thought I could use the Shelly “Total Active Energy” and “Total Active Energy Returned”. But that seems to be very very wrong and also it only updates once per minute to HA. The update interval shouldn’t matter much because the total number still gets tracked by the Shelly 3EM Pro. It only reports it back to HA every 60 seconds. Still the total numbers are wrong.
I then made a little script which is based on the “Total Active Power” sensor.
Basically I summed it up when its value was positive (meaning nothing gets exported to get grid, only imported from the grid) as well as when it was negative (that means I would currently export energy from my PV).
The values become more reasonable now but are still wrong compared to the smart meter of my energy supplier.
Templates.yaml:
- sensor:
# Positive-only (import) from total power
- name: "Shelly Total Active Power Import"
unique_id: shelly_total_active_power_import
unit_of_measurement: 'W'
state_class: measurement
device_class: power
state: >
{% set p = states('sensor.shellypro3em_9454c5b9b340_total_active_power') | float(0) %}
{{ p if p > 0 else 0 }}
- name: "Shelly Total Active Energy Import"
state: "{{ states('sensor.shelly_total_active_power_import_name') }}"
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing
# Negative-only (export) from total power (absolute value)
- name: "Shelly Total Active Power Export"
unique_id: shelly_total_active_power_export
unit_of_measurement: 'W'
state_class: measurement
device_class: power
state: >
{% set p = states('sensor.shellypro3em_9454c5b9b340_total_active_power') | float(0) %}
{{ -p if p < 0 else 0 }}
- name: "Shelly Total Active Energy Export"
state: "{{ states('sensor.shelly_total_active_power_export_name') }}"
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing
Does anyone know whats wrong? Do I have to change my script or is something wrong with my shelly?
I also have a smart plug connected to my PV but that doesn’t help for fixing my problem?