[Integration] EG4 Web Monitor Home Assistant Integration

[Integration] EG4 Web Monitor Home Assistant Integration

I’m excited to share the EG4 Web Monitor Home Assistant Integration - a comprehensive custom component that brings full monitoring and control of EG4 solar systems directly into Home Assistant!

:rocket: What This Integration Does

This integration connects to the EG4 Monitor web API to provide real-time monitoring and control of your entire EG4 solar ecosystem, including inverters, batteries, and GridBOSS devices.

:battery: Complete Device Support

  • Standard Inverters: FlexBOSS21, FlexBOSS18, 18KPV, 12KPV, XP series
  • GridBOSS Devices: Full microgrid interconnection monitoring with L1/L2 phase tracking
  • Individual Battery Monitoring: Per-battery sensors with detailed cell-level diagnostics
  • Multi-Station Architecture: Support for multiple solar installations per account

:bar_chart: Comprehensive Sensor Coverage

Inverter Monitoring (~50+ sensors per device):

  • Power: AC/DC power, PV generation, battery charging/discharging
  • Electrical: Voltages, currents, frequency with precision scaling
  • Energy: Daily/lifetime generation, consumption, grid import/export
  • Environmental: Internal temperature, radiator temperatures
  • Status: System status, firmware version, diagnostic information

Individual Battery Sensors (~15 sensors per battery):

  • Core metrics: Voltage, current, State of Charge (SoC), State of Health (SoH)
  • Cell management: Max/min cell voltages and temperatures
  • Cell Voltage Delta: Calculated sensor showing imbalance between cells
  • Lifecycle: Cycle count, remaining/full capacity, firmware version

GridBOSS Advanced Features (~80+ sensors):

  • Grid interconnection monitoring (L1/L2 phases)
  • UPS and backup load management
  • 4 Smart Load Ports: Configurable as “Unused”, “Smart Load”, or “AC Couple”
  • AC coupling and solar integration tracking
  • Generator monitoring and control integration

:dart: Key Features

Multi-Inverter & GridBOSS Support

Unlike other integrations, this supports complex installations:

  • Multiple inverters in parallel groups
  • GridBOSS microgrid interconnect devices
  • Cross-inverter parameter synchronization
  • Hierarchical device organization

Individual Battery Devices

Each battery gets its own Home Assistant device with full monitoring:

# Example battery sensors
sensor.battery_44300e0585_01_state_of_charge
sensor.battery_44300e0585_01_cell_voltage_delta  # 🔋 Great for monitoring cell balance!
sensor.battery_44300e0585_01_cycle_count

Smart Entity Management

  • Automatic Scaling: Voltages, frequencies, and energy values properly scaled
  • Zero Filtering: Unused sensors filtered out, but essential ones preserved
  • Device Hierarchy: Clean organization following Station → Parallel Groups → Inverters → Batteries

:robot: Sample Automation: Battery Cell Balancing

The integration includes a powerful automation example that automatically manages battery top balancing:

How It Works:

  1. Monitors all battery cell voltage delta sensors continuously
  2. Detects when ANY battery has a delta > 0.05V for 24+ hours
  3. Balances by setting SOC limit to 101% for top balancing
  4. Recovers automatically after 48 hours, returning to 80% normal limit
# Simplified automation structure
- id: eg4_battery_cell_balancing
  alias: "EG4 Battery Cell Balancing"
  
  trigger:
    # Start balancing: Cell delta > 0.05V for 24h
    - id: "start_balancing"
      platform: numeric_state
      entity_id:
        - sensor.battery_*_cell_voltage_delta
      above: 0.05
      for: hours: 24
    
    # End balancing: SOC limit 101% for 48h  
    - id: "end_balancing"
      platform: numeric_state
      entity_id: number.*_system_charge_soc_limit
      above: 100
      for: hours: 48
  
  action:
    - choose:
        # Set SOC to 101% when imbalance detected
        - conditions:
            - condition: trigger
              id: "start_balancing"
          sequence:
            - service: number.set_value
              target:
                entity_id: number.flexboss21_44300e0585_system_charge_soc_limit
              data:
                value: 101
        
        # Return SOC to 80% after balancing complete
        - conditions:
            - condition: trigger
              id: "end_balancing"
          sequence:
            - service: number.set_value
              target:
                entity_id: number.flexboss21_44300e0585_system_charge_soc_limit
              data:
                value: 80

Automation Benefits:

  • :white_check_mark: Fully Automatic: No manual intervention required
  • :white_check_mark: Self-Contained: No helper entities needed - uses trigger IDs
  • :white_check_mark: Safe: Built-in conditions prevent conflicts, manual override supported
  • :white_check_mark: Customizable: Adjustable thresholds, timing, and SOC limits

:wrench: Installation

HACS (Recommended)

  1. Add custom repository: https://github.com/joyfulhouse/eg4_web_monitor
  2. Install “EG4 Web Monitor”
  3. Restart Home Assistant

Configuration

  1. Go to Settings → Devices & Services → Add Integration
  2. Search for “EG4 Web Monitor”
  3. Enter your EG4 Monitor credentials
  4. Select station (if multiple)
  5. Devices auto-discovered!

:chart_with_upwards_trend: Production Ready

This integration has been thoroughly tested and optimized:

  • :white_check_mark: 9.93/10 Pylint Score - Production-quality code
  • :white_check_mark: Comprehensive Error Handling - Graceful API failures
  • :white_check_mark: Smart Session Management - 2-hour sessions with auto-reauthentication
  • :white_check_mark: Concurrent API Calls - Efficient parallel data fetching
  • :white_check_mark: Real-time Updates - 30-second refresh intervals

:dart: Perfect For

  • Multi-inverter installations with parallel groups
  • GridBOSS users needing advanced grid management
  • Battery enthusiasts who want cell-level monitoring
  • Automation lovers seeking advanced battery management
  • Anyone wanting comprehensive EG4 system integration

:books: Documentation & Support

:pray: Credits

This integration builds upon the excellent pioneering work by @twistedroutes and their eg4_inverter_ha project.

:warning: Disclaimer

This is an unofficial integration not affiliated with EG4 Electronics. The battery balancing automation modifies inverter settings - use at your own risk and ensure compatibility with your battery system.


Ready to supercharge your EG4 monitoring? Try it out and let me know how it works for your setup! :battery::zap::house:

Questions, issues, or success stories welcome below!

3 Likes

:rocket: EG4 Web Monitor v1.3.0: Quick Charge Control Implementation

Hey everyone! Excited to share a major update to the EG4 Web Monitor integration with v1.3.0 - introducing comprehensive Quick Charge Control functionality! :zap::battery:

:zap: What’s New: Quick Charge Control

The most requested feature is finally here! You can now start and stop quick charging directly from Home Assistant with real-time status monitoring.

:radio_button: Switch Entity Implementation

  • Direct Battery Control: Toggle quick charging on/off from your dashboard

  • Real-time Status: Live monitoring using the hasUnclosedQuickChargeTask API field

  • Optimistic Updates: Immediate UI feedback - no waiting for API responses!

  • Smart Error Handling: Graceful state reversion if API calls fail

  • Task Tracking: Detailed attributes showing task ID and current status

:dart: Device Compatibility

The Quick Charge switches are automatically created for compatible devices:

  • :white_check_mark: FlexBOSS Series: FlexBOSS21, FlexBOSS18

  • :white_check_mark: KPV Series: 18KPV, 12KPV

  • :white_check_mark: XP Series: All XP models

  • :white_check_mark: Auto-Discovery: No manual configuration needed!

:iphone: Entity Examples


# Quick Charge switches automatically appear:

switch.flexboss21_1234567890_quick_charge

switch.18kpv_1234567890_quick_charge

# With attributes for monitoring:

task_id: 279672

task_status: "WAIT_CHARGE"

optimistic_state: false # Shows when using optimistic updates

:wrench: Technical Implementation

Enhanced API Integration

  • New Endpoints: start_quick_charge(), stop_quick_charge(), get_quick_charge_status()

  • Proper Session Management: Works with existing 2-hour authentication flow

  • Status Parsing: Real-time parsing of quick charge task status from EG4 API

Code Quality Maintained

  • Perfect Pylint Score: Still maintaining 10.00/10 code quality! :bar_chart:

  • Home Assistant Best Practices: Proper entity management and device hierarchy

  • Comprehensive Error Handling: Detailed logging and graceful fallbacks

:video_game: User Experience

Immediate Control

The switch provides instant feedback - when you toggle it, the UI updates immediately while the API call happens in the background. If there’s an error, it automatically reverts back with a notification.

Visual Indicators

  • Icon: Battery charging icon (mdi:battery-charging) for clear identification

  • Naming: Clean format like “FlexBOSS21 44300E0585 Quick Charge”

  • Status: Real-time on/off state based on actual charging status

:clipboard: How to Get It

HACS Users (Recommended)

  1. Go to HACS → Integrations

  2. Find “EG4 Web Monitor”

  3. Click “Update” to get v1.3.0

  4. Restart Home Assistant

  5. Quick Charge switches will automatically appear for compatible devices!

Manual Installation


cd /config/custom_components/eg4_web_monitor

git pull origin main

# Restart Home Assistant

:mag: What to Expect

After updating, you’ll see new switch entities appear automatically for each compatible inverter. The switches will show the current quick charge status and allow you to start/stop charging with a simple toggle.

Entity ID Format: switch.{model}_{serial}_quick_charge

:bug: Troubleshooting

Switch Not Appearing?

  • Check that your device model is supported (FlexBOSS, 18KPV, 12KPV, XP series)

  • Verify the device type is “inverter” (not GridBOSS)

  • Check debug logs for device compatibility messages

Switch Shows Wrong State?

  • The integration uses the official EG4 API hasUnclosedQuickChargeTask field

  • Status updates every 30 seconds with your regular data refresh

  • Optimistic updates provide immediate feedback during toggle operations

:pray: Community Feedback

This implementation was built based on community requests and testing. The Quick Charge functionality integrates seamlessly with the existing 50+ sensors per inverter while maintaining the high code quality standards (10.00/10 Pylint score).

Performance Impact: Minimal - Quick Charge status is fetched alongside existing data with the same 30-second refresh interval using parallel API calls.


:books: Full Changelog & Documentation


Happy charging, everyone! :zap::house::sunny:

Let me know how the Quick Charge functionality works for you - always looking for feedback to make this integration even better!

P.S. - Still maintaining that 10.00/10 Pylint score because clean code matters! :blush:

2 Likes

I just set this up, and it is very impressive. It gives so much more control of my 18kpv than I had before.

The first post references an included automation, but I don’t see it anywhere. Does that show up in the GUI? I love the concept, but want to use my own automation with the AC charge setting to force a top-balance if it’s after 6pm and still has too large of a delta.

Thank you!!!

Glad you’re finidng the integration useful! I use this to quick charge if battery level is too low:

alias: "Battery: Quick Charge"
description: ""
triggers:
  - trigger: time
    at: "15:00:00"
conditions:
  - condition: numeric_state
    entity_id: sensor.18kpv_1234567890_state_of_charge
    below: 80
actions:
  - action: switch.turn_on
    metadata: {}
    data: {}
    target:
      entity_id: switch.18kpv_1234567890_quick_charge
mode: single

There’s also a sample automation in the github repo that top balances when the delta between cell voltages exceeds a certain threshold for too long.

I added the integration but have a noob question: How do I install the dashboard?

I copied the dashboard yaml into my configuration file, but my dashboard is just a bunch a tables, not nice looking graphs and charts. What do I need to do so that my dashboard looks like the sample dashboard from Git Hub?


Is it possible to expose for both set and get:

Stop AC Charge SOC(%)
On-Grid Cut-Off SOC(%)

I would like to add automation in HA to control those depending on solar forecast for the next day

You’ll need to create your own dashboard. There’s an example in the github repository.

@afilenkov - Implemented in v1.5.1! :tada:

New Controls

Three new number entities in the Controls section:

  1. AC Charge SOC Limit (HOLD_AC_CHARGE_SOC_LIMIT) - 0-100%
  2. On-Grid SOC Cut-Off (HOLD_DISCHG_CUT_OFF_SOC_EOD) - 0-100%
  3. Off-Grid SOC Cut-Off (HOLD_SOC_LOW_LIMIT_EPS_DISCHG) - 0-100%

All support read/write and enable solar forecasting automations as requested.

Release: v1.5.1

1 Like

EG4 Web Monitor v3.0.0 Beta - Architecture Update & Call for Device Data

Hey everyone!

Big update for v3.0.0 - we’ve extracted the API client into a standalone library called pylxpweb to support more inverters and monitoring platforms.

What’s New

  • pylxpweb library - Reusable Python client with proper device object models

  • Multi-platform support planned - EG4, LuxPower US (us.luxpowertek.com), LuxPower EU (eu.luxpowertek.com)

  • New controls - Working Mode switches, Battery Charge/Discharge Current, decimal AC Charge Power

  • Code quality - Base classes & mixins, strict typing, 127 automated tests, Platinum tier certified

:warning: Breaking Changes

  • Entity IDs may change - Some sensors have been renamed for consistency. You may need to update automations and dashboards.

  • Removed deprecated sensors - Sensors that were previously deprecated have been removed.

  • Minimum HA version - Requires Home Assistant 2024.1 or newer.

Help Us Support More Inverters!

We need device data to properly support all EG4/LuxPower models. If you have a FlexBOSS, 12KPV, XP series, LuxPower inverter, or GridBOSS, please help!

Collect your data (auto-sanitizes serial numbers):


pip install pylxpweb

pylxpweb-collect -u YOUR_EMAIL -p YOUR_PASSWORD --sanitize

Then create an issue at pylxpweb/issues titled “Device Data: [Your Model]” and attach the generated zip.

Full instructions: COLLECT_DEVICE_DATA.md

Installing the Beta via HACS

  1. Go to HACS → Integrations → EG4 Web Monitor

  2. Click the three dots menu (⋮) → Redownload

  3. Enable “Show beta versions” checkbox

  4. Select v3.0.0-beta.7 from the dropdown

  5. Click Download and restart Home Assistant

Links

Thanks for all the feedback - it directly shapes this integration!

I have a FlexBOSS18 and a GridBOSS. I’m not a programmer though. Please let me know if I can help in any way with your project.

1 Like

If you have a github account, you can run the extraction script, but it’s not too big a deal though. I have a GridBOSS and a FlexBoss21 that I need to have re-installed – I would imagine they have similar parameters. More curious if anyone has the offline inverters so I can have the integration properly handle their entity creation since they lack the functions a hybrid inverter has.

If anyone would like to help test before I release v3.0.0 for wider distribution, please follow the steps below. Also note that there are breaking changes with the way the battery entities are created. I tried to keep it as compatible w/ v2 as much as possible, but some modifications to automations may be needed.

Go to the EG4 Web Monitor integration in HACS.
Click on Redownload:

Select Need a different version?

Select v3.0.0-rc.4

Please report any issues in github! Thanks!

1 Like

I am just getting my Gridboss/flexboss systems setup now. One of the gridboss smart loads will be attached to my shop furnace. I would like to provide more control of how my furnace behaves on battery power.

For example, if the grid is down, I would like to disable this furnace unless the shop temperature is below say 45 degrees in which case I need the furnace to keep the shop above freezing.

Does this integration allow me to do this?

Thanks!

Swapping from MQTT from Solar Assistant to this.
I think in some ways it will be better, but others I am still trying to figure out.

Like I can’t find a simple sensor to show the current power (watts) for my Solar PV for Flexboss 21 + Gridboss

I would really appreciate a 1:1 mapping from the native sensors added from this intergration to the common sense Energy dashboard entries for Grid consumption, return to grid, grid power, solar production, battery storage, etc.

I went with
Parallel Group A Grid Import - Grid consumption
Parallel Group A Grid Export - Return to grid
Grid Boxx Grid Power - Grid Power
Flexboss Solar Yield - Solar production (only KwH sensor no Watt sensor)
Parallel Group A Discharging/Charging - Battery systems

Did I make any errors here?

I did not add consumption under individual devices from the EG4 intergration, I use a per breaker CT monitoring system to track that, but wonder if I might find a way to use this sensor as well to increase accuracy or as a double check without scewing the energy dashboard.

hi there, just trying to get this integration running and I get a an error “Config flow could not be loaded: 500 Internal Server Error Server got itself in trouble” during the “add integration” step.
any ideas?