Skip to main content

openems-client

Async Python client for OpenEMS and FENECON FEMS energy management systems.

It talks to an OpenEMS edge, an OpenEMS backend or the FENECON portal over the JSON-RPC websocket API, reads the edge configuration (components and channels), and keeps a live object model of the edge that is updated by currentData push messages. Writing component properties uses JSON-RPC or the REST API.

This library mainly serves the Home Assistant OpenEMS integration, but it does not depend on Home Assistant.

Installation

pip install openems-client

Requires Python 3.14 or newer.

Usage

import asyncio

from openems_client.const import CONN_TYPE_DIRECT_EDGE
from openems_client.entry_data import OpenEMSConfigReader, OpenEMSWebSocketConnection
from openems_client.openems import OpenEMSBackend


async def main() -> None:
    connection = OpenEMSWebSocketConnection(
        {
            "type": CONN_TYPE_DIRECT_EDGE,
            "host": "192.168.1.10",
            "url": None,
            "username": "guest",
            "password": "user",
        }
    )
    await connection.connect_to_server()
    login_response = await connection.login_to_server()

    reader = OpenEMSConfigReader(connection)
    edges = await reader.read_edges()
    edge_id = edges["edges"][0]["id"]
    reader.set_edge_id(edge_id)
    components = await reader.read_edge_components()

    multi_edge = OpenEMSConfigReader.parse_login_response(login_response)
    backend = OpenEMSBackend(connection, edge_id, multi_edge, components)
    backend.start()
    ...
    await backend.stop()


asyncio.run(main())

Connection types

Constant Target Default URL
CONN_TYPE_DIRECT_EDGE OpenEMS edge ws://<host>:8085/
CONN_TYPE_LOCAL_FEMS Local FEMS UI websocket ws://<host>:80/websocket
CONN_TYPE_LOCAL_OPENEMS Local OpenEMS backend ws://<host>:8082/
CONN_TYPE_WEB_FENECON FENECON portal wss://portal.fenecon.de/openems-backend-ui2
CONN_TYPE_CUSTOM_URL Any websocket URL as given in url

Development

uv sync
uv run ruff format --check .
uv run ruff check .
uv run mypy
uv run pytest

License

Apache License 2.0, see LICENSE.

Metadata

Release files for openems-client 0.1.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 openems-client 0.1.0
File Size Uploaded Provenance Actions
openems_client-0.1.0.tar.gz 108.3 kB With provenance Details for openems_client-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for openems-client 0.1.0
File Interpreter ABI Platform Actions
openems_client-0.1.0-py3-none-any.whl Python 3 none any Details for openems_client-0.1.0-py3-none-any.whl

Total release size: 136.1 kB

Release files / openems_client-0.1.0.tar.gz

Download URL openems_client-0.1.0.tar.gz
Size 108.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0e78574c4578645c9dfe41a2981beb89d87cd982f8cf6de2b84af9450e937bd4
BLAKE2b-256 checksum
How to use checksums
3f0dce5fc453b21a16f13205392d070b14e437bd6cd9b6b38a38c285cbd9b161
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Release files / openems_client-0.1.0-py3-none-any.whl

Download URL openems_client-0.1.0-py3-none-any.whl
Size 27.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
50c2866a35f82bf389fdbaafe97a3d0af36557028ac55a022df585848913001a
BLAKE2b-256 checksum
How to use checksums
e122644a62ebb5b6a09ebe28805e97a55a1035491f104d76ecfc1d8f1d03b7f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Security for openems-client 0.1.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for openems_client-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

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