Configure multiple power sensors to one energy sensor

Hello All,

I’m a bit lost in all the topics that are created about my issue. Some are old and maybe not applicable anymore.
I have 4 sensors that are measuring power in Watt.
These 4 sensors need to be summed up.
After that I want to add the summed up measurement to one Energy meter in kWh to add to the energy dashboard.
I’ve read about the utility meter and Riemann helper.
But when I want to create a utility meter with multiple inputs that’s not possible in the GUI of HA.
my power sensors are:
sensor.currentcost_power_channel_1
sensor.currentcost_power_channel_2
sensor.currentcost_power_channel_3
sensor.currentcost_appliance_1

How to start with this? My experience with programming is very limited and I’m used to use the GUI of HA.

Create a sensor which is the sum of the 4 others… and than you can use the gui…

And how can I create a sensor that sums up the 4 power sensors?
When that is done, how can I convert from Watt to kWh? Tried the Riemann helper. But that gave me Wh instead of kWh (tested with one power sensor)

1 method

  - sensor:
      - name: "Solar Total"
        unit_of_measurement: "W"
        device_class: power
        state: >
          {{ [ states('sensor.solar_1'),
               states('sensor.fsolar_2') ]
               | map('float') | sum | round (0) }}

another

sensor:
  - platform: template
    sensors:
      solar_total:
        value_template: "{{ (states('sensor.solar_1') | float) + (states('sensor.solar_2')| float) /1000 | round (2) }}"
        unit_of_measurement: 'kWh'
        friendly_name: Solar Total

Divide your sum by 1000 to convert from watts to kWh