#Migrate Energy Consumption

1 messages · Page 1 of 1 (latest)

cinder frigate
#

I want to substitute my current energy grid consumption entity with a new one. What is the proper way in doing so that no data will be lost from anywhere either historical or current?

The new data will be coming from a Shelly device measuring the kWh for the whole house so no energy transformation there.

olive rose
#

The key here is that statistics follows the entity id, unless the new entity id already has statistics, in which case statistics stay with the old id.

#

So if you add a new entity and you want it to start recording new history on top of the old, you just change the new device's entity id to match the old entity id.

cinder frigate
#

@olive rose thanks for your reply. The new entity is not included anywhere in the statistics. But It has a value a total kWh for some period. The old entity id has a different value. But how do I change the entity_id is there a specific order in doing that? So now for the sake of discussion I have the old entity id named old_entity and the new named new_entity. What are the exact steps I need to follow in order to do what you have described?

olive rose
#

You would to first delete your old entity, then rename the new entity id from new_entity -> old_entity

#

There may be a one time discontinuity at the changeover point (can be fixed in developer-tools/statistics), but it should start adding to the old sum after that.

cinder frigate
#

Clear. So the old_entity should not be removed from the grid consumption? Because in order to delete the old_entity I will have to restart Home Assistant

olive rose
#

I think you can leave that setting alone

#

The other easier solution is just add both entities as grid consumption entities

cinder frigate
#

But then I will have duplicate entries unless I zeroed the value of the old entity and then I will have in energy a zeroed value entity

#

Another think. You have mentioned that I might need to fix something from the statistics this is because the values of the two entities are different?

cinder frigate
#

It was easier than I thought. Thanks @olive rose