LaunchKit · 2026
Back to Skills

mqttasgi

MQTT ASGI protocol server for Django — bridge MQTT messages to Django Channels consumers with full ORM, Channel.

0
0 downloads
by @sivulich

Setup & Installation

openclaw skills install @sivulich/mqttasgi

Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:

npx clawhub install mqttasgi

What This Skill Does

mqttasgi is an ASGI protocol server that connects MQTT brokers to Django Channels consumers. It lets Django handle MQTT messages directly, with access to the ORM, Channel Layers, and async consumer patterns. Built on paho-mqtt, it runs alongside a standard Django Channels setup.

It lets Django developers handle MQTT in the same consumer pattern as HTTP and WebSocket, reusing ORM, Channel Layers, and middleware without running a separate service.

When to use it

  • Receiving IoT sensor readings and storing them in a Django database
  • Triggering home automation actions based on MQTT device messages
  • Publishing real-time alerts when sensor values exceed configured thresholds
  • Coordinating multiple IoT devices using per-device worker consumers
  • Testing MQTT consumers in CI without a running broker

Example Workflow

Here's how your AI assistant might use this skill in practice.

INPUT

User asks: Store energy sensor readings in Django and publish an alert when consumption is too high

AGENT
  1. 1Define EnergyMonitorConsumer extending MqttConsumer
  2. 2Subscribe to 'home/energy/consumption' in the connect handler
  3. 3Parse the incoming payload and save an EnergyReading record via the Django ORM
  4. 4Check if watts exceed the threshold and publish to 'home/alerts/energy' if so
OUTPUT

Energy readings are persisted in Django and high-consumption alerts are published to the MQTT alert topic in real time

Requirements

Accounts, API keys, or tools you or your AI assistant may need to set up while using this skill.

Running MQTT broker (e.g., Mosquitto, HiveMQ, or a cloud MQTT service)