How to mass-rename devices?

I have a zillion devices configured in HA over the years and I now realize that I chose a bad naming scheme :sob:

Specifically, all my devices are called a_clever_name. Since this creates entities in the form of DOMAIN.a_clever_name_temperature, I do not know where a device ends, and when the entity starts. So much for a_clever_name.

I would like to rename the devices from snake case (a_clever_name) to camel case (aCleverName) even though this is frowned upon in Python.

Would someone have a bright idea on how to approach this herculean task?

PS. I realize that it requires changing groups, UI, automation, etc. but I really need a better way to programatically discriminate devices from entities

There’s no convenient tool for this task.

One way involves renaming data located in JSON files within the hidden .storage folder. The files can reference one another so it is often insufficient to make changes in just one file. A single mistake in any one file will corrupt the entire system. The files weren’t meant to be hand-edited (that’s why they’re hidden and undocumented) but intrepid and cautious users have done it. Home Assistant cannot be running while the files are edited. If you choose to do this, you should know how to recover from any errors you introduce. I repeat, this is an easy way to corrupt the system and should not be attempted unless you know how to fix your mistakes.

You can’t use camel case for entity_id’s. So doing this change would take your entity_id from domain.a_clever_name_temperature to domain.aclevername_temperature