Source Simian's mqtt-gpio Aims to Simplify Connecting GPIO Pins to MQTT Topics for Home Automation

Available as a pre-built Docker container, mqtt-gpio links a pin or group of pins — input or output — to MQTT topics.

Pseudonymous developer "Source Simian" has released a tool designed to map general-purpose input/output (GPIO) pins on the Raspberry Pi and similar single-board computers to MQTT topics: mqtt-gpio.

"It supports input and output pins; groups of pins; and complex inching. Configurable with YAML," Source Simian writes of his creation. "I run it in K3s on Raspberry Pi OS. The service is built on gpiozero so should work on other devices. It is a very helpful building block in my DIY home automation system. It's a general purpose connector so it can be configured for many different uses."

Designed to run from a container, mqtt-gpio is quickly and easily configured through a single YAML file. Once installed and configured, it connects to any MQTT broker and binds a single GPIO pin or a set of GPIO pins to a given MQTT topic.

Pins linked to MQTT topics can be configured as inputs or outputs with optional pull-up and pull-down resistors configured, along with a user-configurable debounce time. If a particular payload is received, a series of steps can be triggered — each step, naturally, being fully customizable.

"I built mqtt-gpio because I couldn't find an solution to with the same capabilities," Source Simian explains. "I want it to be a project that is quick and easy to get up and running, and helps open up MQTT to anyone."

The source code for the project has been published under the permissive MIT license on GitHub, while a pre-built Docker container is available on Docker Hub.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles