Statistics for a power entity

I have an entity from an Iammeter power meter which tracks power:

But I cannot use this in a statistics graph:

And the ‘Power’ meters do not show as statistics:

I suspect that it is an issue with the integration, which is a little “unfinished” for Iammeter (incidentally, the Iammeter team advise that they have tried to get the integration reviewed for updates in HA but with no progress in many months).

I have added the following to get the kWh energy sensors to work:

  customize_glob:
    sensor.iammeter3_importenergy_c:
      last_reset: '1970-01-01T00:00:00+00:00'
      device_class: energy
      state_class: total_increasing
    sensor.iammeter3_importenergy_b:
      last_reset: '1970-01-01T00:00:00+00:00'
      device_class: energy
      state_class: total_increasing
    sensor.iammeter3_importenergy_a:
      last_reset: '1970-01-01T00:00:00+00:00'
      device_class: energy
      state_class: total_increasing
    sensor.iammeter1_importenergy:
      last_reset: '1970-01-01T00:00:00+00:00'
      device_class: energy
      state_class: total_increasing
    sensor.iammeter1_exportgrid:
      last_reset: '1970-01-01T00:00:00+00:00'
      device_class: energy
      state_class: total_increasing

What would I need to add to get the power entities to show for stats?

You don’t need to use customize_glob if you aren’t using pattern matching. customize should suffice.
Try this:

  customize:
    sensor.iammeter1_power:
      device_class: power
      state_class: measurement
1 Like

Awesome, thank you for that little bit of info. The original integration suggestion had * wildcards, which was why it used customize_glob I assume… but the wildcards broke cost consumption calculations by applying to HA-created entities (e.g. sensor.iammeter3_importenergy_a_cost) so I have specified each one individually.

I guessed most of the fix (likely while you were typing that reply) and tried this:

  customize_glob:
    sensor.iammeter3_importenergy_c:
      last_reset: '1970-01-01T00:00:00+00:00'
      device_class: energy
      state_class: total_increasing
    sensor.iammeter3_importenergy_b:
      last_reset: '1970-01-01T00:00:00+00:00'
      device_class: energy
      state_class: total_increasing
    sensor.iammeter3_importenergy_a:
      last_reset: '1970-01-01T00:00:00+00:00'
      device_class: energy
      state_class: total_increasing
    sensor.iammeter1_importenergy:
      last_reset: '1970-01-01T00:00:00+00:00'
      device_class: energy
      state_class: total_increasing
    sensor.iammeter1_exportgrid:
      last_reset: '1970-01-01T00:00:00+00:00'
      device_class: energy
      state_class: total_increasing
    sensor.iammeter1_power:
      device_class: power
      state_class: measurement
    sensor.iammeter3_power_a:
      device_class: power
      state_class: measurement
    sensor.iammeter3_power_b:
      device_class: power
      state_class: measurement

…which I will now retry with customize instead of customize_glob.

That now shows me the items as statistics:

But not yet selectable in lovelace statistics card, despite having history:
image

I’ll try again tomorrow.

Long-term statistics won’t be calculated from prior history, only from new states. So you might need to wait for an hour or so.

1 Like