Converting Watt (unit) to kWh for individual devices (energy dashboard)

All,

I’m in love with the Energy dashboard. Because of this, i want to add some more items to the individual device monitoring. However to my surprise, the device sensors weren’t visible. After some research, this is due to incorrect device (sensor) configurations in the integration. However even with creating an integration platform, i’m not able to see the devices inside individual device monitoring.

/config/customize.yaml :

sensor.hp_ilo_mit_hvs01_spent:
  device_class: energy
  unit_of_measurement: kWh
  state_class: total_increasing
sensor.hp_ilo_mit_plx01_spent:
  unit_of_measurement: kWh
  device_class: energy
  state_class: total_increasing
sensor.hp_ilo_mit_hvs01_current_power:
  device_class: power
  state_class: measurement
sensor.hp_ilo_mit_plx01_current_power:
  device_class: power
  state_class: measurement

/config/configuration.yaml :

sensor:
  - platform: hp_ilo
    host: 192.168.10.245
    username: Administrator
    password: !secret hpilo
    monitored_variables:
        - name: MIT-HVS01 Current Power
          sensor_type: server_power_readings
          unit_of_measurement: 'W'
          value_template: '{{ ilo_data.present_power_reading[0]}}'
		  
  - platform: hp_ilo
    host: 192.168.10.248
    username: Administrator
    password: !secret hpilo2
    monitored_variables:
        - name: MIT-PLX01 Current Power
          sensor_type: server_power_readings
          unit_of_measurement: 'W'
          value_template: '{{ ilo_data.present_power_reading[0]}}'

  - platform: integration
    source: sensor.hp_ilo_mit_hvs01_current_power
    name: hp_ilo_mit_hvs01_spent
    unit_prefix: k
    unit_time: h
    round: 2

  - platform: integration
    source: sensor.hp_ilo_mit_plx01_current_power
    name: hp_ilo_mit_plx01_spent
    unit_prefix: k
    unit_time: h
    round: 2

I know that there are alot of topics about this, i’ve really done my utmost best trying to solve this!

Hope to hear from anyone!

After some troubleshooting, i’ve managed to fix it.

/config/customize.yaml :

sensor.hp_ilo_mit_hvs01_energy:
  device_class: energy
  unit_of_measurement: kWh
  state_class: measurement
  last_reset: '1970-01-01T00:00:00+00:00'
  
sensor.hp_ilo_mit_hvs01_power:
  device_class: power
  state_class: total_increasing
  
sensor.hp_ilo_mit_plx01_energy:
  unit_of_measurement: kWh
  device_class: energy
  state_class: measurement
  last_reset: '1970-01-01T00:00:00+00:00'
 
sensor.hp_ilo_mit_plx01_power:
  device_class: power
  state_class: total_increasing

/config/configuration.yaml :

sensor:
  - platform: hp_ilo
    host: 192.168.10.245
    username: Administrator
    password: !secret hpilo
    monitored_variables:
        - name: MIT-HVS01 power
          sensor_type: server_power_readings
          unit_of_measurement: 'W'
          value_template: '{{ ilo_data.present_power_reading[0]}}'
		  
  - platform: hp_ilo
    host: 192.168.10.248
    username: Administrator
    password: !secret hpilo2
    monitored_variables:
        - name: MIT-PLX01 power
          sensor_type: server_power_readings
          unit_of_measurement: 'W'
          value_template: '{{ ilo_data.present_power_reading[0]}}'

  - platform: integration
    source: sensor.hp_ilo_mit_hvs01_power
    name: hp_ilo_mit_hvs01_energy
    unit_prefix: k
    round: 2
    
  - platform: integration
    source: sensor.hp_ilo_mit_plx01_power
    name: hp_ilo_mit_plx01_energy
    unit_prefix: k
    round: 2
1 Like