A man started a fire at the home of his ex-partner as a reprisal after she ended their relationship, a court has heard.