Change entity_id via REST API?

Is there a way to automatically change entity_id for some entities e.g. via script?
I’m a bit tired to do it manually for the tenths of devices via Web UI every time I connect my aqara hub to the freshly installed HA. I’d like to refer them as binary_sensor.window_kitchen instead of binary_sensor.door_window_sensor_158d000155f07b.

I’ve found another way to automate it - there is a file .storage/core.entity_registry where entity_id can be altered, then after restart HA will use the new values. It seems a good idea to make changes while HA is stopped to avoid conflicts.

1 Like

Many thanks! Will check it as well.