Skip to content

Latest commit

 

History

History
269 lines (198 loc) · 6.89 KB

README-2026-PREDBAT-LUXPOWER-CONTROL.md

File metadata and controls

269 lines (198 loc) · 6.89 KB

PredBat + LuxPower Troubleshooting --- August 2026

This document records a troubleshooting incident involving PredBat, Home Assistant and a LuxPower inverter where a previously working setup appeared to stop responding correctly to charge and export control.

It is deliberately separate from the original Grid Sell Back issue documented in this repository. That earlier issue had a different root cause.

Symptoms

PredBat appeared healthy:

  • plans were generated successfully
  • tariff data was available
  • PV, load, battery and grid data were available
  • Manual Charge and Manual Export overrides were accepted
  • the predicted plan contained charge/export slots

However, it initially appeared that the LuxPower inverter was not carrying out the requested charge/export actions.

1. Verify the underlying Lux controls first

The current LuxPower Home Assistant integration exposes percentage controls including:

number.lux_ac_charge_power
number.lux_forced_discharge_power

These were tested directly from Home Assistant and confirmed to change the corresponding settings on the physical inverter.

The working PredBat mappings are:

charge_rate_percent:
  - number.lux_ac_charge_power

discharge_rate_percent:
  - number.lux_forced_discharge_power

This is an important diagnostic step: prove that Home Assistant can control the physical inverter before assuming PredBat is at fault.

2. Failed discharge target SOC write

During a Manual Export test, PredBat logged:

Trying to write 15 to discharge_target_soc didn't complete got 0.0
Inverter 0 write to discharge_target_soc failed

The configured entity was:

discharge_target_soc:
  - number.lux_forced_discharge_soc_limit

Direct testing showed that this entity was not functioning as a reliable writable control.

For this installation the capability was therefore disabled:

inverter:
  has_target_soc: false

and the mapping was removed/commented:

# discharge_target_soc:
#   - number.lux_forced_discharge_soc_limit

Do not blindly copy this change. Test the equivalent entity on your own LuxPower/Home Assistant installation first.

3. Stale/nonexistent entity reference

The existing configuration also contained:

- service: switch.turn_on
  entity_id: switch.lux_grid_export

but switch.lux_grid_export no longer existed in Home Assistant.

The actual Forced Discharge control was:

switch.lux_forced_discharge

This was tested directly using both switch.turn_on and switch.turn_off, and both operations correctly changed Forced Discharge on the physical inverter.

The discharge service was simplified to:

discharge_start_service:
  - service: switch.turn_off
    entity_id: switch.lux_fast_zero_export

  - service: switch.turn_on
    entity_id: switch.lux_forced_discharge

discharge_stop_service:
  - service: switch.turn_off
    entity_id: switch.lux_forced_discharge

A historical switch.lux_feed_in_grid entity was also found, but it was unavailable during this investigation, so it was not substituted into the working control path.

4. Manual overrides are not necessarily instantaneous

One major source of confusion was expecting Manual Charge or Manual Export to behave like immediate inverter buttons.

The observed behaviour was:

Manual override selected
        ↓
PredBat records override
        ↓
PredBat recalculates/optimises the plan
        ↓
new charge/export window generated
        ↓
inverter parameters programmed
        ↓
action occurs

Logs confirmed that the override was being accepted, for example:

Plan override requested: Manual Export ...

PredBat then performed its optimisation cycle before applying the resulting inverter settings.

Therefore, allow the calculation cycle to complete before deciding that an override has failed.

5. End-to-end verification

After the configuration was cleaned up, PredBat was left to operate autonomously.

On 22 August 2026, PredBat scheduled an export window of approximately:

17:45 - 19:01

Before the window, the LuxPower inverter showed:

Forced Discharge Enable = Enabled
Forced Discharge Power Rate = 100%
T1 = 17:45 - 19:01

During the window, observed power flow was approximately:

Battery discharge: 3155 W
PV generation:       184 W
House consumption:   230 W
Grid export:         2779 W

This demonstrated real battery-to-grid export under PredBat control.

After the scheduled window ended, by approximately 19:05 the inverter had returned to normal demand/self-consumption mode and grid export had stopped.

This confirmed both the automatic start and automatic stop paths:

PredBat plan
    ↓
Home Assistant
    ↓
LuxPower controls
    ↓
Forced Discharge enabled
    ↓
Battery exports to grid
    ↓
Scheduled window ends
    ↓
Forced Discharge stops
    ↓
Normal demand mode resumes

What actually caused the problem?

No single PredBat optimiser failure was demonstrated.

The investigation found multiple factors:

  1. A configured discharge_target_soc entity was not behaving as a reliable writable control.
  2. The configuration contained a stale switch.lux_grid_export entity that no longer existed.
  3. Manual overrides were initially being judged too quickly; PredBat needed time to regenerate its plan and apply the resulting inverter settings.

Once the broken/stale control mappings were removed and PredBat was allowed to complete its planning cycle, autonomous charge/export control worked correctly again.

Troubleshooting checklist

If a previously working PredBat/LuxPower installation appears to stop controlling the inverter:

  1. Confirm PredBat reports a valid configuration and valid plan.
  2. Confirm the expected Chrg or Exp slot exists in the plan.
  3. Confirm PredBat is in the appropriate control mode and Read Only is disabled.
  4. Allow Manual Charge/Export overrides enough time for plan recalculation.
  5. Check PredBat logs for Trying to write..., write failed and read-back errors.
  6. Test the referenced Home Assistant number and switch entities directly.
  7. Verify the change on the physical LuxPower inverter, not merely in HA state.
  8. Check whether entity IDs have disappeared or changed following integration updates.
  9. Remove/disable unsupported controls rather than repeatedly allowing PredBat to write to broken entities.
  10. After changes, leave the system running autonomously and verify a complete scheduled start/stop cycle.

Key lesson

A Home Assistant entity existing as a number or switch does not by itself prove that it is a functioning writable inverter control.

Test each control path independently:

PredBat → Home Assistant → LuxPower integration → physical inverter

and verify the physical result before changing the overall PredBat architecture.