WTH Why you can't merge identical devices

Why you can’t merge identical devices and keep the history.

When a sensor dies, its replacement does not get the history nor the automations etc.

Sensors added using the new style integrations have a unique ID not exposed to the UI.

Looks similar to WTH when I rename an entity, most of the time it's history is lost? - #3 by Gonioul

Similar indeed, but I think it has a different underlying cause.

Other home automation systems allow it.

It would be necessary to be able to either replace the old Id by the new one during a fusion or that the fusion recovers the information of the two sensors under a new ID.

1 Like

A device in HA relates to the physical device. If you replace it, it’s a different device, so with a different id.
You can avoid issues with replacing devices by not using device triggers/conditions/actions, but use state/numeric_state triggers and condtions and service calls. In case you need to replace a device, you can just give the new entities the same entity_id, and everything will work again.

3 Likes

Same problem here, I changed my home energy measure device from a cloud device to a local esphome device. Because I of course want to keep my history I do still have the old cloud based integration but sometimes somehow it’s spits out a mega negative gas or electricity usage…