In symplectic geometry, symplectic invariants are useful tools in studying symplectic phenomena. One such invariant is the Hofer–Zehnder capacity, which is defined for any subset of a symplectic manifold. On the other hand, we can associate the so-called displacement energy to any subset. Many symplectic geometers tried to relate the Hofer–Zehnder capacity and the displacement energy to study the behaviour of closed orbits of Hamiltonian diffeomorphisms. Usher proved the so-called ( $$\pi _1$$ -sensitive) sharp energy–capacity inequality between the Hofer–Zehnder capacity and the displacement energy for closed symplectic manifolds. In this paper, we consider a certain Floer homology on symplectic manifolds with boundaries (not symplectic homology) and its spectral invariants. Then we extend the $$\pi _1$$ -sensitive sharp energy–capacity inequality to convex symplectic manifolds. As a corollary, we also prove the almost existence theorem of closed characteristics near displaceable hypersurfaces in convex symplectic manifolds. In particular, we prove the existence of closed characteristics on displaceable contact type hypersurfaces in convex symplectic manifolds (the Weinstein conjecture).