Update from 2021.8.6 to 2021.9.0 has caused this error in my log:
WARNING (Recorder) [homeassistant.components.sensor.recorder] The unit of sensor.gas_hourly_cost (GBP) does not match the unit of already compiled statistics (£). Generation of long term statistics will be suppressed unless the unit changes back to £
Prior to the update, the energy panel was showing energy use and cost correctly. I had not made any changes to configuration immediately before the upgrade.
In configuration.yaml I have:
currency: GBP
Does anyone have any suggestions how I can get my long term statistics going again?
Thanks for the help. I’ve made the changes as you suggested and the error is no longer appearing in the log, but I still don’t have any costs against usage since the 2021.9.0 update.
I did have errors about the state_class not being “total_increasing” and changed those through developer tools, so all errors now clear but still not showing any costs.
The state class error seems odd as the entities with this error were created by the Utility Meter integration and the documents don’t show a configuration variable to set state_class!
I’m beginning to think I’ll have to remove everything and start again and see if I lose the last couple of months data.
Let me know if that works as I have the same problems:
warning of wrong state_class.
costs not displayed on energy dashboard.
Initially I thought it was because I changed the state_ class to total_increasing as per the warning, but changing back to measurement made no difference.
I removed energy: from configuration.yaml, restarted and then added it back in and restarted again. After this I did not see the warning message but the costs are still not showing.
Despite removing and re-adding energy, some data from the original setup persisted as I had added the costs of the consumed energy with “use a static price” and this was still there. I wonder if whatever stopped the costs being calculated had also persisted.
Logger: homeassistant.components.sensor.recorder
Source: components/sensor/recorder.py:353
Integration: Sensor (documentation, issues)
First occurred: 8:12:00 AM (2 occurrences)
Last logged: 8:12:00 AM
The unit of sensor.energy_import_from_grid_cost (AUD) does not match the unit of already compiled statistics (EUR). Generation of long term statistics will be suppressed unless the unit changes back to EUR
The unit of sensor.energy_export_to_grid_compensation (AUD) does not match the unit of already compiled statistics (EUR). Generation of long term statistics will be suppressed unless the unit changes back to EUR
I’ve changed unit back to EUR and will wait to see if costs are calculated again