Maybe combine those two ideas. Look around for some kind of
burgler alarm with a motion-activated sound-recording of some
dog-barking.
There are some motion-activated sound makers out there, but these are less
effective than other solutions at the same price range -- the animals
quickly become used to the sound and learn to ignore it. Plus they're just
plain irritating to normal folks.
James