Skip to content

Plan not generating after 8.26.2 #2815

Closed

Description

@pantherale0

Describe the bug

Since 8.26.2 the plan is no longer generating and the following error is provided:

UnboundLocalError: cannot access local variable 'soc_kwh' where it is not associated with a value
2025-10-24 11:00:01.964140: Info: record_status Error: Exception raised cannot access local variable 'soc_kwh' where it is not associated with a value
2025-10-24 11:00:01.964568: Error: cannot access local variable 'soc_kwh' where it is not associated with a value
Traceback (most recent call last):
  File "/config/hass.py", line 191, in timer_tick
    item["callback"](None)
  File "/config/predbat.py", line 1501, in run_time_loop
    raise e
  File "/config/predbat.py", line 1496, in run_time_loop
    self.update_pred(scheduled=True)
  File "/config/predbat.py", line 683, in update_pred
    self.fetch_inverter_data()
  File "/config/execute.py", line 663, in fetch_inverter_data
    curve = inverter.find_charge_curve(discharge=False)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/inverter.py", line 787, in find_charge_curve
    self.log("Note: Sensor with history data lengths: soc_kwh {}, charge_rate {}, battery_power {}, predbat_status {}".format(len(soc_kwh), len(charge_rate), len(battery_power), len(predbat_status)))                                                                         

Expected behaviour
Plan to generate

Predbat version

8.26.2

Environment details

  • Inverter and battery setup: Fox Modbus
  • Standard HAOS installer or Docker: HAOS
  • Anything else?

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
Can you capture a log file from the time of the issue, debug mode is not normally required.

You can download the logfile from the WebUI on the Dash tab select predbat_debug.log

Predbat debug yaml file
This is important for any plan related issues.

Once you have captured the issue go to the Web UI, in the Dash tab click on predbat_debug.yaml and wait 30 seconds for it to download. Select 'keep' if your Web Browser thinks the file is dangerous.

Rename the download file to predbat_debug.yaml.txt and upload it to Github. This will allow your plan to be reproduced and also stores all your settings for review.

Activity

  1. gcoan commented on Oct 24, 2025

    @gcoan
    Collaborator

    per the issue template:

    Log file
    Can you capture a log file from the time of the issue, debug mode is not normally required.

    You can download the logfile from the WebUI on the Dash tab select predbat_debug.log

    Predbat debug yaml file
    This is important for any plan related issues.

    Once you have captured the issue go to the Web UI, in the Dash tab click on predbat_debug.yaml and wait 30 seconds for it to download. Select 'keep' if your Web Browser thinks the file is dangerous.

    Rename the download file to predbat_debug.yaml.txt and upload it to Github. This will allow your plan to be reproduced and also stores all your settings for review.

  2. springfall2008 commented on Oct 24, 2025

    @springfall2008
    Owner

    Actually it is a new bug, fix will be released shortly

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

Metadata

Metadata

Labels

bugSomething isn't workingfixed

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions