Compensated compactness, div--curl theorem and $H$-convergence in general Heisenberg groups