Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Predbat crashes when given a load_scaling to predbat_manual_api #1718

Closed
gcoan opened this issue Dec 11, 2024 · 2 comments
Closed

Predbat crashes when given a load_scaling to predbat_manual_api #1718

gcoan opened this issue Dec 11, 2024 · 2 comments
Assignees
Labels
bug Something isn't working fixed

Comments

@gcoan
Copy link
Collaborator

gcoan commented Dec 11, 2024

Describe the bug
I have written a script (based on my Octopus Power up automation) to send details of the Octopus Saving session to Predbat as a rate_export_override

I set select.predbat_manual_api to the string:

rates_export_override?date=2024-12-11&start=21:00:00&end=22:00:00&rate_increment=60&load_scaling=0.1

And Predbat crashes with:

2024-12-11 18:39:28.913696: Error: Exception raised can't multiply sequence by non-int of type 'float'
2024-12-11 18:39:28.917517: Error: Traceback (most recent call last):
  File "/config/predbat.py", line 10901, in update_time_loop
    self.update_pred(scheduled=False)
  File "/config/predbat.py", line 9707, in update_pred
    recompute = self.calculate_plan(recompute=recompute)
  File "/config/predbat.py", line 7844, in calculate_plan
    load_minutes_step = self.step_data_history(
  File "/config/predbat.py", line 1891, in step_data_history
    values[minute] = self.dp4((value + load_extra) * scaling_dynamic * scale_today * scale_fixed)
TypeError: can't multiply sequence by non-int of type 'float'

2024-12-11 18:39:28.949677: Info: record_status Error: Exception raised can't multiply sequence by non-int of type 'float'
2024-12-11 18:39:28.949823: Error: can't multiply sequence by non-int of type 'float'

I have tried with load scaling of 1.0 and same crash.

I'm running an old version of Predbat but I applied the patch #1649 created in response to bug #1646 but this didn't work. That fix was to allow 'rate' to contain decimals, looks like the same is needed for load_scaling

Expected behaviour
No crash !

I can apply the rate_export_override in apps.yaml and a decimal load_scaling value is accepted there, it just doesn't work via the API

Predbat version
8.5.3

Environment details
HAOS

Log file
predbat.log

@springfall2008
Copy link
Owner

Fix on main for testing

@gcoan
Copy link
Collaborator Author

gcoan commented Dec 22, 2024

Thanks @springfall2008 finally upgraded to the latest Predbat version, tested this and it works perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed
Projects
None yet
Development

No branches or pull requests

2 participants