I bought one of these cheap chinese sensors. And of course it came without any documentation.
The sensor requires 4.5 - 24 volts. The output is 3,4V (in my case) when there is no nearby magnetic field.
A neodym magnet (4x4mm) will switch on the device (distance 7mm), which means that the output signal drops to near ground voltage. Make sure you turn around the magnet if nothing happens. The magnet will only work in ONE direction.
This illustration might be helpful: