That’s an unusual ask I would think. I haven’t seen a situation where a relay is used to add or subtract resistance to a circuit, but it’s not unfeasible. Normally that’s taken care of using discrete components or using a decade box, but your objective is clearly to have a mechanical fallback to the default function in the event of a system-loss, so I can see where you are coming from.
Looking at a resistance table for the PT1000 I notice that the device appears to be linear in terms of the resistance over temperature, but I see another minor problem though:
The default resistance at 0C is 1000 ohm, at 10C it’s 1039.0 ohm, at 20C 1077.9 ohm and 30C it’s 1116.7 ohm. Problem being, if you add a relay the contact resistance is likely to add very slightly to this and the probe will read higher than designed (probably not a significant issue, but bear it in mind). The delta resistance in 1 degree C is going to be 3.9 ohms - that’s pretty small.
Another item to bear in mind is that the RT1000 might be returning a voltage straight back to the boiler rather than a resistance. You can probably tell this by looking at how many pins/wires are within the lead out to it, but if they are more than 2 or 3, it indicates that it’s possibly operating in a Wheatstone bridge and you’d need to be simulating that using a DAC (module?) on the rasp-pi4.
Anyhow, onto achievable goals. If it turns out that the external sensor is being read as a resistance, you may be able to use a single pole relay (SPST) to change over from the external sensor to a variable resistance simulated sensor by creating a paralleled potentiometer and resistor.
I played around with some values and found that a 2k ohm resistor (2x 1k ohm) in parallel with a 10k potentiometer would give you a workable range of 670 ohms right up to 1,700 ohms over the full movement of the wiper. That might provide you with a reasonable granularity which you need to simulate the external source and also provide the fall-back when the PI isn’t connected/functional. You could add in a second 1k potentiometer as a fine-adjustment, or play around with the values to create mixed series & parallel circuit which is better tuned.
To answer the questions at the bottom:
Using the GPIO pins from HA seems to be tricky, right? Would it be better to use a relais board? Do I have to buy a special board that opens the contact on power so the resistor is short when there is no power at all?
I’d do this using a relay attached to the GPIO with a power transistor and back-emf diode added for protection. Then initialise the relay once the PI is up and then drop the relay (using the pull-up or pull-down circuit on the PI) when the PI goes down. I don’t use the PI, but this seems do-able on ESP32 anyway.