Skip to main content

alfen-cli

Command line client for the local HTTPS API of Alfen Eve / NG9xx EV chargers (the API that ACE Service Installer and the charger's web UI use).

pip install alfen-cli            # add [signed] for `alfen verify`
export ALFEN_HOST=192.168.1.20 ALFEN_USERNAME=admin ALFEN_PASSWORD=...

alfen info                       # identity / model / firmware, no login
alfen categories
alfen get -c ocpp                # all properties in a category
alfen get 2126_0 OD_commBackOfficeURL_serverDomainAndPort
alfen set 20F2_3=ws://csms.example:8081 --string
alfen logs -n 100                # event log, plain text (unlike OCPP GetLog, which is encrypted)
alfen logs -f                    # follow
alfen transactions
alfen whitelist
alfen reboot --yes
alfen verify <meterPublicKey> <signedMeterData>   # Alfen/DZG signed meter value

--json gives machine-readable output.

One session at a time

The charger's web API serves one client at a time. While ACE Service Installer, the charger's web UI in a browser, Home Assistant (alfen_wallbox) or another script is connected, every other connection is dropped right after the TCP connect or the TLS ClientHello:

error: ConnectionError: ... Connection reset by peer

The charger log shows it as TLS handshake failed (-0x50) / WebServer state AVAILABLE -> BUSY. Close the other client (in ACE Service Installer: disconnect, or quit the program) and retry. Wrong credentials look different (HTTP 401/403 from /api/login). alfen logs out when each command finishes, so it does not hold the session itself; alfen logs -f does, until you stop it.

Notes

  • The charger uses a self-signed certificate and old TLS ciphers; certificate checks are off.
  • Repeated wrong passwords can lock the account. Check credentials before scripting.
  • set writes raw property ids. Some changes only apply after reboot.

Credits

Property id → name mapping and the API flow are based on alfeneve (MIT, Nick Douma).

Development

Source: https://gitea.ai-charge.net/AI-ChargeTechnologies/alfen-cli (push-mirrored to https://github.com/takanori-nagashima/alfen-cli).

python3 -m venv .venv && .venv/bin/pip install -e '.[signed]' pytest build twine
.venv/bin/pytest
# release: bump __version__ in src/alfen_cli/__init__.py, tag vX.Y.Z, then
.venv/bin/python -m build && .venv/bin/twine upload dist/*   # token: Infisical PIP_TOKEN

Metadata

Release files for alfen-cli 0.1.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 alfen-cli 0.1.1
File Size Uploaded
alfen_cli-0.1.1.tar.gz 13.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for alfen-cli 0.1.1
File Interpreter ABI Platform
alfen_cli-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 29.2 kB

Release files / alfen_cli-0.1.1.tar.gz

Download URL alfen_cli-0.1.1.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
81e84d3bb22749d6377b6049230c9dd86176d9cf85c6d8b457bf4e48d01beebc
BLAKE2b-256 checksum
How to use checksums
04d8d8def83b91d3bb5f1edc956e780e31ee81ff83f50da9a940b3e3293ca3a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / alfen_cli-0.1.1-py3-none-any.whl

Download URL alfen_cli-0.1.1-py3-none-any.whl
Size 15.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
790225413fe83f4cd3e0e15a416230920a0d177250310c9f315ff9182187576d
BLAKE2b-256 checksum
How to use checksums
24bc23c3b663d80354afb4aae9a7f89b8625a684e236556f6508d3dd00933aff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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