Skip to main content

Python 3 package to interface with Osborne Hoffman panels.

Project description

osbornehoffman

Python 3 package to interface with Osborne-Hoffman (OH+CID, OH+SIA or OH+XSIA) compatible panels:

  • CSX75 Panel Range (CS7050(N) TCP/IP gateway)
  • CSX75 Panel Range (CS9104/9204 Video Verification Module)
  • CSX75 Panel Range (CS7002(N) GSM/GPRS module)
  • ATS MASTER Panel range (ATS2xxx, ATS3xxx, ATS4xxx with ATS1806 or ATS1809)
  • ATS Advanced (with TDA74xx GRPS/IP modules or ATS7310 GSM/GPRS module)
  • ATS Advanced IP (ATSx000A-IP, ATSx500A-IP)
  • NetworX Panel Range (NX-590(N)E TCP/IP gateway)
  • NetworX Panel Range (NX-9104/9204 Video Verification Module)
  • NetworX Panel Range (NX-7002(N) GSM/GPRS module)
  • Simon Panel Range (60-938)

Protocol Support

  • V1-V3: 3DES/ECB encryption with XOR-scrambled key handshake
  • V4: AES-256/CBC encryption with Diffie-Hellman key exchange and IV mixing

The Osborne-Hoffman protocol is a TCP overlay protocol where the server sends a scrambled 192-bit 3DES key to the panel. V4 extends this with a Diffie-Hellman negotiation for AES-256 key derivation.

Installation

pip install osbornehoffman

Requires Python >= 3.10 and pycryptodome.

Usage

Using OHClient (recommended)

import asyncio
from osbornehoffman import OHClient, OHAccount, OHEvent

async def main():
    async def on_event(event: OHEvent) -> None:
        print(f"Event: code={event.code}, account={event.effective_account}")

    accounts = [OHAccount("001234")]
    async with OHClient("0.0.0.0", 8996, accounts, on_event) as client:
        await asyncio.Event().wait()  # run forever

asyncio.run(main())

Using OHServer directly

import asyncio
from osbornehoffman import OHServer, OHAccount

async def main():
    async def process_event_cb(event: dict) -> bool:
        print("Processing event")
        return True

    accounts = {"001234": OHAccount("001234")}
    server = OHServer("0.0.0.0", 8996, accounts, process_event_cb)
    await server.start_server()
    async with server.server:
        await server.server.serve_forever()

asyncio.run(main())

Key Classes

  • OHClient - High-level async client with lifecycle management (start/stop, context manager)
  • OHServer - Low-level TCP server handling protocol framing and encryption
  • OHAccount - Account configuration (account_id, panel_id, forward_heartbeat)
  • OHEvent - Parsed event dataclass with code, ri, effective_account properties
  • OHKeyStore - JSON-based persistence for V4 AES keys
  • MessageType - Enum for event types (SIA, CID, HB_V1, HB_V2, DHR, V4)

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

osbornehoffman-2.1.0.tar.gz (34.7 kB view details)

Uploaded Source

Built Distribution

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

osbornehoffman-2.1.0-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

File details

Details for the file osbornehoffman-2.1.0.tar.gz.

File metadata

  • Download URL: osbornehoffman-2.1.0.tar.gz
  • Upload date:
  • Size: 34.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for osbornehoffman-2.1.0.tar.gz
Algorithm Hash digest
SHA256 5ff446135b0c091c657b659f3895f0b9215cd7835b12ab6912e254704a2c9237
MD5 7790ab126706bab11e11835ec39f13d2
BLAKE2b-256 bf3448f9e6ff84ea416d873b12744b92390bc3dfd22f7daeca5cdf9e1c9bd059

See more details on using hashes here.

File details

Details for the file osbornehoffman-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: osbornehoffman-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 28.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for osbornehoffman-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4375ce9c11e82eda89169f7878210bfd09b8dd59c8ef0021240a9e979dd07d8c
MD5 639aafded78ac8a2a9dd1d37c468d638
BLAKE2b-256 73ba049c641ee7b6d8d580007befa16abd1075eb52fba895044cc939f903924f

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