Skip to content

Conversation

@TCWORLD
Copy link
Contributor

@TCWORLD TCWORLD commented Nov 7, 2025

The bound check was incorrectly adding on house load. This means the more the house uses, the less the inverter was allowed to output to the home. This is backwards.

Instead the more the house uses, the more the inverter should be allowed to output power so that it can continue to cover the house load, and still export to the grid up to the grid export limit.

Furthermore,, the mode 1 exit clause changes meant mode 1 never actually stopped - rather it kept trying to stop the mode 8 loop.


A couple of quick tests with the Self-use mode 1 option

  • With the current main branch after feat: Solax Add parallel mode support with remote control fixes and comprehensive documentation #1694 was applied:

    2025-11-07 09:25:21.490 DEBUG (MainThread) [custom_components.solax_modbus.plugin_solax] [REMOTE_CONTROL] Target calculation: mode=Enabled Power Control ap_target=-3062W
    2025-11-07 09:25:21.490 DEBUG (MainThread) [custom_components.solax_modbus.plugin_solax] [REMOTE_CONTROL] Export bounds: ap_target=-618W export_bound=-618W export_limit=3680W house_load=3062W
    2025-11-07 09:25:21.490 DEBUG (MainThread) [custom_components.solax_modbus.plugin_solax] [REMOTE_CONTROL] Bounds checking: initial_ap_target=-3062W final_ap_target=-618W adjusted_by=-2444W
    2025-11-07 09:25:21.490 DEBUG (MainThread) [custom_components.solax_modbus.plugin_solax] Evaluated remotecontrol_trigger: corrected/clamped values: [('remotecontrol_power_control', 'Enabled Power Control'), ('remotecontrol_set_type', 'Set'), ('remotecontrol_active_power', -618), ('remotecontrol_reactive_power', 0), ('remotecontrol_duration', 30.0), ('_uint16', 0), ('_uint32', 0), ('_int32', 0), ('remotecontrol_timeout', 120.0)]
    2025-11-07 09:25:21.490 DEBUG (MainThread) [custom_components.solax_modbus] **debug** ready to repeat remotecontrol_trigger data: {'action': 4, 'data': [('remotecontrol_power_control', 'Enabled Power Control'), ('remotecontrol_set_type', 'Set'), ('remotecontrol_active_power', -618), ('remotecontrol_reactive_power', 0), ('remotecontrol_duration', 30.0), ('_uint16', 0), ('_uint32', 0), ('_int32', 0), ('remotecontrol_timeout', 120.0)]}
    2025-11-07 09:25:21.491 DEBUG (MainThread) [custom_components.solax_modbus] Ready to write multiple registers at 0x7c: [1, 1, 64918, 65535, 0, 0, 30, 0, 0, 0, 0, 0, 120] online: True 
    

    Notice how the target is the 3062W house load, but because of the bound check, it's incorrectly set the target to only 618W. So grid import is covering the use rather than the battery. This is incorrect.

  • With the changes in this PR:

    2025-11-07 09:38:55.233 DEBUG (MainThread) [custom_components.solax_modbus.plugin_solax] [REMOTE_CONTROL] Target calculation: mode=Enabled Power Control ap_target=-3125W
    2025-11-07 09:38:55.233 DEBUG (MainThread) [custom_components.solax_modbus.plugin_solax] [REMOTE_CONTROL] Export bounds: ap_target=-3125W export_bound=-6805W export_limit=3680W house_load=3125W
    2025-11-07 09:38:55.233 DEBUG (MainThread) [custom_components.solax_modbus.plugin_solax] Evaluated remotecontrol_trigger: corrected/clamped values: [('remotecontrol_power_control', 'Enabled Power Control'), ('remotecontrol_set_type', 'Set'), ('remotecontrol_active_power', -3125), ('remotecontrol_reactive_power', 0), ('remotecontrol_duration', 30.0), ('_uint16', 0), ('_uint32', 0), ('_int32', 0), ('remotecontrol_timeout', 120.0)]
    2025-11-07 09:38:55.233 DEBUG (MainThread) [custom_components.solax_modbus] **debug** ready to repeat remotecontrol_trigger data: {'action': 4, 'data': [('remotecontrol_power_control', 'Enabled Power Control'), ('remotecontrol_set_type', 'Set'), ('remotecontrol_active_power', -3125), ('remotecontrol_reactive_power', 0), ('remotecontrol_duration', 30.0), ('_uint16', 0), ('_uint32', 0), ('_int32', 0), ('remotecontrol_timeout', 120.0)]}
    2025-11-07 09:38:55.233 DEBUG (MainThread) [custom_components.solax_modbus] Ready to write multiple registers at 0x7c: [1, 1, 62411, 65535, 0, 0, 30, 0, 0, 0, 0, 0, 120] online: True 
    

    Now the target is 3125W house load, while the bound is now set to 6805W (The 3680W export limit plus the 3125W house load). The resulting target is the unchanged 3125W house load required from the battery. The battery now covers the house as it should rather than import

image

Notice how the change now allows the battery to discharge to cover the house load. While before it was having to import from the grid because the value was being clamped incorrectly.

The bound check was incorrectly adding on house load. This means the more the house uses, the less the inverter was allowed to output to the home. This is backwards.

Instead the more the house uses, the more the inverter should be allowed to output power so that it can continue to cover the house load, and still export to the grid up to the grid export limit.
@TCWORLD
Copy link
Contributor Author

TCWORLD commented Nov 7, 2025

@fxstein Could you check this is what you had intended by your changes in #1694?

@fxstein
Copy link
Contributor

fxstein commented Nov 7, 2025

Let me check. Might have missed testing this case with the rewrite. I will test tonight when I get back from my trip.

elif ap_target < 0:
# Exporting (negative = export).
# Inverter output cannot be more than the export limit plus any used by the house load
export_bound = -(export_limit + house_load)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this looks correct. I must have missed testing exporting. I will validate this later today.

The mode 1 loop was calling autorepeat_stop() on the mode 8 trigger. This meant that the mode 1 run loop never actually stopped running.

If trying to then use mode 8, the still running mode 1 loop would cancel the newly started mode 8 loop.
@TCWORLD TCWORLD changed the title Correct Mode 1 Export Limit Bound Check Correct Mode 1 Export Limit Bound and Loop Exit Nov 7, 2025

if power_control == "Disabled":
autorepeat_stop(datadict, "powercontrolmode8_trigger")
autorepeat_stop(datadict, "remotecontrol_trigger")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

@fxstein
Copy link
Contributor

fxstein commented Nov 7, 2025

Confirmed. Thank you!

My apologies for missing those two earlier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants