Skip to main content

Python library for controlling SAL Pixie BLE mesh wall switches

Project description

Pygsydust

A Python library for controlling SAL Pixie / Telink BLE mesh wall switches - fully offline, no cloud, no hub, no app dependency.

PyPI

Features

  • Full protocol implementation - login, session key derivation, AES-CCM encryption/decryption
  • Device control - on/off, LED indicator control (blue/orange/purple), find-me blink
  • Status monitoring - broadcast queries, real-time push notifications (0xDB/0xDC)
  • Cross-platform - macOS (CoreBluetooth) and Linux (BlueZ via raw HCI)
  • Home Assistant integration - see ha-pigsydust

Install

pip install pigsydust

On Linux, the process needs CAP_NET_RAW (or run as root / --privileged in Docker) for the raw HCI socket used to receive BLE notifications.

Quick Start

import asyncio
from pigsydust import PixieClient

async def main():
    client = PixieClient("AA:BB:CC:DD:EE:FF")
    await client.connect()
    await client.login("Smart Light", "12345678")

    await client.turn_on(1)

    status = await client.query_status()
    for addr, ds in status.items():
        print(f"Device {addr}: {'ON' if ds.is_on else 'OFF'}")

    await client.disconnect()

asyncio.run(main())

API

Method Description
connect() Establish BLE connection (scans on macOS, direct on Linux)
login(name, password) Authenticate with the mesh
turn_on(addr) / turn_off(addr) Control a device, group, or broadcast (0xFFFF)
query_status() Poll all devices and return dict[int, DeviceStatus]
set_led_blue(addr, on) Toggle blue indicator LED
set_led_orange(addr, level) Set orange indicator LED brightness (0-15)
set_led_purple(addr, level) Set purple (both) indicator LED
reset_led(addr) Clear indicator LEDs
find_me(addr) Flash device LED for 15 seconds
on_status_update(callback) Register for real-time push notifications
disconnect() Disconnect and clean up

Mesh credentials

All nodes in a Pixie mesh share two values:

  • Mesh name - typically "Smart Light" (the firmware default)
  • Mesh password - the numeric string shown in the Pixie app's "Share Home" screen

Protocol reference

See docs/PROTOCOL-REFERENCE.md for the complete reverse-engineered protocol specification.

License

MIT

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

pigsydust-0.6.0.tar.gz (48.4 kB view details)

Uploaded Source

Built Distribution

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

pigsydust-0.6.0-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file pigsydust-0.6.0.tar.gz.

File metadata

  • Download URL: pigsydust-0.6.0.tar.gz
  • Upload date:
  • Size: 48.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pigsydust-0.6.0.tar.gz
Algorithm Hash digest
SHA256 8426494a22951cb75e7ad82ff5c6486839288d3203d4bb6158dc37ef11d248f6
MD5 82d47109bfc455ccfd4039b661b221a5
BLAKE2b-256 ac47adf3e437795a103c6ae10f1ec0fb73cf52c4343682b0af2a623c7daf7b19

See more details on using hashes here.

Provenance

The following attestation bundles were made for pigsydust-0.6.0.tar.gz:

Publisher: release.yml on tcslater/pigsydust-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pigsydust-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: pigsydust-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 19.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pigsydust-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e85a328ba6116173d7a823155f1dc9132c2b24f6ed027a4f80d81c6443b86b7
MD5 d1d253465dd260c2ae709d31217cea58
BLAKE2b-256 7f5fa5797be0c32e555bc24418e8bf72396e9e22adf3b3a5a7a4e9d1b4d5eb73

See more details on using hashes here.

Provenance

The following attestation bundles were made for pigsydust-0.6.0-py3-none-any.whl:

Publisher: release.yml on tcslater/pigsydust-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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