Skip to main content

pyMiWiFi

A python API to the Xiaomi Mi WiFi Router web interface

(Tested on the Mi Router 3C)

Install

PyPI

pip install pymiwifi

License: MIT
Python >= 3.6

Use

import pymiwifi


miwifi = pymiwifi.MiWiFi()
miwifi.login('admin_pass')

miwifi.status()
{'dev': [{'mac': 'xx:xx:xx:xx:xx:xx',
   'maxdownloadspeed': '933178',
   'upload': '28777897',
   'upspeed': '339',
   'downspeed': '194',
   'online': '1320',
   'devname': 'android-xx',
   'maxuploadspeed': '672600',
   'download': '69654908'},
  {'mac': 'xx:xx:xx:xx:xx:xx',
   'maxdownloadspeed': '1239976',
   'upload': '1249682170',
   'upspeed': '431417',
   'downspeed': '8283',
   'online': '5531',
   'devname': 'xx-pc',
   'maxuploadspeed': '744959',
   'download': '42672896'},
  {'mac': 'xx:xx:xx:xx:xx:xx',
   'maxdownloadspeed': '1074270',
   'upload': '1745315',
   'upspeed': '63',
   'downspeed': '84',
   'online': '5392',
   'devname': 'xy-pc',
   'maxuploadspeed': '37234',
   'download': '19197169'},
  {'mac': 'xx:xx:xx:xx:xx:xx',
   'maxdownloadspeed': '0',
   'upload': '0',
   'upspeed': '0',
   'downspeed': '0',
   'online': '5531',
   'devname': '5C:CF:7F:33:BD:41',
   'maxuploadspeed': '0',
   'download': '0'}],
 'code': 0,
 'mem': {'usage': 0.38, 'total': '64 M', 'hz': '800MHz', 'type': 'DDR2'},
 'temperature': 0,
 'count': {'all': 4, 'online': 3},
 'hardware': {'mac': 'xx:xx:xx:xx:xx:xx',
  'platform': 'R3L',
  'version': '2.8.50',
  'channel': 'release',
  'sn': '15516/20172849'},
 'upTime': '5573.27',
 'cpu': {'core': 1, 'hz': '575MHz', 'load': 0.3267},
 'wan': {'downspeed': '9023',
  'maxdownloadspeed': '1264691',
  'history': '460239,437753,431551,444594,443864,444399,437105,425708,444010,443786,443956,443522,437202,425671,444129,448279,443948,437086,429470,440070,444176,444169,444589,436990,424927,443799,446999,447205,431575,430753,467157,444888,444520,443385,432773,429452,443798,444853,445282,436298,425354,444444,444744,444884,442913,429838,434359,444254,444070,445424',
  'devname': 'eth0.2',
  'upload': '1296497767',
  'upspeed': '436401',
  'maxuploadspeed': '751567',
  'download': '136487233'}}

Advanced

If there's an endpoint that's not available in the API, you can just -

miwifi.get_api_endpoint('xqsystem/wifi_macfilter_info')

(Use chrome dev tools' "Network" Tab to see these endpoints)

Metadata

Release files for pymiwifi 0.0.2

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

Source distribution (sdist)

Source distribution for pymiwifi 0.0.2
File Size Uploaded Provenance
pymiwifi-0.0.2.tar.gz 4.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pymiwifi 0.0.2
File Interpreter ABI Platform
pymiwifi-0.0.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 7.7 kB

Release files / pymiwifi-0.0.2.tar.gz

Download URL pymiwifi-0.0.2.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ccfb5fbedfdc3fdb225b6ea689b9b28f897848e99290bce7098dcfecd6ae3e6d
BLAKE2b-256 checksum
How to use checksums
ddac9eabf80bc3e8f6ae64bf21ca719ab53c9b66103814981009434e6f89958c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0

Release files / pymiwifi-0.0.2-py2.py3-none-any.whl

Download URL pymiwifi-0.0.2-py2.py3-none-any.whl
Size 3.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
41c52bd49be7f1eea58a3af734ace62c29afe76310bf7698abe09dfa9d1912c9
BLAKE2b-256 checksum
How to use checksums
6f5e54c25cc66f1ae4be97e4072ddff8053b5533ad4c7b3ddedb2cfc1472310d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0

Security for pymiwifi 0.0.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

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