batpred icon indicating copy to clipboard operation
batpred copied to clipboard

Sensor to show when there is an issue with the YAML Config

Open leacho73 opened this issue 7 months ago • 3 comments

Is your feature request related to a problem? Please describe. I had noticed that I had no overnight battery export for the last few days and looking into it - the last time I patched Home Assistant, PredBat must have started before my SOC sensor was populated and as such threw an error in the apps.yaml. Unless PredBat knows the SOC of the car, it will not export overnight.

Describe the solution you'd like Either a sensor I could monitor that would show when there was an error with apps.yaml - or a notification from PredBat when there is an issue with apps.yaml - binary_sensor.predbat_components_healthy does not appear to have changed since I resolved the issue - otherwise I would have monitored this.

Describe alternatives you've considered None

Additional context Is it possible for PredBat to continue to export during overnight cheap slots even if it doesn't know the SOC of the car?

leacho73 avatar Apr 27 '26 10:04 leacho73

was there no error in predbat.status, and was the plan populated correctly?

There's an error checking automation in the documentation that picks up a lot of different predbat errors, it would be useful to see if your error would already have been detected or if the apps.yaml validation needs another sensor as you suggested

see https://springfall2008.github.io/batpred/output-data/#automated-monitoring-that-predbat-and-givtcp-are-running-ok

gcoan avatar Apr 27 '26 16:04 gcoan

Sorry for the delay - I have been waiting to re-create the issue - so I see the following in the UI:

Image

predbat.status is showing 'charging' - and error:false as an attribute.

I ran the automation you linked in above, and although it raises a critical notification is just says 'error' with no further text - I need to manually restart predbat to clear the error

leacho73 avatar May 06 '26 15:05 leacho73

ran the automation you linked in above, and although it raises a critical notification is just says 'error' with no further text - I need to manually restart predbat to clear the error

manually running the automation will do this, it needs to be installed and enabled so that it is automatically triggered when one of the failure conditions it detects occurs.

It's not possible to really tell from that screenshot what went wrong, what the validation error was with apps.yaml, and whether the automation would have picked it up or not.

Can you tell what had happened before you saw this error, what was in the predbat logs? The fact that there is no SoC suggests it failed to read apps.yaml properly. In of itself this doesn't trigger the automation, but the automation is triggered if a predbat plan isn't created, if error attribute is true, if predbat active gets stuck on, if one of the components has failed, etc.

gcoan avatar May 06 '26 21:05 gcoan

Closing since there has been no response to the last request for a while. Please open another ticket if there is still a problem.

chalfontchubby avatar Aug 20 '26 11:08 chalfontchubby

Closing since there has been no response to the last request for a while. Please open another ticket if there is still a problem.

chalfontchubby avatar Aug 20 '26 11:08 chalfontchubby