Dongle Firmware 3.1.0

Posted on 04/08/2025 | Solar Panels Inverters
Dongle firmware update Changelog for 3.1.0

3.1.0

New Features & Enhancements

Grid Boss Register Updates

  • Signed Power Values:
    • Updated Grid Boss registers to use signed 16-bit integers for power measurements
    • Correctly handles negative power values for export/discharge scenarios
    • Affects registers: Power Values of smart ports
    • Ensures accurate power flow representation in all monitoring interfaces

PowerFlow Visualization Improvements

  • Major JavaScript Refactoring:
    • Consolidated ~200 lines of repetitive global variables into a single state object
    • Improved code maintainability and reduced memory footprint
    • Fixed inverter click event handling (was only responding to mouseover)
    • Corrected battery fill animation coordinates
    • Added dynamic battery line coloring based on power source:
      • Green: Standard charge/discharge
      • Amber: Charging from solar
      • Red: Charging from grid
      • Cyan: Charging from mixed sources (solar + grid)
    • IMPORTANT: Clear browser cache after update to see PowerFlow improvements

WiFi Connection Improvements

  • Simplified Reconnection Logic:
    • Implemented more robust WiFi reconnection mechanism
    • Reduced complexity in connection state management
    • Better handling of intermittent connection drops
    • Improved stability for environments with poor WiFi signal

Off-Grid Inverter AC First Support

  • AC First Time Settings:

    • Added support for AC First scheduling on off-grid inverters
    • Three configurable time periods for AC priority operation
    • New writable registers:
      • ACFirstStart / ACFirstEnd
      • ACFirstStart1 / ACFirstEnd1
      • ACFirstStart2 / ACFirstEnd2
    • Allows off-grid systems to prioritize AC input during specific time windows
  • AC Charging Voltage Control:

    • Added AC charging voltage thresholds for All inverters
    • New writable registers:
      • ACChgStartVolt - Voltage to start AC charging
      • ACChgEndVolt - Voltage to stop AC charging
  • To Add to Home Assistant:

    • Please see below how to add these entities to your home assistant integrations before we push the update
      • in const.py under the time heading copy the following block and place under holdbank3:
      "holdbank4": [
          {"name": "AC First Start", "type": "time", "unique_id": "ACFirstStart", "allowed_fimware_codes": ["ceaa"]},
          {"name": "AC First End", "type": "time", "unique_id": "ACFirstEnd", "allowed_fimware_codes": ["ceaa"]},
          {"name": "AC First Start1", "type": "time", "unique_id": "ACFirstStart1", "allowed_fimware_codes": ["ceaa"]},
          {"name": "AC First End1", "type": "time", "unique_id": "ACFirstEnd1", "allowed_fimware_codes": ["ceaa"]},
          {"name": "AC First Start2", "type": "time", "unique_id": "ACFirstStart2", "allowed_fimware_codes": ["ceaa"]},
          {"name": "AC First End2", "type": "time", "unique_id": "ACFirstEnd2", "allowed_fimware_codes": ["ceaa"]},
          ],
      
      • Then under Number under the holdbank4 section:
      {"name": "AC Charge Start Volt", "type": "time", "unique_id": "ACChgStartVolt", "min":38.5, "max":52, "mode":"slider", "step":0.1},
      {"name": "AC Charge End Volt", "type": "time", "unique_id": "ACChgEndVolt", "min":48.5, "max":59, "mode":"slider", "step":0.1},
      
    • Please note to use the voltage settings the inverter must be set to charge time+SOC/VOLT or SOC/VOLT According to otherwise the voltage settings will not apply this is not currently exposed into HA

Fixes

  • NVS String Reading:

    • Fixed critical bug where luxpower_tek_server was returning empty 90% of the time
    • Issue was caused by not getting string size before reading from NVS
    • Implemented proper size retrieval before string read operations
  • HTTP Request Handling:

    • Refactored get_dongle_details_handler to reduce NVS operations from 6 to 1
    • Consolidated multiple NVS open/close cycles into single operation
    • Improved response time and reduced flash wear
  • Region Settings Handler:

    • Updated save_region_handler to support JSON format with keepInverterTime field
    • Now properly handles both URL-encoded and JSON POST data
    • Automatically starts/stops inverter time sync based on setting
    • Maintains backward compatibility with legacy URL-encoded format

Technical Improvements

  • Code Optimization:

    • Reduced code duplication in PowerFlow JavaScript
    • Improved NVS access patterns for better performance
    • Enhanced error handling in string reading operations
  • Memory Management:

    • More efficient buffer usage in HTTP handlers
    • Reduced heap fragmentation through consolidated NVS operations

Migration Notes

  • IMPORTANT: Clear browser cache to ensure PowerFlow visualizations work correctly
  • Grid Boss users will see more accurate power readings with proper negative values
  • No configuration changes required - all improvements are automatic