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
- Home Assistant Integration - Use this library with Home Assistant
Protocol Documentation
For detailed protocol documentation, see:
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6391634cef6a845f095b6ec568f261bf26fe23648dd24f8e82c4818f97c9a50c
|
|
| MD5 |
ab81842d97e7e0f33912392ecb9e94b1
|
|
| BLAKE2b-256 |
103d5b7235a56dcda073cba501e2c919e1483b73838522677b368c87e7f127ff
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
napco_ibridge-1.0.0.tar.gz -
Subject digest:
6391634cef6a845f095b6ec568f261bf26fe23648dd24f8e82c4818f97c9a50c - Sigstore transparency entry: 709082868
- Sigstore integration time:
-
Permalink:
tikotzky/napco-ibridge-python@b440cd288d33e9a1bcff4f5433b71b350bbc661b -
Branch / Tag:
refs/heads/master - Owner: https://github.com/tikotzky
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@b440cd288d33e9a1bcff4f5433b71b350bbc661b -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96f2ecf867ccc1f8d85ac40bed8374f49400fa17e804c26f89e70aeb09e310fa
|
|
| MD5 |
6b2322828f3181f26877c4d05e6f2860
|
|
| BLAKE2b-256 |
cb90a0df2150d9154af4fe2d47ac5545be9a191b065fb9154d608bb03e5cad2e
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
napco_ibridge-1.0.0-py3-none-any.whl -
Subject digest:
96f2ecf867ccc1f8d85ac40bed8374f49400fa17e804c26f89e70aeb09e310fa - Sigstore transparency entry: 709082873
- Sigstore integration time:
-
Permalink:
tikotzky/napco-ibridge-python@b440cd288d33e9a1bcff4f5433b71b350bbc661b -
Branch / Tag:
refs/heads/master - Owner: https://github.com/tikotzky
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@b440cd288d33e9a1bcff4f5433b71b350bbc661b -
Trigger Event:
workflow_dispatch
-
Statement type: