So, recently I started the route of integrating all my energy consumption and generation data to Home Assistant. I have a white labeled Solax inverter (Pocket WiFi3.0) for my solar panels, and a Iskramaeco ME260 smart meter for net metering from my distributor. The inverter is around 20 meters away from the net meter, so using the inverter provided CT clamp to measure grid export is a non-starter.
The smart meter has an optical port that is inaccessible to users due to state policies. The only “authorized” ways to automate the readings of the meter are counting the pulses, or reading the actual meter reading using OCR.
Even getting my distributor to tell me what the pulses actually measure has been an ordeal, but I have finally figured out (with no help from my distributor) that the pulses actually measure the net flow of energy through the meter. When I’m exporting to the grid, the pulses measure the export, and when I’m importing from the grid, the pulses measure the import.
Now, I have figured out the pulse meter configurations applicable to my meter really well, to the point that over a single day, it measure only about 6 more pulses than my meter on average, never more than 10 (but also never 0), and tracks with the meter recorded data really accurately.
At this point, I ordered a CT clamp to measure my consumption, but, during my research into these I found that the readings can be inaccurate even after calibration, which I obviously want to avoid. Since I already have accurate generation data from my inverter, and accurate net flow data using the pulse meter, I was wondering if I can use these, to track my real consumption and generation accurately with template sensors.
This is what I have come up with to calculate my energy data, provided I use the CT clamp I ordered to measure the amperage of the main line that enters my home.
when generation amp > consumption amp ---- generation - consumption = flow
---- consumption = generation - flow
---- export = flow
---- import = 0
when consumption amp > generation amp ---- consumption - generation = flow
---- consumption = generation + flow
---- export = 0
---- import = flow
when consumption amp = generation amp ---- flow -> 0
---- consumption = generation + flow (to be conservative with self-sufficiency index)
---- export = 0
---- import = flow
----------------------
SIMPLER(?) VERSION
----------------------
when generation amp > consumption amp: flow is negative.
when generation amp <= consumption amp: flow is positive.
consumption power = generation power + flow power
consumption kWh = generation kWh + flow kWh ---- both generation kWh and flow kWh
---- needs to be reset to 0 when
---- flow changes its sign, right?
---- So, maybe this needs trigger
---- based sensors with transient data?
export power = 0 if flow is positive, else flow
export kWh = only counted if flow is negative ---- possible?
import power = flow if flow is positive, else 0
import kWh = only counted if flow is positive ---- possible?
Can this be effectively translated into template sensors, and be used with Home Assistant?