Energy Usage: There is no data to show

Hello,
I have a clamp meter directly connected to the egress wire from my meter.
It sends data via Matt to mosquito already configured in HA.
My understanding was that I had to build an entity which gave energy measurements in kWh to be configured as energy source.
So I create a sensor:

- platform: integration
  source: sensor.potenza
  name: energia_consumata
  unit_prefix: k
  round: 2

where my source sensor.potenza is from my Matt source:

- platform: mqtt
  name: "Potenza"
  state_topic: "1694498882.W"
  unit_of_measurement: "W"
  force_update: true
  state_class: measurement
  device_class: power

and I configured this sensor as energy source.

If I go to developer tools I can correctly read values from energia_consumata unfortunately however in the Energy Usage graph I cannot see any value.
I read that it can take up 2 hours for new data to arrive but I configured this interface more than a day ago so I suspect I didn’t catch anything.

Could you help me understanding what is wrong?

Thanks

1 Like

I am having the same issue

 - platform: mqtt
    state_topic: "emon2/phase0"
    name: "Power P0"
    unit_of_measurement: "kWh"
    device_class: "energy"
    state_class: "measurement"
    last_reset_topic: "emon2/phase0"
    last_reset_value_template: '1970-01-01T00:00:00+00:00'

Make sure that your sensors are included in the HA recorder.

Thank for the suggestion, I don’t explicitly “include” the sensor.

The History tab shows the sensor.

I do use @core-mariadb/homeassistant to log the data, could this be the issue?

I got this working:

I have a arduino that logs instantaneous W (watts), every time the power changes the arduino sends an update of the new measure in watts.

This sensor is setup in the sensors.yaml like this:

# Power comes in via this sensor
  - platform: mqtt
    state_topic: "emon/phaseBig0"
    name: "Power Top Floor"
    unit_of_measurement: "W"

# it gets formatted as "Energy" by this integration
  - platform: integration
    name: "Top Floor Consumption"
    source: sensor.power_top_floor
    unit_prefix: k


My configuration.yaml now looks like this:

default_config:

homeassistant:
  customize_glob:
    sensor.*_energy:
      last_reset: '1970-01-01T00:00:00+00:00'
      device_class: energy
      state_class: measurement

#This template is just to change Watts to Kilowatts and apply the kWh unit
template:
  - sensor:
      - name: "Top Floor energy"
        unit_of_measurement: 'kWh'
        state: >
          {{(( states("sensor.top_floor_consumption") | float) /1000)}} 


sensor: !include sensor.yaml

The “Top Floor energy” sensor appears in the “Energy” dropdown

Hope this is helpful.

Thanks so much.
I have a ZWave electric plug that shows a fixed and useless kWh data, and a useful W data, which I could put to use thanks to you ! I was afraid it was not working because of the time it takes to see something in the Energy Dashboard, but now everything seems ok.
Your info would be great in the doc.