We prove the consistency of the maximum likelihood estimator for a large family of models generalizing the well known Markov-switching AutoRegressive (MS-AR) models by letting the transition probabilities vary in time and depend on covariates. We illustrate our theoretical result on the famous MacKenzie River lynx dataset and on a multi-site model for downscaling rainfall.