Would you please help me rank the options, according to easiness and price, for doing the following using Java?

I need to receive input from a device. Iím not sure what this device is called yet, but I know it can make a lot of other devices (such as public sinks, paper towel dispensers, and air hand dryers) touchless. It can make them touchless because it knows when something (such as a hand) is waved in front of them. Because I donít know what this device is called, Iíll refer to it as the first device.

I need the sound of my voice to be played when something is waved in front of the first device. I also need the amount of time after something is waved in front of the first device to be kept track of. Please call this amount of time ďxĒ. And, I need the sound of my voice to be played, with a changed volume, when something is waved again in front of the first device, AND when x is greater than one amount of time, AND when x is lesser than another amount of time.

In addition to a speaker that plays the sound of my voice, I also need another output device, a light (whose brightness I can change). I need these two output devices to be far away from the first device.

Would changing the code of a musical doorbell be a good shortcut?

Thank you!