  Aims. We study whether rotational excitation makes a difference to the
abundances of the $\rm H_3^+$ isotopologs, including spin states, in physical
conditions corresponding to starless cores and protostellar envelopes.
  Methods. We developed a new rate coefficient set for the $\rm H_3^+$
isotopologs, allowing for rotational excitation, using the state-to-state rate
coefficients from Hugo et al. These new so-called species-to-species rate
coefficients are compared with previously-used ground state-to-species rate
coefficients.
  Results. The species-to-species and ground state-to-species model results
differ at high density and toward increasing temperatures ($T > 10$ K). The
species-to-species model predicts a lower $\rm H_3^+$ deuteration degree at
high density owing to an increase of the rate coefficients of endothermic
reactions that decrease deuteration. At 20 K the ground state-to-species model
overestimates the abundance of $\rm H_2D^+$ by a factor of about two while the
abundance of $\rm D_3^+$ can differ by an order of magnitude between the
models. Spin-state abundance ratios are also affected, and the new model better
reproduces recent observations of ortho and para $\rm H_2D^+$ and $\rm D_2H^+$.
The applicability regime of the new rate coefficients depends on the critical
densities of the various rotational transitions.
  Conclusions. The difference in the abundances of the $\rm H_3^+$ isotopologs
predicted by the two models is negligible at 10 K but excited states are very
important in studies of deuteration at higher temperatures, for example in
protostellar envelopes. The species-to-species rate coefficients provide a more
realistic approach to the chemistry of the $\rm H_3^+$ isotopologs than the
ground state-to-species rate coefficients do, and so the former should be
adopted in chemical models describing the chemistry of the $\rm H_3^+ + H_2$
reacting system.
