Summary: Failed smart socket (power monitoring, Tasmota). How to replace with a new one, maintaining the power monitoring data for energy graphs
I have reviewed documentation, but it seems geared towards initial setup and then everything working happily forever . Iām more than happy to be shown to right docs or even to write them up if I understand it well enough after weāve solved this.
Detail:
One of my power monitoring, switched, smart sockets has died and I want to replace it with the least disruption to my Home Assistant setup. Especially as I expect to have to do this a few times a year as these devices age out and fail.
Updating the automations and groups is fairly trivial, but itās the energy graphs Iām concerned about.
I want the new device to be recognised as the old device or at least for it to be transparent to the UI as a continuation of the old deviceās data. This is mainly so that I can continue to seamlessly compare the energy usage of (in this case) the dishwasher over time.
I just noticed something else about your setup. last_reset is deprecated. I donāt believe that is actually and issue but you should know This approach has been deprecated and will be interpreted as a total_increasing state class instead with an automatic last reset.
Thanks for the guidance @giqcass, this worked quite well.
Shutdown Home Assistant
ācore stopā from console (connected via Synology VM manager)
For the old device:
a. I deleted the old deviceās entries in core.entity_registry and core.device_registry.
b. Noted the entity_ids of each
For the new device:
a. Updated all the core.entity_registry and core.device_registry entries editing the entity_id property to that of the device/ entity each was replacing
Started Home Assistant
a. ācore startā from console (connected via Synology VM manager)
What I didnāt mention is that I was re-purposing another smart plug which had already been used. Unfortunately it was reading 40kWh and has over reported this to HA Energy. No big deal, but worth mentioning in case anyone else reads this who needs to do the same.
I suspect that I might have been able to avoid this with some manipulation of other properties or a DB change, but I would advise others to reset the counts on the smart plug device manually to avoid this issue