I have an issue during a migration of my database or when i set back my backup.
My energy dashboard shows up fine, but the energy costs are shown way to high…
How can i correct this?
As the sensor.p1_gas_consumed_cumulative_cost device has really a lot of small entries end it does not match up with the set-up 0.80€ m3 cost in the energy dashboard…
But 50x higher
The devices in the energy dashboard uses the statistics table but you probably already figured that out and yes…that can contain a lot of values. Is it as simple as updating all of them in one go? i.e. all of them for A SINGLE device ?
Yes, but the editing is not that easy, as when i change that value, after 2 hours it again shows wrong…
I did also go into the energy dashboard and put again my m3 price and update. so after 2 hours same thing…
even when i manual edit it without doing the dashboard update, it will get messed up again.
And i don’t know why, it shows value from 3€ and 1.20€ i don’t even know where HASS gets that from…
thats why i reverted back to main hass DB
The thing I found out is that the order of the id in the statistics table matters, i.e. the newest values should have the newest ID too, not just the date matters (at least…not with me) and sum and state have to be updated both
Well its still weird, i did the conversion of my whole database, except the costs are shown wrong somehow, however the rest is all correct with no issue…
I struggled with it too, I tried to add single lines with historical ‘paper’ entries but these then got a new ID and the whole thing went pearshaped…the order matters a lot id and data and sum and state work together was my finding
I suggest to play around with it, create a new manual costs sensor based on nothing and add data, for what I know you only need per-day , i.e. one line per day
could you show me maybe a bit of data where it is wrong? i.e. database, not graphs
I just added a new line and in contrast what I said earlier, for COSTS the ID is no important, just the date
EDIT: so you could re-create it based on the measurements… I (again) agree that this is not nice when wanting to only migrate but it may be the only thing left to do
Well, i maybe have found the issue, but i wait 2 hours just to be sure.
i did remove this line of my conversation --ignore-duplicate-keys and it shows up correct now on my test system, with the correct costs.
SO what i think happened is when it does see suplicated value it did not overwrite the new one, just like you said it needs the new ID so i removed that line and i think it worked.
but i need to wait 2 hours now, lets hope, than you did help me solve the problem
Fingers crossed then !
EDIT: btw, with me, when updating the costs in the DB, it shows immediately, of course…you want to know if the new entries are not beeping it up
As I have no experience in migrating (HA) and no direct interest diving into its technicalities, can you possibly show me what you had in the source and now in the target? Add two zipped tables of ONE device? All in all, I would not see this as rocket science, you should be exporting from one and importing into another db, not?
The adjust stat is OK for one or two things to modify, if (almost) all is beeped-up then this probably won’t be of much help