Skip to main content

IOmeter Python Client

A Python client for interacting with IOmeter devices over HTTP. This client provides an async interface for reading energy consumption/production data and monitoring device status.

Features

  • 🔌 Asynchronous communication with IOmeter bridge over HTTP
  • 📊 Read energy consumption and energy production data
  • 🔋 Monitor device status including battery level and signal strength
  • 🔄 Two transport modes: polling (IOmeterClient) and Server-Sent Events (IOmeterSSEClient)

Quick Start

Installation

pip install iometer

Polling

Use IOmeterClient to fetch readings on demand:

from iometer import IOmeterClient

async def check_meter_reading():
    async with IOmeterClient("192.168.1.100") as client:
        reading = await client.get_current_reading()
        print(f"Consumption: {reading.get_total_consumption()} Wh")
        print(f"Production: {reading.get_total_production()} Wh")
        print(f"Current Power: {reading.get_current_power()} W")

Server-Sent Events (SSE)

Use IOmeterSSEClient to receive readings as they arrive (push-based):

from iometer import IOmeterSSEClient
from aiohttp import ClientSession

async def stream_readings():
    async with ClientSession() as session:
        client = IOmeterSSEClient("192.168.1.100", session=session)
        async for reading in client.watch_readings():
            print(f"Consumption: {reading.get_total_consumption()} Wh")
            print(f"Current Power: {reading.get_current_power()} W")

Device Status Information

from iometer import IOmeterClient

async def check_device_status():
    async with IOmeterClient("192.168.1.100") as client:
        # Get current status
        status = await client.get_current_status()
        
        # Bridge information
        print(f"Bridge Version: {status.device.bridge.version}")
        print(f"Bridge Signal: {status.device.bridge.rssi} dBm")
        
        # Core information
        core = status.device.core
        print(f"Connection: {core.connection_status}")
        print(f"Power Mode: {core.power_status}")
        
        if core.power_status.value == "battery":
            print(f"Battery Level: {core.battery_level}%")

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Setting up a dev environment

We use Poetry for dependency management and testing. Install everything with:

poetry install

To run the Python tests use:

poetry run pytest tests/test.py

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for iometer 1.0.3

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

Source distribution (sdist)

Source distribution for iometer 1.0.3
File Size Uploaded Provenance Actions
iometer-1.0.3.tar.gz 6.8 kB Without provenance Details for iometer-1.0.3.tar.gz

Built distribution (wheel)

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

Total release size: 15.5 kB

Release files / iometer-1.0.3.tar.gz

Download URL iometer-1.0.3.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9b59d4b7cd06f8e3eea101290d5177e4bb043719731d162b66b1f68faea36d92
BLAKE2b-256 checksum
How to use checksums
9324fce360533cbade11652d1f0008e4b036c2470a514ef5730034b5ab43eef8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.14.4 Linux/7.0.0-1019-azure

Release files / iometer-1.0.3-py3-none-any.whl

Download URL iometer-1.0.3-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
11d8378e7bfeb3139f4da5744999f641408d5e3ae826eb6173267bb88696192a
BLAKE2b-256 checksum
How to use checksums
221ab42a682dab8f287a1a665a38d38ccf74167670167a889824b22ea080d564
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.14.4 Linux/7.0.0-1019-azure

Security for iometer 1.0.3

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.

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