Need help for rules on outdoor wood boiler

TL:DR Current setup not keeping up when really cold. I need some help writing a better automation.

I have an outdoor wood burning boiler which heats water. The water is piped into the house to run through radiators. The is a fan that forces air into the firebox feeding the fire. The fan is powered by a smart switch. There are temperature sensors in the water and inside the firebox. Tuning off the fan causes the fire burn very slowly and prevents the boiler from over heating.

Currently, I have automations turn off the fan if the water is above 160f and/or the firebox is above 450f. Also to turn on the fan if the water is below 150 and firebox is below 350. This helps prevent thermal runaway as the water can go over 180.

The issue is that the water temperature cant keep up during very cold days. I need to make a rule that takes into account the outside temperature (and maybe even the inside temperature) which would allow to adjust for the water heat loss rate due to the outdoor temperature.

Any suggestions for rules that would help here would be greatly appreciated.