Native Home Assistant integration for the Gembird / Energenie EG-PM2-LAN network-controlled power strip (4 switchable sockets).
The EG-PM2-LAN supports only one HTTP session at a time. If a second request arrives while a session is open, the device locks up and requires a power cycle. This integration solves that with an internal asyncio queue daemon that strictly serializes all device communication:
Every operation: Login → [Switch command] → Read all 4 states → Logout
No concurrent sessions are ever possible, regardless of how many automations or UI interactions trigger switches simultaneously.
- ✅ 4 switch entities (one per socket)
- ✅ All 4 socket states read in a single request
- ✅ Strict session serialization — device never locks up
- ✅ Immediate state update after switching (no waiting for next poll)
- ✅ Configurable poll interval (default 30 s)
- ✅ UI-based setup via Config Flow (no YAML needed)
- ✅ Works with both old and new device firmware
- ✅ German + English UI
- In HACS → Integrations → ⋮ menu → Custom repositories
- Add
https://github.com/irstmon/egpm2lan-haas type Integration - Install Energenie EG-PM2-LAN
- Restart Home Assistant
Copy the custom_components/egpm2lan/ folder into your
<config>/custom_components/ directory and restart HA.
- Settings → Devices & Services → Add Integration
- Search for Energenie EG-PM2-LAN
- Enter IP address and password (if set on the device)
- 4 switch entities are created automatically
- The device web interface must not be open in a browser during operation
- Default password is usually empty or
1234depending on firmware version - Tested with firmware that exposes
sockstatesJavaScript variable - Legacy firmware using bare
0,1,0,1HTML pattern is also supported
Remove your command_line entries from configuration.yaml and
custom_command_line.yaml. After installing this integration, the old
energenie_steckdose_1..4 entities will be replaced by
switch.energenie_eg_pm2_lan_socket_1..4.
To keep your existing automations working, add these to your configuration.yaml:
homeassistant:
customize:
switch.energenie_eg_pm2_lan_socket_1:
friendly_name: "Energenie Steckdose 1"MIT