set_humidity_automation
Enable humidity-based automation on a controller port by setting minimum and maximum relative humidity thresholds. The controller adjusts fan speed to maintain humidity within the defined range.
Instructions
Enable humidity automation on a port using the built-in humidity sensor.
Switches the port to AUTO mode (atType=3) and sets the humidity thresholds. The controller speeds up when humidity exceeds max_rh and slows down below min_rh. Uses read-before-write. Defaults to dry_run=True.
Args: device_id: Device code from discover_devices (e.g. "C58ZA"). port: 1-based port number. min_rh: Minimum relative humidity threshold (%), range 0–100. Sub-percent values are rounded to the nearest integer (e.g. 50.5 → 51). max_rh: Maximum relative humidity threshold (%), range 0–100. Must exceed min_rh. Sub-percent values are rounded to the nearest integer. dry_run: If True (default), returns the payload that would be sent without writing.
Returns:
JSON with action, device_id, port, min_rh, max_rh, dry_run,
controller_type, sent, and payload (when dry_run=True).
On failure returns {"error": "..."}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device_id | Yes | ||
| port | Yes | ||
| min_rh | Yes | ||
| max_rh | Yes | ||
| dry_run | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |