homismart-client


Namehomismart-client JSON
Version 0.1.5 PyPI version JSON
download
home_pagehttps://github.com/krafman/homismart-client
SummaryPython client for Homismart WebSocket API
upload_time2025-07-26 13:56:52
maintainerNone
docs_urlNone
authorAdir Krafman
requires_python>=3.8
licenseMIT
keywords homismart smart home websocket iot home automation
VCS
bugtrack_url
requirements python-dotenv websockets
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Homismart Client (Unofficial Python Library)

![PyPI - Version](https://img.shields.io/pypi/v/homismart-client)
![Python Versions](https://img.shields.io/pypi/pyversions/homismart-client)
![License](https://img.shields.io/pypi/l/homismart-client)
![GitHub stars](https://img.shields.io/github/stars/krafman/homismart-client?style=social)
![GitHub last commit](https://img.shields.io/github/last-commit/krafman/homismart-client)

> ⚠️ **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 `asyncio` and `websockets`.
- 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

```bash
pip install homismart-client
```

Or from source:

```bash
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:

```bash
export HOMISMART_USERNAME="your_email@example.com"
export HOMISMART_PASSWORD="your_password"
```

Or create a `.env` file:

```env
HOMISMART_USERNAME="your_email@example.com"
HOMISMART_PASSWORD="your_password"
```

And in your Python script:

```python
from dotenv import load_dotenv
load_dotenv()
```

### 2. Connect and control devices

```python
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:

```python
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.0`
- `python-dotenv>=1.0.0`

## License
[![forthebadge](https://forthebadge.com/images/badges/license-mit.svg)](https://forthebadge.com)

MIT © Adir Krafman

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/krafman/homismart-client",
    "name": "homismart-client",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "homismart, smart home, websocket, iot, home automation",
    "author": "Adir Krafman",
    "author_email": "adirkrafman@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/97/9d/b55fc314eb78b479d1e412584630467a85f6a995d9001a494805d1888e64/homismart_client-0.1.5.tar.gz",
    "platform": null,
    "description": "# Homismart Client (Unofficial Python Library)\n\n![PyPI - Version](https://img.shields.io/pypi/v/homismart-client)\n![Python Versions](https://img.shields.io/pypi/pyversions/homismart-client)\n![License](https://img.shields.io/pypi/l/homismart-client)\n![GitHub stars](https://img.shields.io/github/stars/krafman/homismart-client?style=social)\n![GitHub last commit](https://img.shields.io/github/last-commit/krafman/homismart-client)\n\n> \u26a0\ufe0f **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 \u2014 changes to Homismart's API may break functionality without notice.\n\nA 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.\n\n## Features\n\n- Asynchronous API using `asyncio` and `websockets`.\n- Login and session handling for Homismart accounts.\n- Real-time device updates via WebSocket.\n- Object-oriented interface for:\n  - Switchable devices (sockets, lights)\n  - Curtain/shutter controls\n  - Door locks\n  - Hubs\n- Custom event system for reacting to device changes, session status, or errors.\n- Built-in reconnection and redirection handling.\n\n## Installation\n\n```bash\npip install homismart-client\n```\n\nOr from source:\n\n```bash\ngit clone https://github.com/krafman/homismart-client.git\ncd homismart-client\npip install .\n```\n\n> \u2705 All dependencies (e.g. `websockets`, `python-dotenv`) will be installed automatically.\n\n## Quick Start\n\n### 1. Set your credentials\n\nYou can use environment variables or a `.env` file:\n\n```bash\nexport HOMISMART_USERNAME=\"your_email@example.com\"\nexport HOMISMART_PASSWORD=\"your_password\"\n```\n\nOr create a `.env` file:\n\n```env\nHOMISMART_USERNAME=\"your_email@example.com\"\nHOMISMART_PASSWORD=\"your_password\"\n```\n\nAnd in your Python script:\n\n```python\nfrom dotenv import load_dotenv\nload_dotenv()\n```\n\n### 2. Connect and control devices\n\n```python\nimport asyncio\nfrom homismart_client import HomismartClient\n\nasync def main():\n    async with HomismartClient() as client:\n        await client.login()\n        devices = client.session.get_all_devices()\n        for device in devices:\n            print(f\"{device.name} ({device.device_type}): {device.online}\")\n            if device.supports_on_off:\n                await device.turn_on()\n\nasyncio.run(main())\n```\n\n## Event Handling Example\n\nYou can register callbacks to respond to device changes:\n\n```python\ndef on_update(device):\n    print(f\"{device.name} updated: {device}\")\n\nclient.session.register_event_listener(\"device_updated\", on_update)\n```\n\n## Project Status\n\nThis project is currently in **Alpha**. The protocol is still being reverse-engineered and APIs may change between versions.\n\n## Requirements\n\n- Python 3.8+\n- `websockets>=10.0,<13.0`\n- `python-dotenv>=1.0.0`\n\n## License\n[![forthebadge](https://forthebadge.com/images/badges/license-mit.svg)](https://forthebadge.com)\n\nMIT \u00a9 Adir Krafman\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python client for Homismart WebSocket API",
    "version": "0.1.5",
    "project_urls": {
        "Bug Tracker": "https://github.com/krafman/homismart-client/issues",
        "Homepage": "https://github.com/krafman/homismart-client"
    },
    "split_keywords": [
        "homismart",
        " smart home",
        " websocket",
        " iot",
        " home automation"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ceadea94eb8c4d18438505111114dbcb9999bf576f045b4fbeb22e9cbb8e39dd",
                "md5": "6171a7d580cb93c23a0701a81155324d",
                "sha256": "9301ad6a10db86bf7a80a057dfcf9fef37df67c35cc0ebced853f2bdcf2b7ff8"
            },
            "downloads": -1,
            "filename": "homismart_client-0.1.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6171a7d580cb93c23a0701a81155324d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 41439,
            "upload_time": "2025-07-26T13:56:51",
            "upload_time_iso_8601": "2025-07-26T13:56:51.603495Z",
            "url": "https://files.pythonhosted.org/packages/ce/ad/ea94eb8c4d18438505111114dbcb9999bf576f045b4fbeb22e9cbb8e39dd/homismart_client-0.1.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "979db55fc314eb78b479d1e412584630467a85f6a995d9001a494805d1888e64",
                "md5": "c8311b9470b5c7a5122abf3215ca5e39",
                "sha256": "fd1940d356324071e2b2e07185353a57316a284273f2e0a5f75b234ab3408acd"
            },
            "downloads": -1,
            "filename": "homismart_client-0.1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "c8311b9470b5c7a5122abf3215ca5e39",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 35825,
            "upload_time": "2025-07-26T13:56:52",
            "upload_time_iso_8601": "2025-07-26T13:56:52.782912Z",
            "url": "https://files.pythonhosted.org/packages/97/9d/b55fc314eb78b479d1e412584630467a85f6a995d9001a494805d1888e64/homismart_client-0.1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-26 13:56:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "krafman",
    "github_project": "homismart-client",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "python-dotenv",
            "specs": [
                [
                    ">=",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "websockets",
            "specs": [
                [
                    "<",
                    "13.0"
                ],
                [
                    ">=",
                    "10.0"
                ]
            ]
        }
    ],
    "lcname": "homismart-client"
}
        
Elapsed time: 0.87961s