Skip to main content

The APIs in this library (and tool) should not be considered stable!

To install:

$ pip install mficlient

To get started, set your connection information like this:

$ export MFI="https://user:password@192.168.1.123:6443"

Then you can run the client, doing something like:

$ mfi dump_sensors
               Model |                Label |        Tag  |      Value | Extra
-------------------------------------------------------------------------------
          Output 12v |        Relay Control |     output  |          0 | 0.0
          Output 24v |                Relay |     output  |          0 | 0.0
    Ubiquiti mFi-THS |                 Temp | temperature |       14.3 | None
       Input Digital |          Garage Door |      input  |          1 | None
              Outlet |       Heater Control | active_pwr  |   5.810242 | 1.0
     Ubiquiti mFi-CS |              Furnace |       amps  |     1.0539 | None
     Ubiquiti mFi-CS |         Water Heater |       amps  |        0.0 | None

$ mfi control_device --device 'Heater Control' --state on

Client API example:

>>> c = mficlient.MFiClient('192.168.1.123', 'admin', 'password')
>>> p = c.get_port(label='Water Heater Control')
>>> p.model
'Outlet'
>>> p.value
5.746462
>>> p.tag
'active_pwr'
>>> p.data
{'rpt_time': 1456258144771, 'mac': 'redacted', 'locked': False, 'label': 'Water Heater Control', 'wattHours': 8001.875, 'y': 222.18320610687024, 'map_id': 'redacted', 'output': 1.0, 'fovrotation': 0, 'active_pwr': 5.746462, 'pf': 0.678653, 'reported_val': 1.0, '_id': 'redacted', 'i_rms': 0.069931, 'fovradius': 10, 'v_rms': 121.082737, 'val_time': 1456258144000, 'port': '1', 'energy_sum': 8001.875, 'wattHoursBase': 0.0, 'tag': 'active_pwr', 'val': 5.746462, 'wh_rpt_time': 1456258144761, 'model': 'Outlet', 'x': 564.8839694656489, 'fovangle': 1.5707963267948966, 'output_val': 1.0}
 >>> p.control(False)

Release files for mficlient 0.5.0

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

Source distribution (sdist)

Source distribution for mficlient 0.5.0
File Size Uploaded
mficlient-0.5.0.tar.gz 11.4 kB Details

Built distribution (wheel)

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

Total release size: 22.5 kB

Release files / mficlient-0.5.0.tar.gz

Download URL mficlient-0.5.0.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a8432a57bb2c4e71c10071cf79da409b0b5006816291e39f26d8909fe2e680af
BLAKE2b-256 checksum
How to use checksums
8abc952163638c7cdfb0fa880f6a93d6d1cf7386c6657fb6112c91f63337043b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / mficlient-0.5.0-py3-none-any.whl

Download URL mficlient-0.5.0-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
01acda5f02cf56be61f66b696d7cb999948da5b5fd04af2a33fba1ee68b51826
BLAKE2b-256 checksum
How to use checksums
820758a1ba3c5aa30aefb3b0467921f9d48f107b7c2acf7cde348eb8d42542e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.1

2 release files

0.3.0

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2

1 release file

0.1

1 release file

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