So I understand this correctly - you're setting up the tilemap object in the editor ready to paint in, and then you want to generate the tilemap content itself at runtime? Even here - I think it would make more sense to generate your "tile" data using tilemap.SetTile(x, y, ...) and then spawn interactive elements explicitly.
Eg.
Switch switch = Instantiate(switchPrefab, tilemap.GetTilePosition(x, y), Quaternion.identity) as Switch;
Door door = Instantiate(doorPrefab, tilemap.GetTilePosition(x + 10, y), Quaternion.identity) as Door;
switch.target = door;
The main thing here is that you need to link up one interactive item to another. You can do that visually in the editor if you were painting in the tilemap, but its counterintuitive using that same mechanism from code - I think something like the above works a lot better - also feels like it fits better into unity workflow.