On the electronic and vibronic behaviour of organic and perovskite photovoltaics