In this paper, automatic separation of hybrid system models for industrial automation systems is considered. The proposed method facilitates efficient separation of systemlevel models into component-level models. Such component-level models allow for model-based diagnosis, since a close relation exists between anomalies on a component-level and fault causes. The approach is based on the concept of separation variables, which relate models for components such as electric drives to system modes, i.e. phases of continuous system behaviour. For automation systems, the system modes are defined by sequences of discrete control events. Separation variables determine active components for each system mode, which contribute to the overall output signal on the system-level. System modes and separation variables are automatically learned from training data with normal system behaviour. The proposed method allows both model-based diagnosis and efficient model learning.