mqtt-development

Implement MQTT topics, handlers, and QoS strategies across ESP32 firmware and Python server.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/Auto-one-Family/Automation-One --skill mqtt-development
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mqtt-development
Source: https://github.com/Auto-one-Family/Automation-One/tree/main/.claude/skills/mqtt-development
Command: npx skills add https://github.com/Auto-one-Family/Automation-One --skill mqtt-development

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Ensures consistent MQTT topic, QoS, and handler implementations across ESP32 firmware and the Python server to prevent protocol drift, message loss, duplicate commands, and synchronization errors between devices and backend services.

Core Features & Use Cases

  • Topic Schema Enforcement: Centralized guidance to add and sync topics between El Trabajante (ESP32) and El Servador (server) so both sides use the exact kaiser/{kaiser_id}/esp/{esp_id}/... format.
  • QoS Strategy & Safety: Clear QoS assignment rules (QoS 2 for commands, QoS 1 for sensor data, QoS 0 for heartbeats) to avoid dangerous duplicates and ensure reliable command delivery.
  • Handler & Publisher Patterns: Standardized handler registration, publisher retry with exponential backoff, and correlation_id usage for traceability.
  • Resilience Patterns: Circuit breaker behavior on ESP32, offline buffers on device and server, last-will handling, and Mosquitto broker configuration for persistence and websockets.
  • Operational References: Concrete file paths and error-code ranges for rapid implementation and debugging (topic builder, mqtt_client, publisher, offline_buffer, constants).
  • Use case: Add a new actuator command topic and guarantee safe delivery by implementing the topic on ESP32 topic_builder.cpp, adding the server constant and TopicBuilder, registering a handler, and using QoS 2 with offline buffering.

Quick Start

Add a new actuator command by defining the server topic constant, extending the server TopicBuilder, adding the corresponding ESP32 topic_builder method, and registering the handler with QoS 2.

Frequently Asked Questions about mqtt-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I ensure MQTT topic schema consistency between ESP32 firmware and a Python server?

To ensure MQTT topic schema consistency, use a centralized topic builder pattern that enforces the exact kaiser/{kaiser_id}/esp/{esp_id}/... format on both ESP32 firmware and the Python server, preventing protocol drift and synchronization errors.

What QoS level should I use for MQTT commands vs sensor data?

For MQTT QoS strategy, assign QoS 2 for critical commands to prevent dangerous duplicates, QoS 1 for sensor data to ensure reliable delivery, and QoS 0 for heartbeats to minimize network overhead.

How do I implement offline buffering and publisher retry with exponential backoff for MQTT?

Implement MQTT offline buffering by storing messages on both the ESP32 device and server when disconnected, and apply publisher retry with exponential backoff alongside circuit breaker behavior to handle connection failures gracefully.

How do I add a new actuator command topic across ESP32 and the server?

To add a new actuator command topic, define the server topic constant, extend the server TopicBuilder, add the corresponding ESP32 topic_builder method, and register the handler using QoS 2 with offline buffering for safe delivery.

Does this MQTT implementation support Mosquitto broker configuration for persistence and websockets?

Yes, the MQTT implementation includes Mosquitto broker configuration for persistence and websockets, alongside last-will handling (LWT) and offline buffer support to maintain reliability across ESP32 and Python server environments.

Why do I need correlation_id in MQTT publisher patterns?

You need correlation_id in MQTT publisher patterns to provide traceability across the ESP32 firmware and Python server, allowing handlers to track message delivery and prevent duplicate commands during retry operations.