The amount of Energy Generated by my Solar Panels
The amount of Energy imported and exported to/from the Grid
The amount of Energy used by my house.
But I dont have a sensor that tells me how much energy is going in and out of my batteries.
I need to write a Template Sensor with this data to give me some values that I can add to the Battery Section of the Energy Dashboard, but I am really struggling with it.
Battery power is Solar - House - Grid Export + Grid Import.
But you shouldnt use energy sensors for that but power sensors.
If you dont have these, you can use utility meters which reset hourly, but then I dont know how to implement that correctly.
It’s the other way around and you need sensor w/ device_class: energy which is product of utility meter.
Also note that the result of this calculation will include, in addition to what flows through the battery, the inverter consumption together w/ AC/DC conversion losses.