
Product
Introducing Webhook Events for Pull Request Scans
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
lektricowifi
Advanced tools
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.
type, serial_number, board_revision
currents, voltages, powers, errors, ...
see the output in the examples below
commands for charger:
commands for em:
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())
FAQs
Communication with Lektrico's chargers
We found that lektricowifi demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
Research
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.
Product
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.