I am trying to create a new sensor that can track the amount of kwh I charged the battery with.
Currently I have one value coming from the inverter which says how many kwh went into/out of of the battery but no way to tell how much came from PV and how much from night time charging.
I would need two new entities, battery_grid_charged and battery_pv_charged
I do have all the values I believe I just need to be able to find a way to create the entity (either sensor or utility_meter)
The logic is simple enough:
if( sensor.grid_status = Importing and sensor.solar_battery_status = Charge)
add sensor.solar_battery_power to battery_grid_charged
else
add sensor.solar_battery_power to battery_pv_charged
My question is how to create the battery_grid_charged and battery_pv_charged entities and increment them based on the logic above
Great I can try this once I’m home.
And if I want the same but for monthly, yearly values is it just a matter of creating two new utility_meters and change cycle: daily to monthly and yearly?
It toggles a lot between importing/exporting depending when the value refreshes so it’s not a great one to use.
Might be better to go with if solar_gen > 0 instead option: "{{ 'from_solar' if states('sensor.current_solar_generation') | int > 0 else 'from_grid' }}"