Read a tone() output

I don't know if my question belongs exactly in this sub, but its a try:
I wan't to use an arduino to read the signals driving a piezo buzzer in a UPS (I want to remove the buzzer and put in the arduino instead which should then read the buzzer pins, and if they "get activated" the arduino should send a message to a kind-of-diy-smarthome-thingy
So how do I determine wether the buzzer would be playing a tone or not?

Typically, one side of the buzzer would be connected to Gnd, and the other gets a signal applied to make it active.

Or one side is connected to power (3.3V, 5V) and the other side gets connected to Gnd to make it active.

If yours does the same, and the level are compatible with an Arduino, you could connect one or the other, and Gnd, read a high or a low and go from there.

If not compatible, there are ways to make them compatible. Take some basic measurements to start, see what there is to play with.

Can you find the ground in the UPS? You'll need a common ground with the Arduino. Can you force the beeper to sound for testing?

Assuming the circuit is completely unknown, I recommend adding an **over-voltage protection circuit**to an Arduino input and then run Digital Read Serial program to see if you get "anything". (I'd increase the resistor to at least 1K, and you might need to enable the internal pull-up resistor.) If you don't know which beeper signal is ground and which is the signal, try the connections to the buzzer one at at a time. If Digital Read doesn't work reliably, try Analog Read.

There is a small chance that the protection circuit or pull-up resistance will mess-up the beeper sound but you will still probably read "something", and we can work on that if it happens.

Some buzzers work like speakers, where you drive them with a square wave and they create sound at whatever frequency the waveform is.

Other buzzers have the oscillator built in, so you just apply power to the buzzer and it makes the sound on its own. Usually the oscillator gets feedback from the transducer inside the buzzer, so it automatically generates a frequency at whatever the natural resonance happens to be. That's why they are so loud with so little power.

Once you get the hardware wired up, if you have the self oscillating type, just use digitalRead. If you have the speaker type, use the FreqMeasure library to read the actual frequency.