Spin Effects Of Excited States In Organic Semiconductors And Hybrid Perovskites For Optoelectronics And Spintronics