Skip to main content

Python library for Napco iBridge security panel communication

Project description

Napco iBridge Python Library

A Python library for communicating with Napco security panels via the iBridge protocol.

Features

  • Async/await support - Built on Python's asyncio
  • Auto-reconnection - Automatic reconnection with exponential backoff
  • Connection state management - Track connection status
  • Full protocol support - All Napco iBridge keypad buttons and status updates
  • Type hints - Full type annotation support
  • Robust error handling - Comprehensive exception handling

Installation

pip install napco-ibridge

Quick Start

import asyncio
from napco_ibridge import IBridgeClient, BUTTONS

async def main():
    # Create client
    client = IBridgeClient(
        panel_address="192.168.1.100",
        status_interval=1.0,
        auto_reconnect=True
    )

    # Define status callback
    def on_status_update(status):
        print(f"Arm Status: {status['arm_status']}")
        print(f"Text: {status['raw_data'].get('text_line1', '')}")

    # Connect to panel
    await client.connect(on_update=on_status_update)

    # Send buttons (e.g., arm in STAY mode)
    await client.send_buttons([BUTTONS.BUTTON_INTERIOR_STAY_LONG])

    # Keep running
    await asyncio.sleep(3600)

    # Disconnect
    await client.disconnect()

if __name__ == "__main__":
    asyncio.run(main())

Panel Discovery

from napco_ibridge import discover_panel

# Discover panel on local network
panel_ip = await discover_panel(timeout=5.0)
print(f"Found panel at: {panel_ip}")

Arm/Disarm Examples

Arm STAY Mode

await client.send_buttons([BUTTONS.BUTTON_INTERIOR_STAY_LONG])

Arm AWAY Mode

# Enter code + ENTER
await client.send_buttons([
    BUTTONS.BUTTON_1,
    BUTTONS.BUTTON_2,
    BUTTONS.BUTTON_3,
    BUTTONS.BUTTON_4,
    BUTTONS.BUTTON_ON_OFF_ENTER
])

Disarm

# Enter code + ENTER
await client.send_buttons([
    BUTTONS.BUTTON_1,
    BUTTONS.BUTTON_2,
    BUTTONS.BUTTON_3,
    BUTTONS.BUTTON_4,
    BUTTONS.BUTTON_ON_OFF_ENTER
])

Connection State Management

from napco_ibridge import ConnectionState

def on_connection_state(new_state, old_state):
    print(f"Connection: {old_state.name} -> {new_state.name}")

    if new_state == ConnectionState.CONNECTED:
        print("Connected to panel!")
    elif new_state == ConnectionState.FAILED:
        print("Connection failed!")

await client.connect(
    on_update=on_status_update,
    on_connection_state=on_connection_state
)

Available Button Codes

All button codes are available in the BUTTONS enum:

from napco_ibridge import BUTTONS

# Number buttons
BUTTONS.BUTTON_0 through BUTTONS.BUTTON_9

# Special buttons
BUTTONS.BUTTON_STAR
BUTTONS.BUTTON_ON_OFF_ENTER
BUTTONS.BUTTON_INTERIOR_STAY
BUTTONS.BUTTON_INTERIOR_STAY_LONG
BUTTONS.BUTTON_INSTANT_AWAY
BUTTONS.BUTTON_INSTANT_AWAY_LONG
BUTTONS.BUTTON_BYPASS
BUTTONS.BUTTON_RESET
BUTTONS.BUTTON_NEXT
BUTTONS.BUTTON_PREV
BUTTONS.BUTTON_F
BUTTONS.BUTTON_A
BUTTONS.BUTTON_P

# And many more...

Status Updates

Status updates include:

{
    'arm_status': 'DISARMED',  # or ARMED_AWAY, ARMED_STAY, ARMED_NIGHT, etc.
    'raw_data': {
        'text_line1': 'SYSTEM READY    ',
        'text_line2': 'ENTER CODE      ',
        'armed_led': 'Off',
        'status_led': 'On',
        'trouble_led': 'Off',
        'fire_led': 'Off',
        'bypass_led': 'Off',
        # ... and more
    }
}

Advanced Configuration

client = IBridgeClient(
    panel_address="192.168.1.100",
    status_interval=1.0,           # Status polling interval (seconds)
    auto_reconnect=True,            # Enable auto-reconnection
    max_reconnect_attempts=0,       # 0 = unlimited retries
    reconnect_interval=1.0,         # Initial reconnect delay (seconds)
    max_reconnect_interval=60.0     # Max reconnect delay (seconds)
)

Requirements

  • Python 3.9 or higher
  • No external dependencies (uses standard library only)

Supported Panels

This library works with Napco security panels that support the iBridge protocol, including:

  • GEM-K1 keypads
  • Other Napco panels with iBridge support

License

MIT License - see LICENSE file for details

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

For issues, questions, or contributions, please visit: https://github.com/tikotzky/node-napco-ibridge/issues

Related Projects

Protocol Documentation

For detailed protocol documentation, see:

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

napco_ibridge-1.0.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

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

napco_ibridge-1.0.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file napco_ibridge-1.0.0.tar.gz.

File metadata

  • Download URL: napco_ibridge-1.0.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for napco_ibridge-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6391634cef6a845f095b6ec568f261bf26fe23648dd24f8e82c4818f97c9a50c
MD5 ab81842d97e7e0f33912392ecb9e94b1
BLAKE2b-256 103d5b7235a56dcda073cba501e2c919e1483b73838522677b368c87e7f127ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for napco_ibridge-1.0.0.tar.gz:

Publisher: publish-to-pypi.yml on tikotzky/napco-ibridge-python

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

File details

Details for the file napco_ibridge-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: napco_ibridge-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for napco_ibridge-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 96f2ecf867ccc1f8d85ac40bed8374f49400fa17e804c26f89e70aeb09e310fa
MD5 6b2322828f3181f26877c4d05e6f2860
BLAKE2b-256 cb90a0df2150d9154af4fe2d47ac5545be9a191b065fb9154d608bb03e5cad2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for napco_ibridge-1.0.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on tikotzky/napco-ibridge-python

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