Skip to main content

A Python library to monitor EG4 Solar Inverters via the EG4 Monitor website.

Project description

EG4 Control Library (eg4-ctrl)

A Python library for monitoring EG4 Solar Inverters via the EG4 Monitor website (monitor.eg4electronics.com). This library is specifically useful for remote monitoring of EG4 6000XP inverters and similar models that report to the EG4 web portal.

Features

  • Synchronous and Asynchronous Clients: Supports both requests and httpx for flexible integration.
  • Pydantic Models: Strongly typed data models for system status and individual battery details.
  • Session Persistence: Saves session cookies to minimize login requests and avoid account lockout.
  • Unit Conversion: Convenient properties for converting raw API values to standard units (Volts, Amps, Watts).

Installation

pip install eg4-ctrl

Quick Start

Synchronous Client

from eg4_monitor import EG4Client

client = EG4Client(
    username="your_username",
    password="your_password",
    serial_num="your_inverter_serial",
    session_file="session.json"
)

data = client.get_inverter_data()
print(f"Status: {data.status_text}")
print(f"Solar Power: {data.ppv}W")
print(f"Battery SoC: {data.soc}%")

Asynchronous Client

import asyncio
from eg4_monitor import AsyncEG4Client

async def main():
    async with AsyncEG4Client(
        username="your_username",
        password="your_password",
        serial_num="your_inverter_serial",
        session_file="session.json"
    ) as client:
        data = await client.get_inverter_data()
        print(f"Battery Voltage: {data.v_bat_v}V")

asyncio.run(main())

Data Models

The library uses Pydantic to parse API responses into structured objects.

InverterData

  • status_text: "normal", "warning", etc.
  • ppv: Solar production (Watts).
  • p_charge: Battery charging power (Watts).
  • p_discharge: Battery discharging power (Watts).
  • soc: System State of Charge (%).
  • v_bat_v: Battery voltage (Volts).
  • battery_array: List of BatteryInfo objects.

BatteryInfo

  • battery_sn: Battery serial number.
  • soc: Battery State of Charge (%).
  • total_voltage_v: Battery voltage (Volts).
  • current_a: Battery current (Amps).
  • cycle_cnt: Number of charge cycles.

License

MIT

Project details


Download files

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

Source Distribution

eg4_ctrl-0.1.3.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

eg4_ctrl-0.1.3-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file eg4_ctrl-0.1.3.tar.gz.

File metadata

  • Download URL: eg4_ctrl-0.1.3.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for eg4_ctrl-0.1.3.tar.gz
Algorithm Hash digest
SHA256 db8a31bf68b93170b9f45e367867aae132dd1a2c8ba5b98b3e75c8324f83bafc
MD5 04c3134a0f6105bcaaf37efa60b7d3ae
BLAKE2b-256 b6b246275deb2011b6276c8534599c9b683514bfd355722b158c811e75a9473a

See more details on using hashes here.

File details

Details for the file eg4_ctrl-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: eg4_ctrl-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for eg4_ctrl-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 72202713be9ee16600050ba7deb0c4ea776d75eb3abde2e10d45af381952b611
MD5 211b8b4b5cb131b1e6aa874f336a9f16
BLAKE2b-256 76b3a387168450f8fd7b13a4c588f066db8f417708552951b7a640e56fba3641

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page