Skip to main content

No project description provided

Project description

pychlorinator

PyPI - Version PyPI - Python Version PyPI - Downloads License: MIT

A Python BLE (Bluetooth Low Energy) library for controlling Astral Pool Viron eQuilibrium and Halo series pool chlorinators.

It is the foundation for the Home Assistant Astral Pool Viron eQuilibrium Chlorinator integration.

Buy Me A Coffee


Features

Viron / eQuilibrium

  • Read current device state: operating mode, pump speed, pH, chlorine, ORP
  • Control pump: off, auto, manual, low / medium / high speed
  • Switch between pool and spa modes
  • Write pH setpoint, chlorine output level, and default manual speed
  • Acid dosing: disable indefinitely or for a set period
  • Read timers (4 schedules), statistics, and device capabilities

Halo

  • All of the above, plus:
  • Temperature monitoring (board, water, heater, solar)
  • Heater and solar panel control
  • Multi-zone lighting control (on/off, auto, colour, sync)
  • Equipment mode control: filter pump, GPO, valves, relays
  • Maintenance task tracking

Requirements

  • Python 3.8+
  • Bluetooth adapter accessible from the host machine
  • bleak — BLE client
  • bleak-retry-connector — reliable connection handling
  • pycryptodome — AES-128 encryption (used by the device protocol)

Installation

pip install pychlorinator

Usage

Viron / eQuilibrium Chlorinator

import asyncio
from bleak import BleakScanner
from pychlorinator.chlorinator import ChlorinatorAPI

async def main():
    # Discover the device by name or address
    device = await BleakScanner.find_device_by_name("Viron")

    api = ChlorinatorAPI(ble_device=device, access_code="1234")

    # Read all state from the device
    data = await api.async_gatherdata()

    print(f"Mode:        {data['state'].mode}")
    print(f"Pump speed:  {data['state'].speed}")
    print(f"pH:          {data['state'].ph}")
    print(f"Chlorine:    {data['state'].chlorine}")
    print(f"ORP:         {data['state'].orp}")

asyncio.run(main())

Sending commands

from pychlorinator.chlorinator_parsers import ChlorinatorActions

# Turn pump on in auto mode
await api.async_write_action(ChlorinatorActions.Auto)

# Switch to spa mode
await api.async_write_action(ChlorinatorActions.Spa)

# Disable acid dosing for 30 minutes
await api.async_write_action(
    ChlorinatorActions.DisableAcidDosingForPeriod,
    period_minutes=30,
)

# Update setpoints
await api.async_write_setup(ph_setpoint=7.4, chlorine_setpoint=60)

Halo Chlorinator

import asyncio
from bleak import BleakScanner
from pychlorinator.halochlorinator import HaloChlorinatorAPI

async def main():
    device = await BleakScanner.find_device_by_name("Halo")

    api = HaloChlorinatorAPI(ble_device=device, access_code="1234")
    data = await api.async_gatherdata()

    print(f"Water temp:  {data['temp'].water_temperature}")
    print(f"Solar temp:  {data['temp'].solar_roof_temperature}")

asyncio.run(main())

API Reference

ChlorinatorAPI

Method Description
async_gatherdata() Reads all device state, setup, capabilities, timers, and statistics. Returns a dict of parsed characteristic objects.
async_write_action(action, period_minutes=None) Sends a control command. period_minutes is used with DisableAcidDosingForPeriod.
async_write_setup(ph_setpoint, chlorine_setpoint, default_speed) Writes pH setpoint, chlorine output level, and default manual speed.

ChlorinatorActions

Action Description
Off Turn pump off
Auto Auto mode
Manual Manual mode at default speed
Low / Medium / High Manual mode at specific speed
Pool / Spa Switch between pool and spa
DisableAcidDosingIndefinitely Pause acid dosing
DisableAcidDosingForPeriod Pause acid dosing for period_minutes
ResetStatistics Clear historical statistics
TriggerCellReversal Manually trigger cell reversal
DismissInfoMessage Dismiss active info/warning message

HaloChlorinatorAPI

HaloChlorinatorAPI exposes the same async_gatherdata() interface and also accepts action commands via the ChlorinatorActions, HeaterAppActions, SolarAppActions, and LightAppActions enums defined in halo_parsers.


Data Objects

async_gatherdata() returns a dictionary whose values are parsed dataclass-style objects. Key entries:

Key Type Contents
state ChlorinatorState Mode, speed, pH, chlorine, ORP, timer info, info messages
setup ChlorinatorSetup pH and chlorine setpoints, default speed
capabilities ChlorinatorCapabilities Min/max limits for pH and chlorine
timers ChlorinatorTimers Four pump timer schedules
statistics ChlorinatorStatistics pH/ORP min/max, cell reversals, running time, salt level
settings ChlorinatorSettings Acid dosing inhibit status and remaining time
temp (Halo) TempCharacteristic Board, water, heater, and solar temperatures
equipment (Halo) EquipmentModeCharacteristic Pump, GPO, valve, and relay modes
lights (Halo) LightStateCharacteristic Lighting zone state and colour

Contributing

Contributions are welcome. Please open an issue to discuss significant changes before submitting a pull request.

# Install dev dependencies
pip install poetry
poetry install

# Run pre-commit hooks
pre-commit install
pre-commit run --all-files

# Run tests
python -m pytest

Related


License

MIT License — see LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pychlorinator-0.3.0.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pychlorinator-0.3.0-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file pychlorinator-0.3.0.tar.gz.

File metadata

  • Download URL: pychlorinator-0.3.0.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.11.15 Linux/6.17.0-1013-azure

File hashes

Hashes for pychlorinator-0.3.0.tar.gz
Algorithm Hash digest
SHA256 2b6a58a58012a0716f6e573151ba718ca7db40234857d2a846431aa6517c7910
MD5 6894ad1bc520887fe1471ced48f94e4a
BLAKE2b-256 9fe3b252d41a28273c732f3c46684e97829776a23fb39d867a0a32b988082944

See more details on using hashes here.

File details

Details for the file pychlorinator-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pychlorinator-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.11.15 Linux/6.17.0-1013-azure

File hashes

Hashes for pychlorinator-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ee31dbe01d546caec808a1cb15ea949b14af965aaa5372d278ffab65f2a2bac
MD5 8fc038eb4925b45097a6565babc83319
BLAKE2b-256 c89fec1b6d4c105932190f37d7e3582b336aa5102242cedb5ceacc2038f416b8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page