You’d start with the Persistence docs.
but
It’s a bit of a sledgehammer to squash a small nuisance. It isn’t possible to configure persistence to omit an Item, so that means a Big Job manually configuring everything else. I wouldn’t embark on that without a better reason.
Let’s take a step back and review what we’re trying to do.
External Item may be OFF or ON, with an off-timer running. Then there’s an openHAB outage for whatever reason.
openHAB restarts - we hope.
You really should have some external failsafe for this, not all OH hosts recover from unexpected power failure very well.
You might consider replacing your switch with one that starts “idle” or allows you to configure start-up state. The old one can be re-used somewhere less critical.
But let’s work with what we have today. openHAB restarts, we don’t know how long the outage was or why. We don’t (yet) know if the external switch has recovered or not, nor if it is really ON or OFF. If there was any timer, it is lost.
We can’t do anything about it until OH gets to “rules ready” stage. At that point -
The Item may be ON or OFF, but that might be a restored-on-startup state.
We cannot trust that state reflects the real device, because we don’t know what happened during the outage.
But perhaps external device is already online, and it is the truth.
Let’s just have a startup rule commanding OFF. This might not be needed, but it’s free. This might not work if the external device isn’t online yet, but it’s still free.
The Item state will probably then update to OFF, but it still might be a lie.
If the device later comes online, the Item state will get updated to ON or OFF to reflect reality.
There’s a bunch of things you could do at this point. The choice is probably going to be about how it interacts with your ‘ordinary’ rules.
If your boiler is normally only ever going in 1-hour times, do as @denominator suggests and put an ‘expire command OFF’ on the Item.
If the device comes online already unexpectedly ON, the expire timer will start. (so long as the Item is ‘falsely’ previously OFF, which the startup rule should have ensured.)
This will likely simplify your rules too.
Or, use your Thing based rule to detect device coming online, and command OFF.
Or, if you prefer to keep a rules-based timer, you can detect an unexpected OFF-to-ON transition while the timer is not running, and do something about it. It’s a fancier version of the expire which allows you to take more flexible actions - a different delay or whatever.