Spin-state transition induced half metallicity in a cobaltate from first principles