If your devices maintained line of sight, you could use an ultrasonic transducer, or a speaker/microphone combination, or possibly an LED and a phototransistor. Acoustic solutions allow less precise alignment, whereas optics allow more precision.
An ultrasonic transducer measures the time that a sound pulse is reflected back, which would give decent accuracy but require some sort of surface on one device from which sound reflected. This probably would not work well with a device you intend to keep very small.
Having one device emit sound pulses and the other detect it could work better, measuring the relative strength of the sound pulse received would indicate how far apart the devices are. But once you introduce obstacles and rooms of a house, not to mention surfaces which reflect or absorb sound, this method is no good.
You could use a radio transmitter and receiver, which would be less susceptible to line of sight issues, but radio frequencies are subject to a lot of attenuation from different types of material. Your accuracy could be affected by more than 10 feet depending on what type of wall(s) and objects are between the devices. Take a pair of cheap walkie-talkies and you'll see what I mean. The signal may be strong at some distance outdoors, but in the house you might find the range severely reduced. Tuning the transmitter/receiver for the desired range detection could prove difficult as well, if you're not familiar with using RF components in your devices.
There are other sensors for proximity detection, that use magnetic fields for example, but they (to my knowledge) are not designed for the ~30 foot range you need.
Without knowing more about the project, it's hard to provide a good suggestion.