Rename multiple entities by providing a mapping file

I have this annoying problem with entities created by third party cloud services like Tuya. For example, they might create a switch that shows up in HA named switch.wp2_lowerbath_socket_1 which means absolutely nothing to me. So I would use HA to change that to something meaningful like switch.air_filter_motor . Now I use switch.air_filter_motor in automations, scripts, etc and life is fine. Let’s say I “lose” my Tuya integration and I have to rebuild it from scratch. My automations, scripts, etc. will no longer work because when I add the Tuya devices again, the entity names reverted. My “renames” are pointing to ether.

I’m not a fan of using GUIs in general for configuration. I prefer having things documented in files or scripts. What I propose is letting a user create some yaml of “entity renames” using the format of orig: remapped (1 per line). Example:

rename:
  switch.tuya_xxx_socket_1: switch.my_socket_1
  switch.tuya_xxx_socket_2: switch.my_socket_2

Now add to HA Configuration a screen where you can cut n paste this yaml and it will iterate through the list and do the renames for you. I’d also be happy to be able to run a script at the bash prompt and pass in a file. Yes, there would have to be logging to let you know which renames were successful, which failed and why, etc.