Accreting planets have been detected through their hydrogen-line emission, specifically H$alpha$. To interpret this, stellar-regime empirical correlations between the H$alpha$ luminosity $L_mathrm{Halpha}$ and the accretion luminosity $L_mathrm{acc}$ or accretion rate $dot{M}$ have been extrapolated to planetary masses, however without validation. We present a theoretical $L_mathrm{acc}$--$L_mathrm{Halpha}$ relationship applicable to a shock at the surface of a planet. We consider wide ranges of accretion rates and masses and use detailed spectrally-resolved, non-equilibrium models of the postshock cooling. The new relationship gives a markedly higher $L_mathrm{acc}$ for a given $L_mathrm{Halpha}$ than fits to young stellar objects, because Ly-$alpha$, which is not observable, carries a large fraction of $L_mathrm{acc}$. Specifically, an $L_mathrm{Halpha}$ measurement needs ten to 100 times higher $L_mathrm{acc}$ and $dot{M}$ than previously predicted, which may explain the rarity of planetary H$alpha$ detections. We also compare the $dot{M}$--$L_mathrm{Halpha}$ relationships coming from the planet-surface shock or implied by accretion-funnel emission. Both can contribute simultaneously to an observed H$alpha$ signal but at low (high) $dot{M}$ the planetary-surface shock (heated funnel) dominates. Only the shock produces Gaussian line wings. Finally, we discuss accretion contexts in which different emission scenarios may apply, putting recent literature models in perspective, and also present $L_mathrm{acc}$--$L_mathrm{line}$ relationships for several other hydrogen lines.