batpred icon indicating copy to clipboard operation
batpred copied to clipboard

[Bug] Solis (GS_fb00): PredBat v8.39.9 enters Export/Charge state but fails to write time slots and switches (0 register writes)

Open Gammaed opened this issue 6 months ago • 1 comments

Environment:

  • PredBat Version: v8.39.9 (Issue did not exist in v8.39.4)
  • Inverter: Ginlong Solis RHI-3P (Firmware FB00)
  • Integration: wills106 Solax Modbus v4.1.4

Description: After updating PredBat to v8.39.9, the system successfully calculates plans and enters the correct states (e.g., "Exporting" or "Charging") on the PredBat dashboard. However, it completely fails to write these commands to the inverter. It no longer updates the time. entities or toggles the switch. entities in Home Assistant.

Symptoms:

  1. The PredBat dashboard correctly displays: Status: Exporting target 100%-97%.
  2. Looking at the Solis Modbus integration, the Discharge Time Slot 1 Switch remains OFF.
  3. The Discharge Time Slot 1 times remain completely unchanged.
  4. The inverter does nothing.

Log Evidence: The logs show that PredBat correctly identifies the inverter (Type GS_fb00 Ginlong Solis) and decides to export, but it skips the actual Modbus writes: Inverter 0 Exporting now - current SoC 7.7kWh and target 7.35kWh and power adjust 1.0 Inverter 0 Adjust force export to True, change times from 07:58:00 - 09:02:00 to 07:58:00 - 09:02:00 Inverter 0 Exporting, not adjusting SoC target Inverter 0 count register writes 0

As you can see, it hits count register writes 0 during an active force export window.

Configuration (apps.yaml): I am mapping the times and switches directly to the Solax Modbus entities: charge_start_time:

  • time.solis_rhi_3p_grid_time_of_use_charge_start_slot_1

... etc ...

scheduled_charge_enable:

  • switch.grid_time_of_use_charging_period_1

Conclusion: It seems a recent update (between v8.39.4 and v8.39.9) regarding Solis GS_fb00 handling broke the actual execution of the commands. PredBat is calculating perfectly, but the final execution (toggling the switch and writing the times) is skipped.

Could you look into why the Solis register writes are being

Gammaed avatar May 31 '26 19:05 Gammaed

please can you include your full apps.yaml and the logfile

be useful if you can confirm predbat is working fine if you revert to an older version

gcoan avatar May 31 '26 21:05 gcoan

Hi @gcoan,

Thanks for your quick reply!

To answer your question: Yes, I can confirm that when I revert to an older version (like v8.39.4), PredBat works perfectly again and writes the time slots and switches to the inverter without any issues.

However, when I updated to the latest version (v8.39.9), things got worse. Not only did it skip the register writes (count register writes 0), but the entire PredBat system started crashing completely. The log is filled with Web Socket 502 errors right before it terminates.

Below is a snippet of the exact error from my log when running v8.39.9, followed by my apps.yaml config.

Log Snippet (PredBat terminating with 502 errors):

2026-05-31 17:49:11.833579: Error: Web Socket exception in startup: 502, message='Invalid response status', url='http://supervisor/core/api/websocket'
2026-05-31 17:49:11.837992: Error: Traceback (most recent call last):
  File "/config/ha.py", line 417, in socketLoop
    async with session.ws_connect(url) as websocket:
  File "/usr/local/lib/python3.12/dist-packages/aiohttp/client.py", line 1521, in __aenter__
    self._resp: _RetType = await self._coro
  File "/usr/local/lib/python3.12/dist-packages/aiohttp/client.py", line 1104, in _ws_connect
    raise WSServerHandshakeError(
aiohttp.client_exceptions.WSServerHandshakeError: 502, message='Invalid response status', url='http://supervisor/core/api/websocket'
2026-05-31 17:49:48.388401: Error: Too many API errors, stopping
2026-05-31 17:49:48.558737: Stopping Predbat
2026-05-31 17:49:48.559394: Predbat terminating

My apps.yaml configuration:

pred_bat:
  module: predbat
  class: PredBat
  prefix: predbat
  template: false
  currency: "Euro"
  timezone: Europe/Amsterdam
  set_one_rate: false
  metric_standing_charge: 0.197
  metric_octopus_import: 'sensor.current_electricity_price_all_in'
  metric_octopus_export: 'sensor.current_electricity_price_all_in'
  metric_octopus_import_scale: 100.0
  metric_octopus_export_scale: 100.0
  days_previous:
  - 7
  - 14
  days_previous_weight:
  - 1.0
  - 0.5
  forecast_hours: 48
  forecast_plan_hours: 24
  pv_forecast_today: sensor.solcast_pv_forecast_forecast_today
  pv_forecast_tomorrow: sensor.solcast_pv_forecast_forecast_tomorrow
  inverter_limit_charge_threshold: 0
  inverter_type: "GS_fb00"
  solax_modbus_new: true
  num_inverters: 1
  battery_capacity: 35.0
  battery_voltage: 52
  charge_rate_max: 10000
  discharge_rate_max: 10000
  battery_rate_max:
  - 10000
  inverter_limit: 10000

  # HARDE EIS: Dit moeten integers (Watts) zijn, GEEN helpers!
  inverter_limit_charge:
  - 10000
  inverter_limit_discharge:
  - 10000

  timed_charge_current:
  - input_number.predbat_charge_current_helper
  timed_discharge_current:
  - input_number.predbat_discharge_current_helper

  inverter_battery_rate_min:
  - 100
  inverter_clock_skew_start: -2
  inverter_clock_skew_end: 2
  inverter_clock_skew_discharge_start: -2
  inverter_clock_skew_discharge_end: 2
  charge_start_hour:
  - time.solis_rhi_3p_grid_time_of_use_charge_start_slot_1
  charge_start_minute:
  - time.solis_rhi_3p_grid_time_of_use_charge_start_slot_1
  charge_end_hour:
  - time.solis_rhi_3p_grid_time_of_use_charge_end_slot_1
  charge_end_minute:
  - time.solis_rhi_3p_grid_time_of_use_charge_end_slot_1
  charge_limit:
  - number.solis_rhi_3p_grid_time_of_use_charge_cut_off_soc_slot_1
  scheduled_charge_enable:
  - switch.grid_time_of_use_charging_period_1
  discharge_start_hour:
  - time.solis_rhi_3p_grid_time_of_use_discharge_start_slot_1
  discharge_start_minute:
  - time.solis_rhi_3p_grid_time_of_use_discharge_start_slot_1
  discharge_end_hour:
  - time.solis_rhi_3p_grid_time_of_use_discharge_end_slot_1
  discharge_end_minute:
  - time.solis_rhi_3p_grid_time_of_use_discharge_end_slot_1
  discharge_limit:
  - number.solis_rhi_3p_grid_time_of_use_discharge_cut_off_soc_slot_1
  scheduled_discharge_enable:
  - switch.grid_time_of_use_discharge_period_1
  reserve:
  - number.solis_rhi_3p_backup_soc
  battery_min_soc: 21
  best_soc_min: 7.35
  best_soc_keep: 7.35
  best_soc_max: 33.25
  best_soc_export: 7.35
  charge_limit_default: 95
  battery_charge_power_curve:
    100: 0.79
    99: 0.79
    98: 0.79
    97: 0.79
    96: 0.79
    95: 0.88
    94: 0.82
    93: 0.91
    92: 0.93
    91: 0.93
    90: 0.93
    89: 0.93
    88: 0.93
    87: 0.93
    86: 0.92
    85: 0.92
    80: 0.95
    75: 0.98
    70: 1.0
    65: 1.0
    60: 1.0
    55: 1.0
    50: 1.0
    45: 1.0
    40: 1.0
    35: 1.0
    30: 1.0
    25: 1.0
    20: 1.0
  battery_discharge_power_curve:
    100: 1.0
    95: 1.0
    90: 1.0
    85: 1.0
    80: 1.0
    75: 1.0
    70: 1.0
    65: 1.0
    60: 1.0
    55: 1.0
    50: 1.0
    45: 1.0
    40: 1.0
    35: 1.0
    30: 1.0
    25: 1.0
    20: 1.0
  soc_percent: sensor.solis_rhi_3p_battery_soc
  soc_max: 35.0
  battery_power: sensor.solis_rhi_3p_battery_power_net
  pv_power:
  - sensor.solis_rhi_3p_total_pv_power
  load_power: sensor.solis_rhi_3p_household_load_power
  grid_power: sensor.solis_rhi_3p_meter_total_active_power
  num_cars: 1
  car_charging_from_battery: False
  car_charging_planned:
    - sensor.bcu101866_vehicle_status
  car_charging_planned_response:
    - vehicle_detected
    - charging
    - Charging
    - Ready
    - ready
    - available
  car_charging_battery_size:
    - 84
  car_charging_limit:
    - input_number.ioniq5_min_soc
  car_charging_hold:
    - input_boolean.predbat_auto_pauze
  car_charging_hold_force: True
  car_charging_min_soc:
    - 25
  car_charging_rate: 11.0
  car_value: 0.40
  ev_charging_load: sensor.bcu101866_total_kw
  car_charging_soc:
    - sensor.ioniq_5_ev_battery_level
  load_today: sensor.solis_rhi_3p_today_energy_consumption
  import_today: sensor.solis_rhi_3p_today_energy_imported_from_grid
  export_today: sensor.solis_rhi_3p_today_energy_fed_into_grid
  pv_today: sensor.solis_rhi_3p_pv_today_energy_generation
  metric_battery_cycle: 6.0
  expose_controls: true
  read_only: false
  active_control: true

Please let me know if you need any additional tests from my end to help debug the GS_fb00 handling in the newer versions.

Gammaed avatar Jun 01 '26 07:06 Gammaed