I'm wondering about the proper way to connect a motorized awning, the kind that homeowners put over their decks and patios. The ones I've been seeing lately have a short length, maybe 6 feet, of cord coming from the motor. I'm sure it's very common to just tuck the cord into the siding/moulding and snake it down to a surface box, or drill a hole and fish it down to a cut in box inside the house. The problem is I'm not too sure either one of these methods is code compliant. My solution has been to mount a weatherproof box near the motor, just below the awning. I enter the power cord for the awning into the box, and fish a length of NM cable through the back of the box into the wall and down to the switch. Is there another way?