#Can't modify Entity history?

1 messages · Page 1 of 1 (latest)

marble beacon
#

Team,

After struggling for a few hours I have to see if there's someone who can help.

Setup: HA + Lamp + Powercalc.
Changed: the Lamp devicename and entities were renamed. The powercalc entity kept the old name so I <redflag> renamed the entity manually.</redflag>

The history data is migrated succesfully because I can see it. The current state is reset to 0.

Actions:

  • dev tools/states set state of renamed entity to the last known value "3.3004 kWh".
  • With phpMyAdmin, I updated the "0" value in the states table.

After a few minutes, this entity has a state of 0.004 kWh. I tried this a couple of times but now it resets to 0.008 kWh.

It looks like it has a secret state table and 'continues' with data.

Any ideas?
(besides "don't mess with SQL" 🙂 )

marble beacon
#

BTW, I also started updating the statistics_short_term table but the same thing keeps happening. Now, this particular entity is updated to 0.022 kWh even though I updated records in 3 tables + the entity state itself.

There must be another place that stores the 'current' state value. Maybe this has something to do with PowerCalc?

young lily
#

I don't really understand what the problem is

#

You shouldn't be messing with the SQL database unless you absolutely know what you're doing

#

What are you trying to do?

marble beacon
#

Hi Stefan,
After updating the PowerCalc entity to follow my new naming convention, the long- and short-term history was transferred. (screenshot: at the end you see the line dropping to 0)

But for some reason, the state value did not continue at 3.3004 kWh but decided to start over at 0 kWh.

I only want to update the entity so that it continues measuring at 3.3004 kWh. Updating the state through the dev tools doesn't work.

young lily
#

it jumped to 0 when you renamed it? Might just be a coincidence. It does not affect the energy dashboard anyway, it uses the long term statistics table and not the state itself

marble beacon
#

Yes. After renaming the entity state was unavailable for a moment and then started at 0. Even after updating 3 tables + the HA entity state it still seems to have the "new" value stored somewhere.

Not using these entities in the energy dashboard.
About the long term stats: won't, at some point, make this "started from 0" data it into the long-term statistics?

#

The only thing that I can think of is the fact that the entity has "state_class: total_increasing".
Think that resets itself when it hits a value lower than the previous value.

young lily
#

Yes, entities can reset themselves whenever they feel like it