How to export and import config for entities, especially LocalTuya

How do we export config for devices/integrations? I want to move each device one by one from my test setup to a production setup, and also share config with others/family members.
I found the “Raw Configuration Editor” for the dashboard, which is great for copying the dashboards across, but how do I do the same for Devices/Entities? I’ve been through all the menu’s, hopefully I’m just missing something really simple… To be a little more specific, I’m mostly concerned with LocalTuya, they take an enormous amount of time to manually configure, I need to somehow automate it. From what I can tell, the backup/restore isn’t suitable, it will wipe the existing config in the production setup…

if you have test/prod environments, allow me assume that you are into technical complexity :slight_smile:

all these entities are stored .storage/config_entries.yaml file you can manually move them between environments but it is very easy to screw your system while playing with this file, so be cautious there.


Yes happy to have a technical solution as long as it works!

My .storage didn’t have the file, but it has core.config_entries, core.device_registry and core.entity_registry, are they the same ones you are referring to? At a quick glance through them it seem to have references to the device in all 3 files (and possibly cross referencing), so it looks like it’s possible. Although I have a feeling it’s probably going to take an astronomical amount of time to sift through it all and extract just what I need. Is there any other way?
Can I export the entire “Integration” (LocalTuya in this case) which will take the devices and entities with it? That would work for me.
I’m new to HA so just making sure there’s no “obvious” way that I’ve simply missed of moving a device from one HA to another HA!! I’m also starting to think this is a LocalTuya problem, I don’t have experience with other devices but looks like I’ll need to be more careful before purchasing future devices…

There is no easy/straight forward way of doing this, i believe you are saying that this should be basic feature needs to be delivered out of the box, which is a different discussion.

config_entries file is what you are interested in and it should be enough.