본문으로 건너뛰기
TakoAPI
스킬로 돌아가기
—아직 평가 없음
내 평가

요약

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

설명

이 스킬이 하는 일

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.

사용 시점

  • 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

예시 워크플로

입력

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

에이전트
  1. 1

    Define EnergyMonitorConsumer extending MqttConsumer

  2. 2

    Subscribe to 'home/energy/consumption' in the connect handler

  3. 3

    Parse the incoming payload and save an EnergyReading record via the Django ORM

  4. 4

    Check if watts exceed the threshold and publish to 'home/alerts/energy' if so

출력

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

요구 사항

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

설치

clawhub install sivulich/mqttasgi

CLI 명령을 실행하거나, 프롬프트를 Claude Code, Cursor, Codex 등 사용하는 코딩 에이전트에 붙여넣으세요.

링크