I have this kWh value, that is calculated from a power sensor.
Is it possible to add a fixed kWh on top of whatever is calculated in the future?
For example; i setup a new device, but i’d like to keep old historic kWh value from before (for example 1000kWh and keep adding to this). How can i add this to helper sensor?
Ok lets say i have a power meter with two power sensors (in my case an inverter that reads power from the grid and on the output).
Now i can calculate lifetime energy of both with integration sensor.
Now i would like to take both integration sensors and their kWh value and subtract them (in my case i’d like to subtract output energy from grid energy). This way, in my case i can get usable energy generated by the system.
I can already calculate that with homeassistant, but it would be far neater to do this on the device (or rather ESP) itself.
- platform: integration
name: '${name} grid energy lifetime'
sensor: smg0_average_mains_power
time_unit: h
restore: true
state_class: total_increasing
device_class: energy
filters:
# Multiplication factor from W to kW is 0.001
- multiply: 0.001
# Add historic values
- offset: 1998
unit_of_measurement: kWh
- platform: integration
name: '${name} output energy lifetime'
sensor: smg0_output_active_power
time_unit: h
restore: true
state_class: total_increasing
device_class: energy
filters:
# Multiplication factor from W to kW is 0.001
- multiply: 0.001
# Add historic values
- offset: 6557
unit_of_measurement: kWh
Basically i’d like to subtract these two and output that value into a new sensor.