Its required by the National electric code to be 5' away so some idiot doesn't try to touch it while in the spa. Anything on or above the deck needs to be 5' away unless it is powered by a "LISTED" low voltage transformer specifically for a pool/spa. Pool/spa lighting properly installed in the pool and spa equipment are ok from the manufacture underneath with a cover.