Skip to main content

XP Protocol Communication Tools

Project description

🔌 XP Protocol Communication Tool

PyPI version Python package codecov Python 3.10+ License: MIT Checked with mypy

A powerful Python CLI and API toolkit for CONSON XP Protocol operations

Control and communicate with XP devices through console bus (Conbus), parse telegrams in real-time, and integrate with smart home systems like Apple HomeKit.


✨ Key Features

🚀 Real-time Communication Connect directly to XP130/XP230 servers with bidirectional TCP communication

📡 Smart Telegram Processing Parse and validate event, system, and reply telegrams with built-in checksum verification

🏠 HomeKit Integration Bridge XP devices to Apple HomeKit for seamless smart home control

🔍 Device Discovery Automatically discover XP servers and scan connected modules on your network

Modern Architecture FastAPI REST endpoints and comprehensive type safety


🚀 Quick Start

# Install with PIP (recommended)
pip install conson-xp

# Parse a telegram
xp telegram parse "<E14L00I02MAK>"

# Discover XP servers on your network
xp conbus discover

# Start the REST API server
xp api start

📦 Installation

Using PIP (Recommended)

pip install conson-xp

Development Installation

# Using PDM

git clone <repository-url>

pip install pdm

pdm install -G scripts

📚 Usage

🎯 Core Operations

Telegram Processing

# Parse any telegram (auto-detect type)
xp telegram parse "<E14L00I02MAK>"
xp telegram parse "<S0020012521F02D18FN>"
xp telegram parse "<R0020012521F02D18+26,0§CIL>"

# Validate telegram integrity
xp telegram validate "<E14L00I02MAK>"

Device Communication

# Discover XP servers on your network
xp conbus discover

# Connect and scan for modules
xp conbus scan <serial_number> <function_code>
xp conbus scan 0123450001 02

# Control device outputs
xp conbus output <action> <serial_number> <ouput_number>
xp conbus output off 0123450001 00
xp conbus output on 0123450001 01
xp conbus output status 0123450001

# Blink device for identification
xp conbus blink <action> <serial_number>
xp conbus blink on 0123450001
xp conbus blink all on
xp conbus blink all off

Module Information

# Get module details
xp module info 14
xp module search "push button"

# List available modules
xp module list --group-by-category

🔧 Advanced Features

Real-time Operations
# Listen for event telegrams
xp conbus receive

# Send custom telegrams
xp conbus custom <serial_number> <function_code> <action_code>
xp conbus custom 01234500001 02 02

# Read/write datapoints
xp conbus datapoint <datapoint> <serial_number>
xp conbus datapoint hw_version 01234500001
xp conbus datapoint auto_report_status 01234500001
xp conbus datapoint voltage 01234500001
Checksum Operations
# Calculate and validate checksums
xp checksum calculate "E14L00I02M"
xp checksum validate "E14L00I02M" "AK"
xp checksum calculate "E14L00I02M" --algorithm crc32

🌐 API & Integration

REST API Server

# Start API server with interactive docs at /docs
xp api start

HomeKit Smart Home Bridge

# Set up HomeKit integration
xp homekit config validate
xp homekit start
Module emulators
# Start XP protocol servers
xp server start
xp reverse-proxy start

🏗️ Architecture

Layered Design

CLI Layer → API Layer → Services → Models → Connection Layer

Key Components: Telegram processing • Real-time Conbus communication • HomeKit bridge • Multiple XP server support • Configuration management


🛠️ Development

Quick Development Setup

# Run tests with coverage
pdm run test

# Code quality checks
pdm run lint && pdm run format && pdm run typecheck

# All quality checks at once
pdm run check
Project Structure
src/xp/
├── api/           # FastAPI REST endpoints
├── cli/           # Command-line interface
├── models/        # Core data models
├── services/      # Business logic
└── utils/         # Utility functions
Functionalities
<!-- BEGIN CLI HELP -->

xp

xp api
xp api start


xp conbus

xp conbus actiontable
xp conbus actiontable download


xp conbus autoreport
xp conbus autoreport get
xp conbus autoreport set


xp conbus blink

xp conbus blink all
xp conbus blink all off
xp conbus blink all on

xp conbus blink off
xp conbus blink on

xp conbus config
xp conbus custom

xp conbus datapoint
xp conbus datapoint all
xp conbus datapoint query

xp conbus discover

xp conbus lightlevel
xp conbus lightlevel get
xp conbus lightlevel off
xp conbus lightlevel on
xp conbus lightlevel set


xp conbus linknumber
xp conbus linknumber get
xp conbus linknumber set


xp conbus msactiontable
xp conbus msactiontable download


xp conbus output
xp conbus output off
xp conbus output on
xp conbus output state
xp conbus output status

xp conbus raw
xp conbus receive
xp conbus scan


xp file
xp file analyze
xp file decode
xp file validate

xp help

xp homekit

xp homekit config
xp homekit config show
xp homekit config validate

xp homekit start


xp module
xp module categories
xp module info
xp module list
xp module search


xp rp
xp rp start
xp rp status
xp rp stop


xp server
xp server start
xp server status
xp server stop


xp telegram

xp telegram blink
xp telegram blink off
xp telegram blink on


xp telegram checksum
xp telegram checksum calculate
xp telegram checksum validate

xp telegram discover

xp telegram linknumber
xp telegram linknumber read
xp telegram linknumber write

xp telegram parse
xp telegram validate
xp telegram version

<!-- END CLI HELP -->

Requirements: Python 3.10+ • FastAPI • Pydantic • Click • HAP-python

License

MIT License - see LICENSE file for details.

Notice

This software is developed for interoperability purposes only under fair use provisions and EU Software Directive Article 6. See NOTICE.md for full details on intellectual property compliance.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

conson_xp-0.11.16.tar.gz (227.3 kB view details)

Uploaded Source

Built Distribution

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

conson_xp-0.11.16-py3-none-any.whl (186.7 kB view details)

Uploaded Python 3

File details

Details for the file conson_xp-0.11.16.tar.gz.

File metadata

  • Download URL: conson_xp-0.11.16.tar.gz
  • Upload date:
  • Size: 227.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.26.0 CPython/3.13.7 Darwin/24.6.0

File hashes

Hashes for conson_xp-0.11.16.tar.gz
Algorithm Hash digest
SHA256 3e98ababb17c4b64c316efcaec685a5b93bf355afe14623b38e08e7f2edeacef
MD5 bb4e7b53b9a392ff9f10463457a1565a
BLAKE2b-256 90b641f8e2d330693100f44f6e45ddda168f2474af46953e63e737c5c64025f8

See more details on using hashes here.

File details

Details for the file conson_xp-0.11.16-py3-none-any.whl.

File metadata

  • Download URL: conson_xp-0.11.16-py3-none-any.whl
  • Upload date:
  • Size: 186.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.26.0 CPython/3.13.7 Darwin/24.6.0

File hashes

Hashes for conson_xp-0.11.16-py3-none-any.whl
Algorithm Hash digest
SHA256 dba4eadc77442bd4b95b47f71b145640f1a30c05c2542e4356e44f76f5b5d065
MD5 8ca5d71ad26897ff88eff692de63816c
BLAKE2b-256 f1ef760436ce2bb4fdbf59e64a0c60eae2e2fa1cf6f8ea3c1bc9ee28a50bf235

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