A man installed two cameras at an address to try and catch his former partner cheating, a court was told.