Got a volt-free relay board, wired in parallel with the old thermostat, and added heat.set to the profile. Switch works and shows the real state. The bit I was missing in code was the reply, without it every click said no answer after 30 seconds even though the heater came on.
Still waiting for the gateway to reconnect.

