A condition equivalent to the existence of non-equilibrium entropy and temperature for materials with internal variables