python-senz-wifi-module

Python library for the SenzWifi (Pentair Thermal WiFi) API — control your Senz thermostats programmatically with support for temperature settings, boost mode, real-time notifications, and a built-in CLI tool.

A fully async Python client for the SenzWifi (Pentair Thermal WiFi) API — control your Senz thermostats from code or the command line with automatic session management and real-time change notifications.

Key Features

  • Async-first — built on httpx for efficient async operations

  • Automatic authentication & session retry when tokens expire

  • Thermostat control — list, read, and update settings with convenience methods

  • Boost mode — one-line call to start comfort heating

  • Real-time notifications via long-polling for state changes

  • Built-in CLI tool for quick operations without writing code

  • Fully typed with py.typed marker and complete type hints

Installation

pip install senzwifi

Quick Start — Library

List all thermostats and their current state:

import asyncio
from senzwifi import AsyncSenzWifi, RegulationMode

async def main():
    async with AsyncSenzWifi("you@email.com", "your-password") as client:
        await client.authenticate()

        response = await client.get_thermostats()
        for group in response.groups:
            print(f"Group: {group.group_name}")
            for t in group.thermostats:
                mode = RegulationMode(t.regulation_mode).name
                print(f"  {t.room}: {t.temperature_celsius:.1f}°C ({mode})")

        # Set a thermostat to 21°C manually
        await client.set_manual_temperature("SN123456789", 21.0)

asyncio.run(main())

Quick Start — CLI

The library ships with a built-in command-line tool:

# List all thermostats
senzwifi --username "you@email.com" --password "your-password" list

# Set temperature to 21°C
senzwifi --username "you@email.com" --password "your-password" set SN123456789 21.0

# Turn off a thermostat
senzwifi --username "you@email.com" --password "your-password" off SN123456789

# Start boost mode (3 hours by default)
senzwifi --username "you@email.com" --password "your-password" boost SN123456789

Real-Time Monitoring

Watch for thermostat state changes using long-polling notifications:

import asyncio
from senzwifi import AsyncSenzWifi, RegulationMode

async def monitor():
    async with AsyncSenzWifi("you@email.com", "your-password") as client:
        await client.authenticate()

        # Show initial state
        response = await client.get_thermostats()
        for t in response.get_all_thermostats():
            mode = RegulationMode(t.regulation_mode).name
            print(f"[INIT] {t.room}: {t.temperature_celsius:.1f}°C ({mode})")

        # Watch for changes
        while True:
            notification = await client.wait_for_notification()
            if notification:
                t = notification.thermostat
                mode = RegulationMode(t.regulation_mode).name
                print(f"[CHANGE] {t.room}: {t.temperature_celsius:.1f}°C ({mode})")

asyncio.run(monitor())

Regulation Modes

The API supports four regulation modes:

  • SCHEDULE — Use the configured schedule (default)

  • BOOST — Comfort / boost temperature mode

  • MANUAL — Constant temperature setpoint

  • OFF — Heating disabled