This is python module to control KEBA charging stations, in specific the P20 and P30 (including different branding like BMW wallbox and SolarEdge). Commands were taken from the UDP Programming Manual. The module was written for the usage in Home Assistant and is based on asyncio.
You can install the module from pypi.org
pip install keba_kecontactor from source
git clone https://github.com/dannerph/keba-kecontact
cd keba-kecontact
pip install .The module contains a command line interface to connect and send UDP commands, discover charging stations in your local networks and emulate a KEBA charging station for testing purposes. Run
python -m keba_kecontactand follow the instructions.
The module is written using asyncio and creates a UDP socket to listen for incoming packets on port 7090 (cannot be changed).
from keba_kecontact import create_keba_connection
from keba_kecontact.connection import ChargingStation, SetupError
async def connect(ip: str) -> None:
keba = await create_keba_connection()
try:
charging_station = await keba.setup_charging_station(ip, periodic_request=False)
except SetupError as ex:
print(f"Charging station at {ip} could not be set up: {ex}")