I have deleted all lines that don’t interest me and made the sample production data more interesting than -0 (you obviously captured this at night)
Here is an example of what I came up with for power sensors
Power being exported exemple
Source: /ivp/meters/readings | Description | W | kW |
---|---|---|---|
value_json[0].activePower | Power Production | 5000.00 | 5.00 |
template sensor calculation | Power Net (calculated) (consumption-production) | -3662.61 | -3.66 |
value_json[1].activePower | Power Consumption | 1337.40 | 1.34 |
template sensor calculation | Power Export (Calculated) (production-consumption) | 3662.61 | 3.66 |
template sensor calculation | Power Import (Calculated) (consumption-production) | 0.00 | 0.00 |
Power imported example
Source: /ivp/meters/readings | Description | W | kW |
---|---|---|---|
value_json[0].activePower | Power Production | 400.00 | 0.40 |
template sensor calculation | Power Net (calculated) (consumption-production) | 937.40 | 0.94 |
value_json[1].activePower | Power Consumption | 1337.40 | 1.34 |
template sensor calculation | Power Export (Calculated) (production-consumption) | 0.00 | 0.00 |
template sensor calculation | Power Import (Calculated) (consumption-production) | 937.40 | 0.94 |
Ok, so I think we have power sensors covered (code for load only users to follow soon)
Unfortunately I am unable to figure out how to calculate energy sensors when load only ct clamp setting is in use, given the data and comments you have provided as they are conflicting for me.
Particularly this comment really confuses me:
This behaviour would indicate it’s recording grid export which doesn’t make sense.
If I were you, I would consider:
- Having another look at eid": 704643584” which is value_json[1].actEnergyDlvd and double check how it behaves when exporting in the day and importing at night.
- Setup Riemann sum integration on the power import and power exports to give you equivalent energy export and energy import sensors.
- changing the “load only” clamp setting/location to “load with solar production”