Skip to main content

evsemaster

Python client library for communicating with a EVSE chargers that use the EVSEMaster app. I've only done my testing on a Telestar EC311S6, but it should work with any EVSE that uses the EVSEMaster app protocol.
I'm intenting to keep this a simple implementation, so it does not have all the features of the original TypeScript project, but it should be sufficient for basic use cases like my Home Assistant integration.

This is based on the original TypeScript project by johnwoo-nl

Currently Implemented

  • Multiple chargers on one UDP socket, routed by device serial
  • Discovery of chargers on the network (they announce themselves; probe() asks the ones that don't)
  • Get EVSE device info
  • Get EVSE status
  • Get EVSE charging status
  • Start/Stop charging
  • Get/Set EVSE nickname
  • Get/Set Current limit
  • Get/Set Device Time (Correcting for on-device errors that causes drift)

Being Implemented

  • Create/Update charging schedule
  • Getting/Setting device properties like time, language, etc.

Not Planned

  • Home Assistant or MQTT integration (see evsemaster-homeassistant)
  • Connecting to the EVSE via Bluetooth (ie. for connecting the EVSE to wifi)
    • Even though the EVSEMaster app is awful to use, using it once to connect the EVSE to wifi is sufficient for most use cases.

Usage

One EvseListener owns the UDP socket; every charger is an EvseDevice added to it. Incoming packets are routed by the device serial in the packet header, so several chargers can share the one socket.

import asyncio
from evsemaster import EvseListener


def on_event(event_type, data):
    print(f"Event: {event_type}, Data: {data}")


def on_discovery(discovered):
    print(f"Found an unconfigured charger: {discovered}")


async def main():
    listener = EvseListener(on_discovery=on_discovery)
    await listener.start()

    evse = await listener.async_add_device(
        host="10.0.0.1",  # IP address of the EVSE
        password="123456",  # 6 digit password of the EVSE
        on_event=on_event,  # called with every parsed update
    )
    if await evse.login():
        await evse.request_status()
        await evse.start_charging()
        await evse.stop_charging()

    await listener.stop()


asyncio.run(main())

Chargers broadcast their presence on the listen port (28376), so the library sees a charger before it is logged in and re-logs in by itself when a session drops. Make sure those broadcasts can reach you: a separate VLAN or a docker bridge network will block them.

There is a test script test.py that can be used to test the library, it takes one or more chargers. Its a bit messy as it just prints the output while accepting commands, but it can be useful for quick testing.

poetry run python test.py 10.0.0.1:123456 10.0.0.2:654321

Shortcuts: status, start [amps] [YYYY-MM-DDTHH:MM:SS] [minutes], stop, discover, use <n>, all.

Metadata

Release files for evsemaster 2.0.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 evsemaster 2.0.0
File Size Uploaded Provenance
evsemaster-2.0.0.tar.gz 18.1 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 39.0 kB

Release files / evsemaster-2.0.0.tar.gz

Download URL evsemaster-2.0.0.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1e7f4d5df9943b917d10dfa0623c6354bd1399c45f67f7a1c7b2bd56827c0bbe
BLAKE2b-256 checksum
How to use checksums
6a91ca69f3d0577a4b9eaddae8c7f1151b5f92dba4480f539a9ebb0ecb6f44be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.13.13 Linux/7.1.4-arch1-1

Release files / evsemaster-2.0.0-py3-none-any.whl

Download URL evsemaster-2.0.0-py3-none-any.whl
Size 20.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fabea615e4efcd5fbc14c1bcc3222d7b5471f705a165783be21512070382c740
BLAKE2b-256 checksum
How to use checksums
f5ac916dcdd470ea579dfdd37456cfcccc0107a9d82a07ae7a33e9e0a0296236
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.13.13 Linux/7.1.4-arch1-1

Security for evsemaster 2.0.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.

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