The Arduino code for our doorbell can be found here:
Now, when the button on the wireless transmitter is pressed, the relay in the receiver closes. When the switch is released, the relay de-energises.
The code runs in a loop, checking the status of the relay in the receiver module, and if it's activated it plays the chime. However, if you slowly release the button, the message to tell the receiver that this has happened is not transmitted (probably because the generator in the energy-harvesting switch does not work properly).
This means that the doorbell can latch on, playing a tune indefinitely. Or at least until the button is pressed again and transmits the release signal.
Suggested improvements/patches to the code are invited