How to make "more advanced" dumb central heating thermostat smart

In my home I have a central gas heater controlled by a single room thermostat. What I want to achieve is a full smart heating solutions with TRVs controlled by homeassistant & sensors for doors/windows/temp for all rooms in order to increase efficiency and reduce costs.

The issue: there is already a half good solution with using a simple shelly 1 switch to turn on/off the central heater with whatever logic I want in homeassistant. However, in this case the central heater will always run at 100% power until turned off by the shelly switch. That is not going to increase efficiency!

The central heater controls: my central heater (a Junkers controlled by a Ceracontrol TR100) is more advanced than that and can modulate the amount of gas it uses to heat based on how far from the target temp the room thermostat is. The wiring is like this:

  1. ++ / 24V
  2. PWM/Signal
  3. – / GND

On the PWM/Signal line changes in voltage tell the cental heater at what power to run:

0-4.3V heating is OFF 
4.3V - 20.4V heating power 0-100% 
20.4V-24V heating at maximum 

And the final quirk: when heating is off, the circuit is CLOSED and when the heating is on the circuit OPENS ( I took the info from someone using a simple shelly 1 with the same wiring, saying the heating starts when the shelly is on the off position and shuts down when it’s turned on)

My question: based on ALL the above limitations, is there some sort of off the shelf hardware that could control my central heater?

I was thinking about a dimmer switch, as through dimming the voltage can be adjusted like for example a Shelly Dimmer 2 (SHEL-2DIM) that can run on 12/24V BUT how can I make it work if the switch has to be in an open state for the heater to work? I mean, can I adjust the dimming when the switch thinks it’s off? Am I missing something? Are there other, simpler solutions? Any help is appreciated!

You need to switch both the #1 24v and control PWM voltage #2 4-24v?

I would think you could use switch and dimmer.
Switch to #1
Dimmer to #2

Both could connect in parallel to 24v so dimmer would not shut off when #1 off but still be able to control #2 voltage.

I presume #1 controls all off/on but if not you may need to simply setup so #2 is <4v when #1 off. When turning on you could set #2 voltage then #1 on to ensure it comes on at expected level.

@dexonter is that a solution here?
https://community.home-assistant.io/t/control-junkers-gas-heating-1-2-4-interface-with-home-assistant/