Skip to content

Error with SOC - could not convert string to float: 'unavailable' #3942

@DrJohnM61

Description

@DrJohnM61

Describe the bug
Since 8.32.2, have been getting the following message in the log file and Predbat stuck in "re-evaluating". Plan also not being updated.

2026-05-19 14:18:07.563038: Creating task: <coroutine object WebInterface.start at 0x7f94f3ece0>
Web interface started
2026-05-19 14:18:09.870117: Creating task: <coroutine object ComponentBase.start at 0x7f9535cca0>
Watching ['/config/prediction.py', '/config/octopus.py', '/config/download.py', '/config/stromligning.py', '/config/kraken_auth_mixin.py', '/config/axle.py', '/config/alertfeed.py', '/config/ha.py', '/config/db_manager.py', '/config/apps.yaml', '/config/kraken.py', '/config/output.py', '/config/userinterface.py', '/config/components.py', '/config/web_helper.py', '/config/compare.py', '/config/gateway_status_pb2.py', '/config/component_base.py', '/config/predbat.py', '/config/web.py', '/config/unit_test.py', '/config/carbon.py', '/config/plugin_system.py', '/config/hass.py', '/config/ohme.py', '/config/solcast.py', '/config/web_metrics_dashboard.py', '/config/predheat.py', '/config/inverter.py', '/config/execute.py', '/config/db_engine.py', '/config/utils.py', '/config/storage.py', '/config/const.py', '/config/config.py', '/config/solax.py', '/config/oauth_mixin.py', '/config/gecloud.py', '/config/fetch.py', '/config/load_predictor.py', '/config/marginal.py', '/config/temperature.py', '/config/energydataservice.py', '/config/gateway.py', '/config/fox.py', '/config/futurerate.py', '/config/predbat_metrics.py', '/config/plan.py', '/config/solis.py', '/config/web_mcp.py', '/config/load_ml_component.py'] for changes
2026-05-19 14:18:15.351471: Warn: Found 1 periods of zero load with power data, filling using power integration
2026-05-19 14:18:16.184409: Error: Exception raised could not convert string to float: 'unavailable'
2026-05-19 14:18:16.187817: Error: Traceback (most recent call last):
  File "/config/predbat.py", line 1708, in update_time_loop
    self.update_pred(scheduled=False)
  File "/config/predbat.py", line 826, in update_pred
    self.fetch_inverter_data()
  File "/config/execute.py", line 738, in fetch_inverter_data
    inverter = Inverter(self, id)
               ^^^^^^^^^^^^^^^^^^
  File "/config/inverter.py", line 388, in __init__
    self.battery_size_tracking()
  File "/config/inverter.py", line 579, in battery_size_tracking
    found_size = self.find_battery_size(self.nominal_capacity)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/inverter.py", line 698, in find_battery_size
    soc_max = max(float(dp0(float(state["state"]))) for state in soc_kw_data[0]) if soc_kw_data and len(soc_kw_data) > 0 else None
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/inverter.py", line 698, in <genexpr>
    soc_max = max(float(dp0(float(state["state"]))) for state in soc_kw_data[0]) if soc_kw_data and len(soc_kw_data) > 0 else None
                            ^^^^^^^^^^^^^^^^^^^^^
ValueError: could not convert string to float: 'unavailable'
2026-05-19 14:18:16.200948: Warn: record_status Error: Exception raised could not convert string to float: 'unavailable'
2026-05-19 14:18:16.201032: Error: timer_tick caught exception: could not convert string to float: 'unavailable'
Traceback (most recent call last):
  File "/config/hass.py", line 279, in timer_tick
    item["callback"](None)
  File "/config/predbat.py", line 1714, in update_time_loop
    raise e
  File "/config/predbat.py", line 1708, in update_time_loop
    self.update_pred(scheduled=False)
  File "/config/predbat.py", line 826, in update_pred
    self.fetch_inverter_data()
  File "/config/execute.py", line 738, in fetch_inverter_data
    inverter = Inverter(self, id)
               ^^^^^^^^^^^^^^^^^^
  File "/config/inverter.py", line 388, in __init__
    self.battery_size_tracking()
  File "/config/inverter.py", line 579, in battery_size_tracking
    found_size = self.find_battery_size(self.nominal_capacity)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/inverter.py", line 698, in find_battery_size
    soc_max = max(float(dp0(float(state["state"]))) for state in soc_kw_data[0]) if soc_kw_data and len(soc_kw_data) > 0 else None
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/inverter.py", line 698, in <genexpr>
    soc_max = max(float(dp0(float(state["state"]))) for state in soc_kw_data[0]) if soc_kw_data and len(soc_kw_data) > 0 else None
                            ^^^^^^^^^^^^^^^^^^^^^
ValueError: could not convert string to float: 'unavailable'

A clear and concise description of what the bug is.
Predbat is stuck in "re-evaluting" as is apparently caused by a code issue where the SOC is unavailable.

Further, I have checked the SOC entity defined in the APPS.YAML and it is reported as 27KWh

Expected behaviour
A clear and concise description of what you expected to happen.

Expect that the correct SOC is used.

Predbat version

8.39.4

Environment details

  • Inverter and battery setup
    -Givenergy dual AIO with Gateway
  • Standard HAOS installer or Docker
    HAOS
  • Anything else?
    The log file seems to show that the battery has no capacity, however, the entity being used shows 27KWh
Image

Screenshots
If applicable, add screenshots to help explain your problem. The most useful ones can be your battery chart, the Predbat HTML plan and your current settings in HA.

Log file

predbat (3).log

Predbat debug yaml file

predbat_debug.yaml (6).txt

Metadata

Metadata

Labels

DualAIObugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions