Skip to main content
Library to use the Xiaomi Mi Home zigbee hub (receive paquets, events for now).


Example of usage as a simple mqtt relay:

```python
import paho.mqtt.client as mqtt

MQTT_SERVER = "192.168.0.149"
MQTT_PORT = 1883

PATH_FMT = "xiaomi/{model}/{sid}/{prop}" # short_id or sid ?

def prepare_mqtt():
client = mqtt.Client()
client.connect(MQTT_SERVER, MQTT_PORT, 60)

return client

def push_data(client, model, sid, cmd, data):
for key, value in data.items():
path = PATH_FMT.format(model=model,
sid=sid,
cmd=cmd,
prop=key)
client.publish(path, payload=value, qos=0)

client = prepare_mqtt()
cb = lambda m, s, c, d: push_data(client, m, s, c, d)
connector = XiaomiConnector(data_callback=cb)

while True:
connector.check_incoming()
```

For more information on the protocol and devices, see my notes: https://notes.jmsinfor.com/blog/post/admin/Xiaomi-Hub


Download files

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

Source Distribution

mihome-0.1.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

mihome-0.1-py2.py3-none-any.whl (4.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file mihome-0.1.tar.gz.

File metadata

  • Download URL: mihome-0.1.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mihome-0.1.tar.gz
Algorithm Hash digest
SHA256 50670265810ad01646accb14fd4112fdb608dcfdca788785118b8bdaea77c089
MD5 d85600dad0ad5be1d76c197bb9e5e82e
BLAKE2b-256 edef9bf726d70d5f23556c44341df7f33984c8653a410faa82cebcc0e95abb54

See more details on using hashes here.

File details

Details for the file mihome-0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for mihome-0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d79f3766c198bcda625aff0e8af9028953c92b6afa65d1e1ced71cf9dfe6fba1
MD5 41defbcee6756bc04eaae3289f304843
BLAKE2b-256 2e00103ea6654526e2f62b9d9f07c4f83ee94dc333855a7c5fdf5ea554ef51fc

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1 This release

2 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