springfall2008 / batpred

Home battery prediction and charging automation for Home Assistant, supporting many inverter types
https://springfall2008.github.io/batpred/
118 stars 41 forks source link

Predbat crashed #795

Closed SwiftRR closed 7 months ago

SwiftRR commented 7 months ago

Describe the bug I noticed that my PredBat plan was not updating at 15:30 pm (not changed since 14:30). I had been working on Charts so don't know whether I had broken anything.

I looked at my PredBat dashboard and noticed an exception: Changed to ERROR: Exception raised Can't pickle <function wrapped_run_prediction_charge at 0x7f9b41f7e0>: it's not the same object as predbat.wrapped_run_prediction_charge

I restarted Home Assistant and eventually PredBat leapt back into action, much to my relief. Before this Predbat was being shown as 'null'. As Prdedbast reappeared, I noticed that the entities were all loading one by one from the Status information.

Predbat version 7.16.2 (set to automatically upload)

xxxx

Environment details

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. If you are not keeping the full logs then please enable this in appdaemon.yaml (see the installation instruction in the Predbat docs area for details on how to do this). I have attached predbat log.

predbat.log

Thanks Rob

SwiftRR commented 7 months ago

I have had the same issue again. Prior to this, I was setting up an automation for car charging which I enabled to test everything out. I have a zappi and have used the yaml automation for zappi in the documentation: Car charging planning. I had to restart HA to get predbat back, including refreshing the server connection (My Raspberry Pi4). Before I refreshed the server connection, Predbat seemed to be frozen trying to load the current predbat update v7.16.2 (which I had running before anyway). I have attached a screenshot of my Status report.

Screenshot 2024-02-28 at 16 44 35

I have also attached my Predbat log. predbat-2.log

Thanks

Rob

springfall2008 commented 7 months ago

I suspect it relates to an update that didn't update the forked threads and restarting appdeamon would fix it. I should probably change the update code to wait for idle threads first or kill the pool...

springfall2008 commented 7 months ago

Fix pushed to main for the next release