mqtt_subscribe
Subscribe to MQTT topics to receive messages with configurable limits and timeout settings for monitoring IoT data streams.
Instructions
Subscribes to an MQTT topic and receives a specified number of messages or waits for a timeout.
Args:
topic: The MQTT topic to subscribe to (can include wildcards like + or #).
num_messages: The maximum number of messages to receive. Defaults to 1.
timeout: The maximum time (in seconds) to wait for messages. Defaults to 10.
Returns:
A list of dictionaries, where each dictionary represents a received message
with 'topic' and 'payload' keys.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topic | Yes | ||
| num_messages | No | ||
| timeout | No |