There was a similar question here recently. One thing to be aware of, if there is already a programmer to set a schedule for the boiler (rather than it running 24/7), then the live feed at the old thermostat may be switched the programmer. Thus the smart thermostat would loose power at times and wifi instructions would not be executed.
You could choose a battery operated one, or rewire the existing cable at the boiler/wiring centre end.
It's become common to use a battery powered wifi programmer, rf linked to its receiver which is hard wired in the vicinity of the boiler or wiring centre. So no longer any need for cable to the stat.
Though I've discovered with UFH and numerous thermostats, replacing batteries is a pain!