LektricoWifi
This is a package for communicating with Lektrico's chargers (1P7K, 3P22K) and devices (EM, 3EM) when they are in your wifi network.
You have to know the IP of your device.
What is this package offering:
- Identify your device by IP
type, serial_number, board_revision
- Ready the device's parameters
currents, voltages, powers, errors, ...
see the output in the examples below
- Command the device
commands for charger:
- start charging: send_charge_start
- stop charging: send_charge_stop
- override charge schedule: send_charge_schedule_override
- reset the device: send_reset
- enable/disable authorisation: set_auth with bool parameter
- set leds brightness: set_led_max_brightness with int parameter 10->100
- set the dynamic current: set_dynamic_current with int parameter 0 or 6->32
- set the user current: set_user_current with int parameter 6->32
- lock/unlock the device: set_charger_locked with bool parameter
- enable/disable the compatibility mode (1P7K only): set_compatibility_mode with bool parameter
commands for em:
- set the load balancing mode (OFF, POWER, HYBRID, GREEN): set_load_balancing_mode with int parameter 0->3
- reset the device: send_reset
How to use it:
-
Find the IP of your Lektrico device in your local wifi network
-
Install it in your python project's environment
pip install lektricowifi==0.1
-
Install the required library
pip install aiohttp
-
Python example for charger: (python 3.11.0)
import asyncio from lektricowifi import Device from lektricowifi.models import Info, Settings async def main(): """Example of communicating with a Lektrico charger.""" # use your device's IP! async with Device("192.168.100.11") as device: # identify your device's type settings: Settings = await device.device_config() print(settings) """output: Settings(type='1p7k', serial_number=500006, board_revision='E')""" print(settings.type) """output: 1p7k""" # read your device's parameters info: Info = await device.device_info(Device.TYPE_1P7K) print(info) """output: InfoForCharger(current_l1=0.0, current_l2=0.0, current_l3=0.0, voltage_l1=0.0, voltage_l2=0.0, voltage_l3=0.0, fw_version='1.45_beta', charger_state='Available', session_energy=0.0, charging_time=0, instant_power=0.0, temperature=39.8, dynamic_current=32, require_auth=False, install_current=6, led_max_brightness=100, total_charged_energy=18.0, has_active_errors=False, state_e_activated=False, overtemp=False, critical_temp=False, overcurrent=False, meter_fault=False, undervoltage_error=False, overvoltage_error=False, rcd_error=False, cp_diode_failure=False, contactor_failure=False, user_current=32, current_limit_reason='Installation current')""" # command the charger to start charging answer: bool = await device.send_charge_start() print(answer) """output: {'id': 57130362, 'src': '1p7k_500006', 'dst': 'HASS', 'result': True}""" if __name__ == "__main__": loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) loop.run_until_complete(main()) -
Python example for em device: (python 3.11.0)
import asyncio from lektricowifi import Device, LBMode from lektricowifi.models import Info, Settings async def main(): """Example of communicating with a Lektrico device.""" # use your device's IP! async with Device("192.168.100.201") as device: # identify your device's type settings: Settings = await device.device_config() print(settings) """output: Settings(type='em', serial_number=810172, board_revision='A')""" print(settings.type) """output: em""" # read your device's parameters info: Info = await device.device_info(Device.TYPE_EM) print(info) """output: InfoForM2W(current_l1=0.0, current_l2=0.0, current_l3=0.0, voltage_l1=230.968, voltage_l2=230.968, voltage_l3=0.1,fw_version='1.15', power_l1=0.0, power_l2=0.0, power_l3=0.0, breaker_curent=32, power_factor_l1=0.0, power_factor_l2=0.0, power_factor_l3=0.0, lb_mode=0)""" # command the em to change the load balancing mode answer: bool = await device.set_load_balancing_mode(LBMode.GREEN.value) print(answer) """output: {'id': 32647575, 'src': 'm2w_810172', 'dst': 'HASS', 'result': True}""" if __name__ == "__main__": loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) loop.run_until_complete(main())
Metadata
Release files for lektricowifi 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lektricowifi-0.2.tar.gz | 11.0 kB | Without provenance | Details for lektricowifi-0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lektricowifi-0.2-py3-none-any.whl | Python 3 | none | any | Details for lektricowifi-0.2-py3-none-any.whl |
Total release size: 19.7 kB
Release files / lektricowifi-0.2.tar.gz
| Download URL | lektricowifi-0.2.tar.gz |
|---|---|
| Size | 11.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4095233a65f30915a18c5b437f48473ba82057e2efb9db7e3b5b2303480fc25d
|
|
BLAKE2b-256 checksum How to use checksums |
52cd4778822d30aade30f64d8a913b069d8de1169cc9e822ff1a3cb8f191b80a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.3
|
Release files / lektricowifi-0.2-py3-none-any.whl
| Download URL | lektricowifi-0.2-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a5ec04fa6bc2a812b37cd79b0a84d6292427eaa9d7e2415012c3ee69a4311d2a
|
|
BLAKE2b-256 checksum How to use checksums |
bb6ecce1f3cf81346794fdeca951949270824a169e52f8fbfbe8a3cfd3633876
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.3
|
Security for lektricowifi 0.2
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.