I am not a programmer so I am not sure if it is possible. However If find myself wanting to be able to swap out a sensor or smart plug from time to time. I would like a way to create an object that I can label, for example, lamp, tv, ac unit, etc. I would then be able to attach a sensor to that object and have all its data stored inside the object. This would allow me to change a smart plug for example with a different one as needed. I recognize, I would have to remap sensor data on a case by case basis but that is just details. Is this possible? If not, I would like it to be a feature request as it would be helpful. The objective is to maintain historical data that stays with the object, not the sensor.
I’m pretty sure this is kind of how it works now. Entities are the abstraction.
For example, I can remove (exclude) a z-wave device and swap it with a new one and give it the same name and include it again and it uses the same entity names and thus maintains the history.
This is the over-engineered way I do it: