set_port_off
Turn off a device connected to an AC Infinity controller port by setting its mode to OFF and speed to zero. Supports dry run to preview changes before writing.
Instructions
Sets mode to OFF (atType=1) and zeros speed (onSpead=0).
Works for all device types including toggle hardware (heaters, lights, on/off outlets). Uses read-before-write. Defaults to dry_run=True — set dry_run=False to write to the device.
Args: device_id: Device code from discover_devices (e.g. "C58ZA"). port: 1-based port number. dry_run: If True (default), returns the payload that would be sent without writing.
Returns: JSON with action, device_id, port, dry_run, controller_type, sent, and payload (when dry_run=True).
When the port appears to have nothing connected (primary: ``portResistance == 65535``;
fallback for old firmware: default-named ``"Port N"`` with zero load, or a devType=18/22
device), the response also includes a ``warning`` field alerting the grower.
On failure returns ``{"error": "..."}``.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device_id | Yes | ||
| port | Yes | ||
| dry_run | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |