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.
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.
The current LuxPower Home Assistant integration exposes percentage controls including:
number.lux_ac_charge_power
number.lux_forced_discharge_powerThese 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_powerThis is an important diagnostic step: prove that Home Assistant can control the physical inverter before assuming PredBat is at fault.
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_limitDirect 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: falseand the mapping was removed/commented:
# discharge_target_soc:
# - number.lux_forced_discharge_soc_limitDo not blindly copy this change. Test the equivalent entity on your own LuxPower/Home Assistant installation first.
The existing configuration also contained:
- service: switch.turn_on
entity_id: switch.lux_grid_exportbut 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_dischargeA 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.
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.
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
No single PredBat optimiser failure was demonstrated.
The investigation found multiple factors:
- A configured
discharge_target_socentity was not behaving as a reliable writable control. - The configuration contained a stale
switch.lux_grid_exportentity that no longer existed. - 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.
If a previously working PredBat/LuxPower installation appears to stop controlling the inverter:
- Confirm PredBat reports a valid configuration and valid plan.
- Confirm the expected
ChrgorExpslot exists in the plan. - Confirm PredBat is in the appropriate control mode and Read Only is disabled.
- Allow Manual Charge/Export overrides enough time for plan recalculation.
- Check PredBat logs for
Trying to write...,write failedand read-back errors. - Test the referenced Home Assistant
numberandswitchentities directly. - Verify the change on the physical LuxPower inverter, not merely in HA state.
- Check whether entity IDs have disappeared or changed following integration updates.
- Remove/disable unsupported controls rather than repeatedly allowing PredBat to write to broken entities.
- After changes, leave the system running autonomously and verify a complete scheduled start/stop cycle.
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.