I am attempting to wire a new double pole four wire 240 volt thermostat to replace the single pole thermostat that is pictured. Coming into the junction box on the right are two Komax lines. On the left side of the box one line is going out. You can see two black wires connected (lower red wire nut) to the black wire of the old thermostat. Also on the right side are several white wires (neutrals) connected by a red wire nut.
The red wire coming off of the thermostat is connected to the single black wire.
Attached is also a wiring diagram. I guess my main question is how do I determine which of the wires is coming in from the panel and which is going to the heater? Any suggestions or thoughts are greatly appreciated.....