There are X-10 products out there that do this sort of thing. I have X-10 software turning my window candles on and off every night. It's great stuff. They do make motion detectors, although the ones I have are for INSIDE. Search the WEB.
These products come with ALL sorts of gadgets and such. I mean for the $$$, it's not a bad price. The indoor stuff I bought is from X-10.com. There are plenty of other companies out there.