UPS Power Consumption in the Energy Dashboard

Hello
I’m trying to add my Cyber Power PR1500RT2U to the Energy Dashboard. I’ve read some comments about adding some code to the configuration.yaml file. This is what I’ve come up with so far:
sensor:
- name: “UPS Real Load”
state_class: measurement
device_class: power
unit_of_measurement: “W”
state: “{{ states(‘sensor.myups_load’)|float * 0.01 * 1500 * load_factor|round(2) }}”

This creates a “sensor.ups_real_load” however when I try and enable the sensor, I get an error message stating “This entity (‘sensor.ups_real_load’) does not have a unique ID”. How do I correct this? Once corrected is “sensor.ups_real_load” added to the Energy Dashboard?
The UPS is 1500W
I have a “sensor.myups_load”, “sensor.myups_nominal_real_power” and an output power factor = 1.

Can you please advise how best to setup the yaml file so that I can add my UPS to the Energy Dashboard.

Thanks in advance for any help that can be provide.

  1. If that is the load power you need to divide it by the UPS efficiency to get the power drawn from the house (use 0.75 if you don’t know).

  2. That is a power sensor not an energy sensor, so you cant add it to the energy dashboard. Use a Riemann sum helper to convert power to energy. Be sure to use method: left.

  3. You don’t need a unique id unless you want to edit some of the sensor properties from the frontend UI. It is as simple as adding unique_id: something_unique_here to your sensor config.

  4. In future Please format your pasted config correctly. See https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

A couple of things please.
Where in the code does the do I add the 0.75?
Secondly I’m doing a copy and paste of the code from Visual Studio, so hopefully I’ve got the indents right. Thanks for the help.

template:

  • sensor:
    • name: “UPS Real Load”
      state_class: measurement
      device_class: power
      unit_of_measurement: “W”
      state: “{{ states(‘sensor.myups_load’)|float * 0.01 * 1500 * load_factor|round(2) }}”

https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

template:
  - sensor:
      - name: "UPS Real Load"
        state_class: measurement
        device_class: power  
        unit_of_measurement: "W"
        state: "{{ states('sensor.myups_load')|float * 0.01 * 1500 * load_factor|round(2) }}"
1 Like
template:
  - sensor:
      - name: "UPS Real Load"
        state_class: measurement
        device_class: power  
        unit_of_measurement: "W"
        state: "{{ ( states('sensor.myups_load')|float(0) * 0.01 * 1500 /0.75 )|round(2) }}"
        availability: "{{ has_value('sensor.myups_load') }}"

Or simplifying the numbers:

template:
  - sensor:
      - name: "UPS Real Load"
        state_class: measurement
        device_class: power  
        unit_of_measurement: "W"
        state: "{{ ( states('sensor.myups_load')|float(0) * 20 )|round(2) }}"
        availability: "{{ has_value('sensor.myups_load') }}"

Thanks again for the help.
I’ve got the “UPS Real Load” reporting and have setup the integration, however I don’t seem to be able to add the “CyberPower” to my Energy Dashboard. What am I missing? I’m looking for a value of kWh in my Energy Dashboard.

image

Hello
I’m still not able to figure out how to get this information into my Energy Dashboard. Any help would be greatly appreciated. Thanks.

Add the Riemann Sum sensor to it.

Okay Thanks Tom. I’ve done that and will have to wait for the information to flow through to the energy dashboard.