A very simple two state binary MQTT sensor using python .The sensor can be controlled externally using commands sent by MQTT.