Energy not showing costs/compensation

I have energy recording working fine:

Each grid tariff and the solar feed are assigned values:

I have entities which show the accruing values:
sensor.iammeter3_importenergy_a_cost
image
sensor.iammeter1_importenergy_cost
image
sensor.iammeter1_exportgrid_compensation
image

However, none of the $ values show in the Dashboard:


…they all show as $0.00

Recorder seems to be tracking these fine:

Why am I not seeing costs?

Secondly, why does it reset the costs when HA is rebooted? How is it supposed to calculate useful long-term costs?

In Developer Tools / Statistics I have found that the three sensors all show as having issues:

The unit ('AUD') of this entity doesn't match a unit of device class 'energy'.

This looks like a bug?

Errors from logs:

2022-01-08 11:45:10 WARNING (Recorder) [homeassistant.components.sensor.recorder] sensor.iammeter3_importenergy_a_cost has unit AUD which is unsupported for device_class energy
2022-01-08 11:45:10 WARNING (Recorder) [homeassistant.components.sensor.recorder] sensor.iammeter1_importenergy_cost has unit AUD which is unsupported for device_class energy
2022-01-08 11:45:10 WARNING (Recorder) [homeassistant.components.sensor.recorder] sensor.iammeter1_exportgrid_compensation has unit AUD which is unsupported for device_class energy

As soon as I select and save “Use a static price” in “Configure Grid Consumption” it creates an entity which generate the Statistics error.

E.g:


…is immediately followed by:

I cannot use an input number helper, as it rounds to the nearest tenth, i.e. 0.20493 is just rounded to 0.2

I think I have solved this myself…

The Iammeter integration uses the following suggested in configuration.yaml:

customize_glob:
  sensor.*_importenergy*:
    last_reset: '1970-01-01T00:00:00+00:00'
    device_class: energy
    state_class: total_increasing
  sensor.*_exportgrid*:
    last_reset: '1970-01-01T00:00:00+00:00'
    device_class: energy
    state_class: total_increasing

HA is applying that config to the cost/compensation entities as they match the wildcards.

I’ve set configuration.yaml like this to specifically identify my sensors, and the statistics errors have disappeared.

  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

No $ values yet, will see if they populate after a while.