Easy way to transfer automations from tuya cloud to local

I have Tuya cloud installed and all working.
I got Tuya local installed and ready to add.

How do I transfer automations from tuya cloud to local? Each time I add to Tuya local firstly I have issues as it gets named light.library_light2 etc. I will need to rename the cloud ids to I can have the canon ids for local. Then I disable the cloud device.

Then how do I update automations? As soon as I open the UI, it’s stuffed up. Eg I have

  - platform: device
    type: changed_states
    device_id: d58975bfae22d29109ebcd7af72bfeb0
    entity_id: light.library_light
    domain: light

The light.library_light is right, but I guess device_id is not anymore. What would I do? Short of rewriting it all. While light.l starts autocomplete, the device_id I have no idea at all.

There is no way.
THe only thing is to open the automations in 2 windows, and refer as you switch the devices as it deletes the rest of the action when you do.