Back to projects

IoT / home automation

Built for the awkward layer
between hardware and the home.

A small event-driven integration that translates device events into MQTT messages for home-automation systems. The bridge turns a closed device protocol into a stable MQTT contract that the rest of a home can understand.

PythonMQTTLinuxDockerHome Assistant

What it does

It gives a closed system a clean, useful contract.

This project is an asynchronous gateway between a private device controller and an MQTT broker. It reads state, translates it into normalized entities, and makes those entities available to Home Assistant through MQTT Discovery.

Input

One persistent device connection with polling, reconnect supervision, and protocol-specific command handling.

Output

Retained MQTT state, discovery metadata, and a small command surface for automations and dashboards.

Runtime

Python 3.11+, async transports, Docker deployment, environment-based configuration, and structured logs.

Failure

Connection loss, stale data, malformed events, and rejected commands are explicit states rather than silent gaps.

System shape

One bridge. Four clear boundaries.

Device layerprivate controller
Bridgeasync Python service
MQTT brokerretained state + commands
Home Assistantdiscovered entities

The device remains the source of truth. MQTT is the transport layer that makes its state composable elsewhere.

The interesting part

Commands are not considered done until the system agrees.

01

Read

The bridge keeps a live transport session and polls a complete device snapshot on a predictable cadence.

02

Normalize

Raw records are correlated by identifier and converted into small, typed state models before they reach MQTT.

03

Publish

Only new or changed values are published, with retained messages so subscribers recover state after a restart.

04

Confirm

Commands move in the opposite direction and are considered complete only when the next snapshot confirms the change.

Useful output

A small surface for a much larger system.

Climate

Temperature and target values become MQTT climate entities.

Humidity

Current readings and thresholds are published as retained state.

Outputs

Momentary actions are exposed as explicit MQTT commands.

Presence

Zone state is normalized into read-only binary sensors.

Event-driven MQTT

A small bridge with a contract the rest of the home can use.

Back to projects