Skip to main content

mordomus

Python client for the Mordomus / iThink home-automation HTTP API.

pip install mordomus
from mordomus import Mordomus

with Mordomus("http://192.168.8.46:8888", user="user", password="1234") as home:
    for light in home.devices.lights():
        print(light.cod, light.name, light.value)

    home.devices.on("MDO17")
    home.devices.set_value("MDO17", 100)
    home.climate.set_temperature(room=2, celsius=22)

Async:

import asyncio
from mordomus import AsyncMordomus

async def main():
    async with AsyncMordomus("http://192.168.8.46:8888", user="user", password="1234") as home:
        states = await home.devices.states()
        print(states)

asyncio.run(main())

Auth

Login is session-cookie based (IDHTTPSESSIONID). Credentials are hashed as:

value  = md5(timestamp_ms + username.lower()) + md5(timestamp_ms + password)
value1 = str(3 * timestamp_ms)
GET /logas?value=...&value1=...

The client handles this automatically and re-authenticates on 401.

API surface

Resource Methods
home.system version(), session_ok(), logout()
home.devices list(), states(), get(), on(), off(), toggle(), set_value(), set_rgb(), by_room(), lights(), blinds(), …
home.climate list(), set_temperature(), set_mode(), set_duration()
home.alarms list(), states()
home.quickmenu list(), run()
home.multimedia devices(), state(room), control()
home.settings get(), set()

Home Assistant

Separate package: mordomus-homeassistant

pip install mordomus-homeassistant
mordomus-ha install /config          # or: mordomus-ha install ~/.homeassistant
# restart Home Assistant → Add integration → Mordomus

See home-assistant/README.md.

Development

uv sync
uv run pytest

Publish to PyPI

Two packages, two versions (keep them in sync for paired releases):

Package Path PyPI name
Library repo root mordomus
HA integration home-assistant/ mordomus-homeassistant
# 1. Bump version in pyproject.toml (+ home-assistant/pyproject.toml + manifest.json)
# 2. Build + upload (API token required)
export UV_PUBLISH_TOKEN=pypi-...
./scripts/publish.sh both            # production PyPI
./scripts/publish.sh both --test     # TestPyPI first
./scripts/publish.sh lib --dry-run   # build only

Or publish from GitHub Actions on release (trusted publishing) — see .github/workflows/publish.yml.

Metadata

Release files for mordomus 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mordomus 0.1.1
File Size Uploaded
mordomus-0.1.1.tar.gz 14.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mordomus 0.1.1
File Interpreter ABI Platform
mordomus-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 28.9 kB

Release files / mordomus-0.1.1.tar.gz

Download URL mordomus-0.1.1.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8582c87a93a2f97275980ed7fa77261151dfdd28651418b8514ab222620da6d8
BLAKE2b-256 checksum
How to use checksums
ecca71712bc417eed5a4ea6bf390cee8fea6ed2de7a3368d2331ad06d79732cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mordomus-0.1.1-py3-none-any.whl

Download URL mordomus-0.1.1-py3-none-any.whl
Size 14.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
75953d197c0a1649a13b0a08b72858520c838e0391c17903222fa4f4f4d5b0c3
BLAKE2b-256 checksum
How to use checksums
adacde50cfac96d37ce3e2638d9ae72a6d692ea31b336bff31b4c833b7ed2399
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page