Homismart Client (Unofficial Python Library)
⚠️ Disclaimer: This is an unofficial, community-driven library. It is not affiliated with, authorized, or endorsed by Homismart or its parent company. Use at your own risk — changes to Homismart's API may break functionality without notice.
A Python library for interacting with Homismart smart home devices via their WebSocket API. This client was developed by reverse-engineering the protocol used by the official Homismart web application.
Features
- Asynchronous API using
asyncioandwebsockets. - Login and session handling for Homismart accounts.
- Real-time device updates via WebSocket.
- Object-oriented interface for:
- Switchable devices (sockets, lights)
- Curtain/shutter controls
- Door locks
- Hubs
- Custom event system for reacting to device changes, session status, or errors.
- Built-in reconnection and redirection handling.
Installation
pip install homismart-client
Or from source:
git clone https://github.com/krafman/homismart-client.git
cd homismart-client
pip install .
✅ All dependencies (e.g.
websockets,python-dotenv) will be installed automatically.
Quick Start
1. Set your credentials
You can use environment variables or a .env file:
export HOMISMART_USERNAME="your_email@example.com"
export HOMISMART_PASSWORD="your_password"
Or create a .env file:
HOMISMART_USERNAME="your_email@example.com"
HOMISMART_PASSWORD="your_password"
And in your Python script:
from dotenv import load_dotenv
load_dotenv()
2. Connect and control devices
import asyncio
from homismart_client import HomismartClient
async def main():
async with HomismartClient() as client:
await client.login()
devices = client.session.get_all_devices()
for device in devices:
print(f"{device.name} ({device.device_type}): {device.online}")
if device.supports_on_off:
await device.turn_on()
asyncio.run(main())
Event Handling Example
You can register callbacks to respond to device changes:
def on_update(device):
print(f"{device.name} updated: {device}")
client.session.register_event_listener("device_updated", on_update)
Project Status
This project is currently in Alpha. The protocol is still being reverse-engineered and APIs may change between versions.
Requirements
- Python 3.8+
websockets>=10.0,<13.0python-dotenv>=1.0.0
License
MIT © Adir Krafman
Metadata
Release files for homismart-client 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| homismart_client-0.2.1.tar.gz | 38.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| homismart_client-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 80.2 kB
Release files / homismart_client-0.2.1.tar.gz
| Download URL | homismart_client-0.2.1.tar.gz |
|---|---|
| Size | 38.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ccf5c22b14fb97cd54e07cf786f7cedb2b93dd7c1d143bfef4d545b23d9afb26
|
|
BLAKE2b-256 checksum How to use checksums |
5f6d4bca02ea9a2eaea7f3748b933cdc0ff26e64f889aa242d84689111052fd6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 24, 2026.
Transparency logRelease files / homismart_client-0.2.1-py3-none-any.whl
| Download URL | homismart_client-0.2.1-py3-none-any.whl |
|---|---|
| Size | 41.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
40ed6395bc7353418bcb4e0c4a648062ab5072e8998555fc48afc74b065e632e
|
|
BLAKE2b-256 checksum How to use checksums |
aa720eaef05d4a2f33d0c59a90872d767628adf75db7a0f6ca99dea7f520d78d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 24, 2026.
Transparency log