Energy Dashboard Data Calculations

Hi, I´m looking for a way to use data and calculate the cost for energy consumption.

So the dilemma:
I have 2 energy meters displaying in the energy dashboard reporting kWh with a price (hourly rate).
I´d like to somehow calculate:

  1. kWh used from meter 1 + 1/2 kWh of meter 2. Output = total kWh
  2. (total kWh * constant) + constant2 + sum of price for meter1 + 1/2 meter2

Im not sure how to do this so any advice are greatly appreciated.