Olarm is a smart security company that transforms existing alarm systems into connected, app-controlled security solutions. Their products work with major alarm panels (Paradox, DSC, Texecom, IDS, Honeywell and more) to provide remote control, real-time alerts, and comprehensive security management from anywhere.
This is the official asynchronous Python client for interacting with the Olarm Public API. For more information about our Olarm Public API, please see our official API documentation on our platform.
- Fetch your devices information and state
- Send commands to devices (arm, disarm, stay, sleep, bypass zones, control PGM etc..).
- Subscribe to real-time state changes and events using MQTT
- Sign up at https://login.olarm.com
- Go to API section, generate token
pip install olarmflowclient- Copy this code:
import asyncio
from olarmflowclient import OlarmFlowClient
async def main():
async with OlarmFlowClient("your-token-here") as client:
devices = await client.get_devices()
print(f"You have {len(devices['data'])} devices")
# For non-async code:
import asyncio
result = asyncio.run(main())
Please check the examples for more uses!
The repository includes example scripts that demonstrate how to use the library:
# Run the fetch devices example
python examples/fetch_devices.py --api-token YOUR_API_TOKEN
# Run the fetch devices example
python examples/fetch_device.py --api-token YOUR_API_TOKEN --device-id DEVICE_ID
# Run the MQTT events listener example
python examples/subscribe_device_mqtt.py --api-token YOUR_API_TOKEN --user-id YOUR_USER_IDNOTE: you can find your User ID in the Olarm user portal
This library provides asynchronous access using aiohttp for API calls and paho-mqtt for real-time event handling via MQTT.
- Clone the repository.
- Setup venv if necessary
python3 -m venv venv source venv/bin/activate # other shells might be different
- Install dependencies:
pip3 install -r requirements.txt
- Format code and check for linting errors using Ruff:
# Check for issues python3 -m ruff check . # Fix issues and format code python3 -m ruff check . --fix python3 -m ruff format .
The project uses pytest and pytest-asyncio for testing. To run the tests:
-
Make sure you have the testing dependencies installed:
pip install -r requirements.txt
-
Run the tests with pytest:
python -m pytest
Please log issues and feature requests in Github issues 👆
Contributions are welcome! Please open an issue or submit a pull request.