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

Error: Exception raised 'SOC_kWh' #2027

Open
thewookiewon opened this issue Feb 18, 2025 · 4 comments
Open

Error: Exception raised 'SOC_kWh' #2027

thewookiewon opened this issue Feb 18, 2025 · 4 comments
Assignees
Labels
bug Something isn't working fixed

Comments

@thewookiewon
Copy link

Describe the bug
Error encountered in the log file immediately after a restart of predbat

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

Predbat version

1.2.4 addon

Environment details

  • GivEnergy 3.6kw hybrid + 9.5 & 5.2 batteries
  • Standard HAOS installer
  • Raspberry Pi 5

Screenshots
NA

Log file
2025-02-18 18:00:36.524351: Error: Exception raised 'SOC_kWh'
2025-02-18 18:00:36.526248: Error: Traceback (most recent call last):
File "/config/predbat.py", line 970, in update_time_loop
self.update_pred(scheduled=False)
File "/config/predbat.py", line 574, in update_pred
self.fetch_inverter_data()
File "/config/execute.py", line 640, in fetch_inverter_data
inverter.update_status(self.minutes_now)
File "/config/inverter.py", line 847, in update_status
self.soc_kw = dp3(self.rest_data["Power"]["Power"]["SOC_kWh"] * self.battery_scaling)
KeyError: 'SOC_kWh'
2025-02-18 18:00:36.541392: Info: record_status Error: Exception raised 'SOC_kWh'
2025-02-18 18:00:36.541550: Error: 'SOC_kWh'
Traceback (most recent call last):
File "/config/hass.py", line 190, in timer_tick
item"callback"
File "/config/predbat.py", line 976, in update_time_loop
raise e
File "/config/predbat.py", line 970, in update_time_loop
self.update_pred(scheduled=False)
File "/config/predbat.py", line 574, in update_pred
self.fetch_inverter_data()
File "/config/execute.py", line 640, in fetch_inverter_data
inverter.update_status(self.minutes_now)
File "/config/inverter.py", line 847, in update_status
self.soc_kw = dp3(self.rest_data["Power"]["Power"]["SOC_kWh"] * self.battery_scaling)
KeyError: 'SOC_kWh'

Predbat debug yaml file
Will upload later

@thewookiewon
Copy link
Author

predbat_debug.yaml.txt

@thewookiewon
Copy link
Author

Looks like I had to manually restart the GivTCP addon too, wonder if your recent changes to self heal Predbat might need to toggle a restart of GivTCP too?

springfall2008 added a commit that referenced this issue Feb 18, 2025
@springfall2008
Copy link
Owner

I'll also add code to prevent this from causing a crash

@springfall2008 springfall2008 added the bug Something isn't working label Feb 18, 2025
springfall2008 added a commit that referenced this issue Feb 18, 2025
* Catch REST crash

#2027

* [pre-commit.ci lite] apply automatic fixes

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
@springfall2008
Copy link
Owner

Fix on main

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