I've seen sprinkler thingy's ( technical term !) that have a censor on them and when a cat walks by the sprinkler comes on and said cat gets wet.They are a little pricey though...don't know if they work.I have used the moth balls with success but I didn't have any dogs at that time ,so I would be cautious with dogs around.

Eileen