Converts protoheme IX and farnesyl diphosphate to heme O. (2E,6E)-farnesyl diphosphate + H2O + heme b = diphosphate + Fe(II)-heme o Divalent metal cations. Mg(2+) or Ca(2+). Belongs to the UbiA prenyltransferase family.