We consider the control of the discrete component
$ n_t $
of a switching Markov process
$ x_t = ( z_t, n_t) $
when there is a running cost and an immediate cost
$ c(i, j) $
for switching
$ n_t $
from
$ i $
to
$ j $
. We study the minimization of the ergodic (or long-term average) total cost. Essentially, this paper treats the case where, for
$ n_t=n $
fixed,
$ z_t $
is a reflected diffusion or a reflected diffusion with jumps,
$ n_t $
being, for fixed
$ z $
, a continuous-time Markov chain. Using the vanishing discount approach, we extend existing results dealing with the situation where
$ n_t $
evolves only by the switching control action and the diffusion is non-degenerate. Moreover, we solve the ergodic problem for a class of diffusions which can be degenerate and for an example with absorbing state.