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.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| iometer-1.0.2.tar.gz | 6.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| iometer-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.4 kB
Release files / iometer-1.0.2.tar.gz
| Download URL | iometer-1.0.2.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1a8dc2dcd9a8f6f5404d999d58cf463c6d0f6dfa871e107d7d47a5dfc5200fdf
|
|
BLAKE2b-256 checksum How to use checksums |
336d5996fe98aa16bc947ecfa26eab6750859d93c819ba4a93bcb8541662824f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.12.3 Linux/6.17.0-1018-azure
|
Release files / iometer-1.0.2-py3-none-any.whl
| Download URL | iometer-1.0.2-py3-none-any.whl |
|---|---|
| Size | 8.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b054b9c7699a6a516e78cfd3a43859fc9246c9176e0a76b48e7470dd73c1a254
|
|
BLAKE2b-256 checksum How to use checksums |
fcd547420dd97949d62d077ece9f97923c0b6753c1062d248980ceb582ee4db6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.12.3 Linux/6.17.0-1018-azure
|