Help with conversion to kWh

Hi Folks,

I’ve been struggling to get this working properly:

Use case: UPS which shows provides output in (W) - trying to get this converted to kWh so I can track usage via the new energy dashboard

First I calculate the W

   ups_power:
        friendly_name: 'UPS Power'
        unit_of_measurement: W
        value_template: "{{ (states('sensor.ups_load')|float * 9)|round(0) }}"

Returns value output in W matching what the UPS shows on it’s display

Now trying to convert to kWh using Riemann

  - platform: integration
    source: sensor.ups_power
    name: ups_energy_spent
    unit: kWh
    round: 2

the new entity ups_energy_spent still doesn’t appear in the energy monitor as a selectable entity… where am I going wrong?

Cheers

D

Watts is a measure of power and can be easily converted to Kilowatts. Energy in kWh is equivalent to 1 kilowatt of power consumed or produced over 1 hour of time.

Your initial question is equivalent on asking how to convert miles of Km distance to mph ot kph speed It cannot be done with out a time element involved somewhere.,

So… like integrating with respect to time, as per Daniel’s second sensor?

@Daniel_Edge you probably need to add these three attributes:

      last_reset: '1970-01-01T00:00:00+00:00'
      device_class: energy
      state_class: measurement
1 Like

Look at powercalc integration, I think it’s the simple solution: