Wrong currency in db - unable to store new metrics

Hi

Initially, I had the wrong currency in my settings, later on I’ve corrected it, however, since the latest version, I’m no longer able to have a current cost estimate.

The unit of sensor.3em_channel_a_energy_cost (ILS) 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

Assuming this is a bug, I guess I can try to change the currency on the db, any other ideas? thanks.

You have to edit your recorder database statistics_meta table:

UPDATE statistics_meta SET unit_of_measurement = "ILS" WHERE statistic_id = "sensor.3em_channel_a_energy_cost";
1 Like

thanks @tom_l I’ve successfully update the db, however it seems that its now calculating wrongly, see attached pictures:

where all the sensors are configured with a 0.5 charge rate (e.g. it should be more or less half the KWh)

Strange. I use the “Use an entity with current price” option (cost stored in an input number) and just checked my totals. They’re pretty close (with in a cent or two).

See what happens tomorrow. If it continues you should log a new issue here: