I want to have state showing my solar energy production - my house consumption energy = export energy
Now i have this code:
{{ (states(“sensor.solaredge_i1_ac_power”) | float (0)) - (states(“sensor.trenutna_watt”) | float(0)) }}
If my solar is higher than consumption i have positive values,and if solar is low and consumption high in have negative values.
How to correct the code if is solar lower than consumption my value is 0.
{{ (states(“sensor.solaredge_i1_ac_power”) | float (0)) - (states(“sensor.trenutna_watt”) | float(0)) | max }}
with ( | max ) i have unavailable state/sensor