Skip to main content

pyintellicenter

Python library for communicating with Pentair IntelliCenter pool control systems over a local network.

PyPI Version Python Versions License CI GitHub Sponsors Ko-fi

What It Does

pyintellicenter is an async Python library for communicating directly with Pentair IntelliCenter pool control systems (i5P, i8P, i10P, and similar) over your local network. It supports both TCP and WebSocket transports, provides real-time push-based equipment state updates, and is the underlying library powering the Pentair IntelliCenter Home Assistant integration.

Features

  • Dual Transport Support: TCP (port 6681) and WebSocket (port 6680) connections
  • Local Communication: Direct connection to IntelliCenter — no cloud required
  • Real-time Updates: Push-based notifications via the NotifyList protocol
  • Per-object Subscriptions: subscribe(objnam, callback) on the model controller (and forwarded by the connection handler) registers any number of per-object or all-object listeners with an unsubscribe remover — see docs/API.md
  • mDNS Discovery: Automatically find IntelliCenter units on your network
  • Async/Await: Built on Python asyncio for efficient I/O
  • Type Annotations: Full type hints for IDE support and static analysis
  • Robust Connection Handling: Automatic reconnection with exponential backoff
  • Circuit Breaker Pattern: Prevents connection storms during outages
  • Home Assistant Ready: Convenience helpers for integration development, including read-only accessors for temperature, chemistry, sensors, heaters, and schedules

Installation

See INSTALL.md for the complete guide.

pip install pyintellicenter
# or
uv add pyintellicenter

Requires Python 3.13+.

Quick Start

Basic Connection (TCP)

import asyncio
from pyintellicenter import ICModelController, PoolModel, ICConnectionHandler


async def main():
    model = PoolModel()
    controller = ICModelController("192.168.1.100", model)
    handler = ICConnectionHandler(controller)
    await handler.start()

    print(f"Connected to: {controller.system_info.prop_name}")
    print(f"Software version: {controller.system_info.sw_version}")

    for obj in model:
        print(f"{obj.sname} ({obj.objtype}): {obj.status}")

    await controller.set_circuit_state("POOL", True)
    await handler.astop()


asyncio.run(main())

await handler.astop() waits for the connection teardown to complete. The synchronous handler.stop() is the best-effort form: it schedules the teardown in the background and is safe to call from callbacks.

WebSocket Connection

from pyintellicenter import ICConnection


async def main():
    async with ICConnection("192.168.1.100", transport="websocket") as conn:
        response = await conn.send_request(
            "GetParamList", condition="", objectList=[{"objnam": "INCR", "keys": ["VER", "SNAME"]}]
        )
        print(response)

Auto-Discovery

from pyintellicenter import discover_intellicenter_units


async def main():
    units = await discover_intellicenter_units(discovery_timeout=5.0)
    for unit in units:
        print(f"Found: {unit.name} at {unit.host}:{unit.port}")
        print(f"  Model: {unit.model}")
        print(f"  WebSocket port: {unit.ws_port}")

Usage

See docs/USAGE.md for full usage patterns. The sections below cover the main concepts.

Connection Behavior

Connection Flow:

  1. Connect — establishes TCP or WebSocket connection
  2. Initialize — fetches system info and all equipment objects
  3. Monitor — receives real-time NotifyList push updates
  4. Keepalive — sends queries every 90 seconds (configurable)

Reconnection Strategy:

  1. Debounce: 15-second grace period before marking disconnected
  2. Exponential Backoff: starts at 30 s, increases 1.5x each attempt (max 10 min)
  3. Circuit Breaker: after 5 consecutive failures, pauses for 5 minutes
  4. Reset: successful connection resets failure counters
  5. Reconcile: every (re)connect prunes equipment deleted at the panel from the model and reports the removals through the update callback as {objnam: None} entries

Handler Lifecycle:

  • await handler.start() — connect and wait for the first successful attempt; reconnection then continues in the background
  • handler.connected — True while the handler considers the connection established (debounced view)
  • handler.stop() — synchronous best-effort stop (teardown runs in the background; safe from callbacks)
  • await handler.astop() — stop and wait for the full connection teardown

Notification Processing:

  • Push notifications are queued (default: 100 items max)
  • Queue prevents slow callbacks from blocking I/O
  • When full, oldest notifications are dropped (prefers fresh state)
  • Both sync and async callbacks are supported

Error Handling

from pyintellicenter import (
    ICError,  # Base exception
    ICConnectionError,  # Connection failures
    ICResponseError,  # Bad response from IntelliCenter
    ICCommandError,  # Command execution error
    ICTimeoutError,  # Request timeout
)

try:
    await controller.start()
except ICConnectionError as e:
    print(f"Connection failed: {e}")
except ICTimeoutError as e:
    print(f"Request timed out: {e}")

Equipment Types

Type Constant Description Common Subtypes
Body BODY_TYPE Body of water POOL, SPA
Pump PUMP_TYPE Variable speed pump SPEED, FLOW, VSF
Circuit CIRCUIT_TYPE Circuit/Feature GENERIC, LIGHT, INTELLI, GLOW, DIMMER
Circuit Group CIRCGRP_TYPE Group of circuits —
Heater HEATER_TYPE Heater GENERIC, SOLAR, ULTRA, HYBRID
Chem CHEM_TYPE Chemistry controller ICHLOR, ICHEM
Sensor SENSE_TYPE Temperature sensor POOL, AIR, SOLAR
Schedule SCHED_TYPE Schedule —
Valve VALVE_TYPE Valve LEGACY

Heater Modes

from pyintellicenter import HeaterType

HeaterType.OFF  # Heater off
HeaterType.HEATER  # Gas/electric heater only
HeaterType.SOLAR_PREFERRED  # Solar preferred, heater backup
HeaterType.SOLAR_ONLY  # Solar only
HeaterType.ULTRA_TEMP  # UltraTemp heat pump only
HeaterType.ULTRA_TEMP_PREFERRED  # UltraTemp preferred
HeaterType.HYBRID_GAS  # Hybrid heater, gas mode
HeaterType.HYBRID_ULTRA_TEMP  # Hybrid heater, heat pump mode
HeaterType.HYBRID_HYBRID  # Hybrid heater, hybrid mode
HeaterType.HYBRID_DUAL  # Hybrid heater, dual mode
# ... and more

Light Effects

from pyintellicenter import LIGHT_EFFECTS

# Available effects for IntelliBrite/MagicStream lights
# PARTY, ROMAN, CARIB, AMERCA, SSET, ROYAL, BLUER, GREENR, REDR, WHITER, MAGNTAR

await controller.set_light_effect("C0003", "PARTY")

API Reference

Full API reference lives in docs/. Key entry points:

Class / Function Purpose
ICConnectionHandler Auto-reconnection wrapper with lifecycle callbacks
ICModelController State management and all convenience helpers
ICBaseController Basic command handling and metrics
ICConnection Low-level transport (TCP or WebSocket)
PoolModel Collection of all pool equipment objects
PoolObject Individual equipment item
discover_intellicenter_units() mDNS discovery of IntelliCenter units on LAN

See docs/API.md for the detailed per-class reference.

Architecture

+----------------------------------------------------------+
|                    ICConnectionHandler                    |
|              (Auto-reconnection, callbacks)               |
+----------------------------------------------------------+
|                    ICModelController                      |
|           (State management, helper methods)              |
+----------------------------------------------------------+
|                     ICBaseController                      |
|              (Command handling, metrics)                  |
+----------------------------------------------------------+
|                      ICConnection                         |
|               (Transport selection, flow control)         |
+----------------------+-----------------------------------+
|      ICProtocol      |       ICWebSocketTransport        |
|    (TCP transport)   |      (WebSocket transport)        |
+----------------------+-----------------------------------+
Layer Class Purpose
Handler ICConnectionHandler Auto-reconnection, lifecycle callbacks
Controller ICModelController State management, convenience methods
Controller ICBaseController Basic command handling, metrics
Connection ICConnection Transport selection, request flow control
Transport ICProtocol TCP communication (port 6681)
Transport ICWebSocketTransport WebSocket communication (port 6680)
Model PoolModel Equipment collection
Model PoolObject Individual equipment item

Development

See docs/DEVELOPMENT.md. In short:

git clone https://github.com/joyfulhouse/pyintellicenter.git
cd pyintellicenter
uv sync --extra dev
uv run pytest
uv run ruff check
uv run mypy src/pyintellicenter

Support

Support Development

This library powers the Pentair IntelliCenter Home Assistant integration and is maintained in spare time with real hardware and tooling costs behind every release. If it is useful to you, please consider supporting its development:

License

This project is licensed under the MIT License — see LICENSE for details.

Metadata

Release files for pyintellicenter 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyintellicenter 0.2.0
File Size Uploaded
pyintellicenter-0.2.0.tar.gz 82.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyintellicenter 0.2.0
File Interpreter ABI Platform
pyintellicenter-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 179.1 kB

Release files / pyintellicenter-0.2.0.tar.gz

Download URL pyintellicenter-0.2.0.tar.gz
Size 82.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9f9da7cd4a8ef4af9c37ba45605c629cd044a2babdbd6fc95fef7e9788b4bf8e
BLAKE2b-256 checksum
How to use checksums
a79cbc39605ebd8bd36fb089b0df6c668d8d1c3d25ce54c6efd9fe8f1ebebc1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.

Transparency log

Release files / pyintellicenter-0.2.0-py3-none-any.whl

Download URL pyintellicenter-0.2.0-py3-none-any.whl
Size 97.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
54363255a57f3d6a3b81344e0f7b95d80b2176c40520773ca690647d723b50b5
BLAKE2b-256 checksum
How to use checksums
b0751cc79734ac54aecc71fc7cb42d7ff16071a1edc51c1f48eb24c3f6c3fcdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.2

2 release files

0.2.1

2 release files

This release

0.2.0 This release

2 release files

0.1.22

2 release files

0.1.21

2 release files

0.1.20

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page