HP_ILO power readings

Hello,

I started using the energy dashboard. and one of the mail components that use powe is my server.
i found the intergration page for ILO (HP Integrated Lights-Out (ILO) - Home Assistant)
For the temperature there is a template availible.
However for the power reading not.
i guess it is so obvious that they didn’t mention it.

 - platform: hp_ilo
    host: 172.16.20.30
    username:****
    password: ****
    monitored_variables:
    - name: Inlet temperature
      sensor_type: server_health
      unit_of_measurement: "°C"
      value_template: '{{ ilo_data.temperature["01-Inlet Ambient"].currentreading[0] }}'
    - name: Verbruik
      sensor_type: server_power_readings
      unit_of_measurement: "Wh"

However the result is

{'present_power_reading': (117, 'Watts'), 'average_power_reading': (114, 'Watts'), 'maximum_power_reading': (129, 'Watts'), 'minimum_power_reading': (114, 'Watts')}

This isn’t exactly usefull for me.
i am only intrested in the present_power_reading.

So question 1. how do i create a template that will extract only the value?
question 2. how i do add an “last reset” so it will be availible in the energy dashboard?

so the first one is finaly solved

    - name: Verbruik
      unit_of_measurement: "Wh"
      sensor_type: server_health
      value_template: "{{ ilo_data.power_supply_summary['present_power_reading'] }}"

However if i try to add
state_class (& device_class) i got an error.

Invalid config for [sensor.hp_ilo]: [state_class] is an invalid option for [sensor.hp_ilo]. Check: sensor.hp_ilo->monitored_variables->1->state_class. (See ?, line ?).

so now i have an nice graph. however the energydashboard ignores it.

still not able to see it in the energy dashboard.
also the value is “117 Watts” instead of “117” (the unit is included in the value) which gives an output of “117 Watts Wh”

Tried
value_template: "{{ (ilo_data.power_supply_summary['present_power_reading']).split(" ")[0] }}"
however it gave me an error expected <block end>, but found <scalar>
with googleing the error i didn’t find anything close to my situation.

and as always, the devil is in the details.
there was a " in the split. instead of an ’
value_template: "{{ (ilo_data.power_supply_summary['present_power_reading']).split(' ')[0] }}"

Sweet! - So pleased you found this out 7 hours ago - just found this and saved me 7 hours of swearing at a screen :grin: :+1:

only problem now is that at the energy dashboard the device usage stays at 0 if you found the solutions for that. please share :wink:

Hi thanks for your work.
I reused your template for getting the power draw of the server. Please be advise that power (in W) measurement do not show up on the Energy Dashboard, there is a way around that. Since the value seems to be precise and updated frequently enough we can calculate the integral thus getting te server’s and energy (in kW/h) consumption see Integration - Riemann sum integral - Home Assistant
So my setup is

      - name: power
        unit_of_measurement: "W"
        sensor_type: server_health
        value_template: "{{ (ilo_data.power_supply_summary['present_power_reading']).split(' ')[0] }}"

And i created an integral sensor of the power to get the consumption and is now showing up in my energy Dasboard.

i was looking for the strange results in my energy dashboard.
i changed the mesurement to W, now i can skip the “Helper”



Only anoying part is that it removes all old data from the energy dashboard.
so now i only have the printscreens above to compare :slight_smile:

while using the “W” is not supported.
after changing back to “wh” the energy dashboard didn’t gave an error. but still no result.
I used the “helper” but as you can see in the above screenshot that wasn’t verry useful.any suggestions.