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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mordomus-0.1.0.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mordomus-0.1.0-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file mordomus-0.1.0.tar.gz.

File metadata

  • Download URL: mordomus-0.1.0.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for mordomus-0.1.0.tar.gz
Algorithm Hash digest
SHA256 94a0ab046e86d4f7b786a435502c4386ac503eaa5e1efa6b8ebcd4d2429781d3
MD5 8b5f51dc6d403f2b0560bb91725f379c
BLAKE2b-256 b85aa3c743efc4eed5b8f2cdc1c78b79bcfd5399feaf7b86a1e21fdf03cfdd05

See more details on using hashes here.

File details

Details for the file mordomus-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mordomus-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for mordomus-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5553b9715d2f7bd4159a1e3d237666a4ef173ed9e091ba843a50351441437a6a
MD5 806fa125febd129da7813abd9b04416d
BLAKE2b-256 c59499ededd58f5d6568233e1ea4d283cdb678d88554e6ef93f292f0253a9cec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page