Currently if you rename the entity id, it seems hass will only change its value in the database. This causes a problem that, e.g. previously you have referred to this entity via the old id in an automation script, the script will not anymore, or if you have referred to it in Node-RED.
To solve this, is it possible to add a “refactor” function (many IDEs have this) to change all occurrences of this entity, even inside an add-on?