This plug-in let'S you capture doorbell pressed and motion events, you are also able to set the power of the IR and the relays.
It uses a local connection and will work without Internet.