batpred icon indicating copy to clipboard operation
batpred copied to clipboard

predheat error: TypeError: '<' not supported between instances of 'float' and 'NoneType'

Open ragg987 opened this issue 2 months ago • 4 comments

Describe the bug predheat will throw an error - see extract from log below. This error is currently intermittent - e.g. my setup ran overnight fine then this morning the error showed up even though I had made no changes. However I have also been able to force the error by changing: heat_loss_watts heat_loss_degrees

If these parameters are higher than currently set - e.g. HLW = 250 then an error occurs straightaway.

Also note if I switch off the predheat toggle then my predbat is working and stable.

Expected behaviour No error.

Predbat version 8.25.1

Environment details Add-on version: 1.2.9 System: Home Assistant OS 16.2 (amd64 / qemux86-64) Home Assistant Core: 2025.9.1 Home Assistant Supervisor: 2025.09.0

  • Inverter and battery setup
  • Standard HAOS installer or Docker
  • 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

2025-09-24 07:43:08.090724: Info: Start socket for url http://supervisor/core/api/websocket
Web interface started
2025-09-24 07:43:08.099174: Info: Web Socket active
Watching ['./inverter.py', './ohme.py', './utils.py', './userinterface.py', './alertfeed.py', './octopus.py', './output.py', './energydataservice.py', './predheat.py', './apps.yaml', './futurerate.py', './hass.py', './config.py', './predbat.py', './unit_test.py', './solcast.py', './components.py', './ha.py', './compare.py', './web.py', './fox.py', './web_helper.py', './execute.py', './db_manager.py', './plugin_system.py', './gecloud.py', './fetch.py', './plan.py', './db_engine.py', './download.py', './prediction.py'] for changes
2025-09-24 07:43:37.999166: Info: record_status Demand
2025-09-24 07:43:38.556449: ERROR: Exception raised '<' not supported between instances of 'float' and 'NoneType'
2025-09-24 07:43:38.568188: Info: record_status ERROR: Exception raised '<' not supported between instances of 'float' and 'NoneType'
2025-09-24 07:43:38.568271: Error: '<' not supported between instances of 'float' and 'NoneType'
Traceback (most recent call last):
  File "/config/hass.py", line 191, in timer_tick
    item["callback"](None)
  File "/config/predheat.py", line 642, in update_time_loop
    raise e
  File "/config/predheat.py", line 638, in update_time_loop
    self.update_pred(scheduled=False)
  File "/config/predheat.py", line 586, in update_pred
    next_volume_temp, predict_minute = self.run_simulation(self.next_volume_temp, self.heating_active)
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/predheat.py", line 382, in run_simulation
    if volume_temp < flow_temp:
       ^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '<' not supported between instances of 'float' and 'NoneType'

apps.yaml

Predbat debug yaml file

ragg987 avatar Sep 24 '25 08:09 ragg987

I also see the same error and I have predheat active

symonchester avatar Oct 02 '25 13:10 symonchester

This implies flow_temp is not set correctly

springfall2008 avatar Oct 06 '25 07:10 springfall2008

flow_temp: on mine is the actual flow temp from the heat pump sensor (sensor.climatecontrol_leaving_water_temperature)

symonchester avatar Oct 06 '25 08:10 symonchester

I'm using the flow sensor from my ASHP, which flows at around 28 to 32C. Extract from apps.yaml

    # Current flow temperature setting
    flow_temp: sensor.yutaki_1093_temp_water_out
    flow_difference_target: 4
Image

ragg987 avatar Oct 06 '25 08:10 ragg987