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](https://community-assets.home-assistant.io/original/4X/8/c/9/8c91f2597f7d5417ac5b5f10bd586b6742f77002.png)
sensor.iammeter1_importenergy_cost
![image](https://community-assets.home-assistant.io/original/4X/b/b/9/bb9daebc5ec8a5509b44c028a323f1ce3f1b5e9a.png)
sensor.iammeter1_exportgrid_compensation
![image](https://community-assets.home-assistant.io/original/4X/8/1/e/81ee58fdc9776635b6aa1397ba58e1f02cab83f9.png)
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.