set_port_mode
Switch a port to any AC Infinity automation mode, from OFF to VPD to timer-based schedules. Provide the device ID and port number to configure.
Instructions
Switch a port to a specific automation mode.
All 8 AC Infinity automation modes are supported. Mode-specific parameters are required for CYCLE, SCHEDULE, TIMER_TO_ON, and TIMER_TO_OFF modes. Uses read-before-write. Defaults to dry_run=True.
For setting automation targets alongside the mode, prefer the dedicated tools:
set_vpd_automation (VPD mode), set_temperature_automation and
set_humidity_automation (AUTO mode).
Args: device_id: Device code from discover_devices (e.g. "C58ZA"). port: 1-based port number. mode: One of OFF, ON, AUTO, VPD, CYCLE, SCHEDULE, TIMER_TO_ON, TIMER_TO_OFF. dry_run: If True (default), returns the payload without writing. cycle_on_seconds: CYCLE mode — seconds the port runs per cycle. Required for CYCLE. cycle_off_seconds: CYCLE mode — seconds the port is off per cycle. Required for CYCLE. schedule_start: SCHEDULE mode — start time as "HH:MM" in device local time. Required for SCHEDULE. schedule_end: SCHEDULE mode — end time as "HH:MM" in device local time. Required for SCHEDULE. timer_duration_seconds: TIMER_TO_ON / TIMER_TO_OFF — countdown duration in seconds. Required for TIMER_TO_ON and TIMER_TO_OFF.
Returns:
JSON with action, device_id, port, mode, 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 | ||
| mode | Yes | ||
| dry_run | No | ||
| cycle_on_seconds | No | ||
| cycle_off_seconds | No | ||
| schedule_start | No | ||
| schedule_end | No | ||
| timer_duration_seconds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |