In my house I want to ingest signals from various sources (e.g. a doorbell at the front door) in my smart house solution from Loxone (https://www.loxone.com) and in the smart house software decide how to act on the input. However, when planning the house I didn't manage to put enough wires in between the electrical cabinet room in the basement and the frontdoor, so I needed an alternative for detecting when someone presses the doorbell button at the front door.
Loxone is unfortunately a bit tricky to interface with directly, so I have implemented the Loxberry (https://www.loxwiki.eu/pages/viewpage.action?pageId=27100273) solution which can (among other things) bridge from the MQTT protocol to the Virtual Inputs supported by the Loxone system.
To convert the electrical signal from the doorbell to MQTT, I use a WEMOS D1 Mini (https://wiki.wemos.cc/products:d1:d1_mini) which I remotely manage with IoT App Story as it is placed hidden in the wall next to the door.
The source code for the app used on the WEMOS D1 Mini can be found here - https://github.com/DocDoo/IoTAppStory_WEMOS_D5_to_MQTT