Package: alfeneve
API Client for Alfen Eve EV charging units.InstallationAs a CLI tool:$pipinstallalfeneve[cli]As a library:$pipinstallalfeneveConfigurationThe CLI tool usesomniconf. This allows you to provide any CLI
argument using a file or through the environment (or a combination).Directly as arguments:$alfen-eve--alfen-endpointhttps://192.168.1.23--alfen-usernameadmin--alfen-passwordfooUsing a YAML file (make sure to installPyYAML, or useomniconf[yaml]):$catsettings.yamlalfen:endpoint:https://192.168.1.23username:adminpassword:foo$alfen-eve--yaml-filenamesettings.yamlUsing environment variables:$ALFEN_ENDPOINT=https://192.168.1.23ALFEN_USERNAME=adminALFEN_PASSWORD=fooalfen-eveAPI CredentialsAlfen ships a tool to allow you to configure your Alfen charging unit calledACE Service Installer (or just Service Installer).
This tool requires a Service Account that you canrequest from Alfen.The API doesn’t actually use this account directly though. It seems that the API credentials are hard-coded, and the Service Installer either ships with this
password, or can infer or request this password from Alfen. Regardless, you can use the Service Installer tool to sniff out the credentials.At this time this process is a bit involved, and requires you to know how to insert yourself as a proxy between the Service Installer and your charging unit
on Windows. The broad steps are as follows (usingmitmproxy):Install mitmproxy.Start mitmproxy at least once to generate the certificates:mitmproxy –listen-port 8090.Install the mitmproxy certificate asTrusted Root Certificate(you can find it in the.mitmproxyfolder in your User Account).Start mitmproxymitmproxy –listen-port 8090 –insecureand set it as the OS Global Proxy usingInternet Options.If all is configured properly, you can now start the Service Installer and login using your Service Account.Connect to your Alfen charger, and look in the mitmproxy window. There should be a request to/api/login. You can find the username and password in this request.Configure these credentials as specified above.Make sure to remove mitmproxy as your OS Global Proxy.ExamplesUse as a CLI tool:$alfen-eve--modecategoriescategory----------genericgeneric2accelerotempstatesmeter1meter4ledsocppdisplaycommMbusTCP$alfen-eve--modeproperties--properties-categorymeter4namevalueidcat-------------------------------------------------------OD_sensOptionalEnergyMeter455217_0meter4OD_sensEnergyMeterType415218_0meter4meter4_voltageL1N225.15221_3meter4meter4_voltageL2N225.75221_4meter4meter4_voltageL3N228.65221_5meter4...Use as a library:fromalfeneve.alfenimportAlfenfrompprintimportpprintwithAlfen("https://192.168.1.23",("admin","foo"))aseve:cats=eve.categories()pprint(cats)# ['generic',#  'generic2',#  'accelero',#  'temp',#  'states',#  'meter1',#  'meter4',#  'leds',#  'ocpp',#  'display',#  'comm',#  'MbusTCP']properties=eve.properties(category="generic")pprint(list(properties))# [<AlfenProperty(name=OD_manufacturerDeviceName, value=NG910, id=1008_0, cat=generic)>,#  <AlfenProperty(name=OD_manufacturerHardwareVersion, value=G0, id=1009_0, cat=generic)>,#  <AlfenProperty(name=OD_manufacturerSoftwareVersion, value=4.8.0-3168, id=100A_0, cat=generic)>,#  ... ]LicenseMIT