We present first-principles (local-density approximation) LDA+U calculations of electronic structure and magnetic state for ${\mathrm{LaCoO}}_{3}$ and ${\mathrm{HoCoO}}_{3}.$ Low-spin to intermediate-spin state transition was found in our calculations using experimental crystallographic data for both materials with a much higher transition temperature for ${\mathrm{HoCoO}}_{3},$ which agrees well with the experimental estimations. Low-spin state ${t}_{2g}^{6}{e}_{g}^{0}$ (nonmagnetic) to intermediate-spin state ${t}_{2g}^{5}{e}_{g}^{1}$ (magnetic) transition of ${\mathrm{Co}}^{3+}$ ions happens due to the competition between crystal-field ${t}_{2g}\ensuremath{-}{\mathrm{e}}_{g}$ splitting and effective exchange interaction between $3d$ spin orbitals. We show that the difference in crystal structure parameters for ${\mathrm{HoCoO}}_{3}$ and ${\mathrm{LaCoO}}_{3}$ due to the smaller ionic radius of Ho ion comparing with La ion results in stronger crystal-field splitting for ${\mathrm{HoCoO}}_{3}$ $(0.09\mathrm{eV}\ensuremath{\approx}1000\mathrm{K}$ larger than for ${\mathrm{LaCoO}}_{3})$ and hence tips the balance between the low-spin and intermediate-spin states to the nonmagnetic solution in ${\mathrm{HoCoO}}_{3}.$