Two independent meters. How to subtract?

I have two Energy Meters independent. One is the electricity generated by my solar system, and other is power consumption installed on my distribution board.

I’d like to know how could I create an entity to subtract Power consumption from Generated Energy. The result will be the Energy Returned.

You can’t subtract power from energy, they are two different things. Assuming you meant “subtract Power consumption from Generated power”:

You can use a template helper.

Settings → Devices & Services → Helpers → Add Helper → Template → Template a sensor

Then Add these options:

  • Name: Whatever you want
  • Template:{{ states('sensor.generated_power')|float - states('sensor.consumption_power')|float }} Replace the entity ids with your actual entity’s ids.
  • Unit of measurement: W
  • Device class: power
  • State class: measurement
  • Device: Optional. Only specify this if you want to add this entity to an existing device.
1 Like