springfall2008 / predheat

Home heating prediction for Home Assistant
5 stars 2 forks source link

ERROR: Exception raised list index out of range #2

Closed campbellcopeland closed 3 months ago

campbellcopeland commented 7 months ago

After a while running, I get this error

2024-03-17 14:00:00.006255 INFO pred_heat: --------------- PredHeat - update at 2024-03-17 14:00:00.005216+00:00 2024-03-17 14:00:00.433900 INFO pred_heat: We have 1 days of historical data 2024-03-17 14:00:00.434991 INFO pred_heat: Heating active False Heat loss watts 235 degrees 0.125 watts per degree 1880.0 heating energy so far 49.42688999999393 2024-03-17 14:00:00.442212 INFO pred_heat: Standing charge is set to 27.467999999999996 p 2024-03-17 14:00:00.467301 INFO pred_heat: Todays energy import 49.43 kwh cost 229.35 p 2024-03-17 14:00:00.468108 INFO pred_heat: External temp now 12.3 2024-03-17 14:00:01.158760 INFO pred_heat: External temp now 12.3 2024-03-17 14:00:01.165562 INFO pred_heat: Thermostat adjusts [{'from': 15.0, 'to': 20.5, 'end': 5, 'reached': 65, 'timeframe': 60, 'start': 0}, {'from': 20.5, 'to': 25.0, 'end': 370, 'reached': 370, 'timeframe': 0, 'start': 370}, {'from': 18.0, 'to': 20.5, 'end': 815, 'reached': 1015, 'timeframe': 200, 'start': 615}, {'from': 20.5, 'to': 25.0, 'end': 1810, 'reached': 1810, 'timeframe': 0, 'start': 1810}, {'from': 18.0, 'to': 20.5, 'end': 2255, 'reached': 2440, 'timeframe': 185, 'start': 2070}] 2024-03-17 14:00:01.181808 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2070 2024-03-17 14:00:01.182988 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2 2024-03-17 14:00:01.189448 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2080 2024-03-17 14:00:01.202201 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2085 2024-03-17 14:00:01.213789 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2090 2024-03-17 14:00:01.220172 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2095 2024-03-17 14:00:01.221213 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2100 2024-03-17 14:00:01.232867 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2105 2024-03-17 14:00:01.249750 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2110 2024-03-17 14:00:01.256214 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2115 2024-03-17 14:00:01.262731 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2120 2024-03-17 14:00:01.271363 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2125 2024-03-17 14:00:01.272718 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2130 2024-03-17 14:00:01.273742 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2135 2024-03-17 14:00:01.274557 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2140 2024-03-17 14:00:01.275468 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2145 2024-03-17 14:00:01.276412 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2150 2024-03-17 14:00:01.277307 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2155 2024-03-17 14:00:01.278160 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2160 2024-03-17 14:00:01.279025 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2165 2024-03-17 14:00:01.279930 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2170 2024-03-17 14:00:01.280810 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2175 2024-03-17 14:00:01.281587 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2180 2024-03-17 14:00:01.282429 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2185 2024-03-17 14:00:01.283272 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2190 2024-03-17 14:00:01.284260 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2195 2024-03-17 14:00:01.285411 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2200 2024-03-17 14:00:01.286336 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2205 2024-03-17 14:00:01.287196 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2210 2024-03-17 14:00:01.288054 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2215 2024-03-17 14:00:01.288975 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2220 2024-03-17 14:00:01.289994 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2225 2024-03-17 14:00:01.290866 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2230 2024-03-17 14:00:01.291734 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2235 2024-03-17 14:00:01.292529 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2240 2024-03-17 14:00:01.293552 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2245 2024-03-17 14:00:01.294511 INFO pred_heat: Adjusted target temperature for smart heating to 20.5 at minute 2250 2024-03-17 14:00:01.295212 INFO pred_heat: ERROR: Exception raised list index out of range

campbellcopeland commented 7 months ago

@springfall2008 Bug in line 643: if adjust_ptr >= len(adjust):

Needs changed to: if adjust_ptr >= len(adjustment_points):

springfall2008 commented 7 months ago

Thanks, I've made a new release to fix this