I currently have a counter running on a Shelly 1PM power sensor, which works well. In order to calculate the costs a little more precisely, I would like to add a counter in parallel, which ONLY counts when the house battery is < 5%.
So I know that the kWh with battery / PV cost me around 8 cents and the other one cost 25 cents (from the grid). Can this be done with a helper or do I have to put a sensor with calculation in my configuration.yaml.
Ideal would be a second entity in the counter helper or a condition that can be set
IF bla = 1
THEN count