How to set up solar and battery etc with custom operation

Hi all…

I have a slightly different set up here.

I have a battery which feeds my house with 100% of its power at all times between midnight and 0600 generally.
I have a solar system which exports 100% of the generation for economic reasons. This is due to net metering and my loads are all met by the battery.
The battery charges off the grid between 0000 and 0600. This is for economic reasons.

I can add the solar production to the dashboard but it appears to be suggesting that my house load (met by the battery) is being sent to the house which is not true.
I can add the solar as a “return to grid” under the load section, but it doesn’t show the correct value and the house consumption appears to be zero.
I am wondering if the solar production should be seen as a negative value or something?


Your situation is no different to that of anyone with solar and a battery.

The general energy equation for solar and batteries is

Solar + Import + Discharge = Load + Export + Charge

in that energy is immutable, and the sum of generators must equal the sum of consumers.

Home Assistant energy dashboard works very nicely, as long as you use all the relevant sensors correctly. Solar, Grid Import, Grid Export, Battery Charge, Battery Discharge.
This just leaves the ‘house’ load which is calculated as Solar + Import + Discharge - Export - Charge

Solar can only be used, going to load, battery, or grid export

If you generate 24.3 kWh solar in a day, then the HA Energy Dashboard will assume it all goes to the load unless you add the export sensor and the battery charge sensor to show that it goes somewhere else.

If, as you say, you charge your battery from the grid, then this grid-import value is required in the equation to make it balance. If, as you say, you export all your solar, then this grid-export value is required in the equation to make it balance.

Solar 24.3
Discharge 5.57
Import 1.78

total generators 31.65

This generated energy has to go somewhere. You only have 0 kwh to the battery (no charge) and 0 kwh to the grid (no export) hence the equation says
Load = 31.7 since you are not, apparently charging your battery or exporting to grid.

I don’t know what your house load actually is, but assume 10 kWh

Solar 24.3 (from generated solar PV sensor)
Discharge 10.0 (from battery discharge sensor) - supports the load
Import 10.0 (from grid import sensor) - to charge the battery

total 44.3

Load: 10
Export 24.3 - (from grid export sensor) effectively all solar
Charge 10 - (from battery charge sensor) effectively from grid

total 44.3

Then it balances. You just also need to add a ‘return to the grid’ sensor that correctly shows the true grid export, and a battery charge sensor that correctly shows the battery charge.

Solar: 5.56
Import: 0.24
Discharge: 3.80

total 9.6

Export: 0.13
Charge: 4.0
Load: 5.47

total 9.6

1 Like

Thanks for that …

I have some things to work out or create as entities etc.
I took all the solar out for the time being but even that seems to show odd results… Like charging the battery is good, but then the battery doesn’t seem to show the usage of that power in all cases.
It seems to work better if there was no battery charging done and the full day is off battery.