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.

A device counts as logged in while the charger keeps talking to it: evse.is_logged_in needs a successful login plus a packet other than an announcement within the last 120 seconds (evse.last_alive).

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.1

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.1
File Size Uploaded Provenance
evsemaster-2.0.1.tar.gz 18.4 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 39.4 kB

Release files / evsemaster-2.0.1.tar.gz

Download URL evsemaster-2.0.1.tar.gz
Size 18.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5dcc98cd63c089d2c089e55bc84fe844f211e520163213d81331f65e6365bb18
BLAKE2b-256 checksum
How to use checksums
dfedeb88d09375908fc0cdb38a6ac1b98ed11a37d43d3d989b54635c41a7e6b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.13.13 Linux/7.2.3-arch1-3

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

Download URL evsemaster-2.0.1-py3-none-any.whl
Size 21.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3aa3b2a22a9c2c7baeeb94afdf16e4785408d0a67e43050cde35114d09f9ae75
BLAKE2b-256 checksum
How to use checksums
ee6f2bd5cc3413f7dcf593e9fcae21b7c23d64bc3bee88b62257f99ff230c6f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.13.13 Linux/7.2.3-arch1-3

Security for evsemaster 2.0.1

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