Definition: tof("id", cond, preset_ms [, retentive]) — Allowed: string literal id and numeric expressions; Not allowed: expression id.
Off-delay timer: returns 1 while cond is true, and stays 1 for preset_ms after cond goes false. When retentive is non-zero, elapsed time persists across cond transitions until t_reset("id").
// Keep fan on for 10s after heat demand drops
heat_demand = in(1);
if (tof("fan_tail", heat_demand, 10000)) {
out(3) = 1;
} else {
out(3) = 0;
}